Commit Graph

28900 Commits

Author SHA1 Message Date
Joshua Colp f517c015e2 Merge "Free endpoint ACLs when destroying PJSIP endpoints." 2017-01-24 12:44:26 -06:00
George Joseph a5d8761721 Merge "res_pjsip_endpoint_identifier_ip: Read settings before resolving." 2017-01-24 08:21:52 -06:00
Mark Michelson 4bfeda6ee4 Free endpoint ACLs when destroying PJSIP endpoints.
If endpoint ACLs were specified, they were not being freed
when endpoints were destroyed. On systems with realtime endpoints, this
could add up quickly since each DB lookup would allocate the ACL without
freeing it.

ASTERISK-26731 #close
Reported by Ustinov Artem

Change-Id: Ie1f8bf5b7a0de628c975beba01e69c56893331ad
2017-01-23 16:22:34 -06:00
George Joseph 2481a55fba Merge "LISTFILTER: Remove outdated ERROR message." 2017-01-23 15:02:09 -06:00
zuul 697fde39ac Merge "res_pjsip_pubsub.c: Fix incorrect message string wrapping." 2017-01-23 14:07:49 -06:00
Joshua Colp e2da0021b9 Merge "res_pjsip_pubsub.c: Fix AMI event list counts." 2017-01-23 11:10:25 -06:00
Joshua Colp 23690c1b35 res_pjsip_endpoint_identifier_ip: Read settings before resolving.
An option has been added, srv_lookups, which controls whether
SRV lookups are performed on the provided match hosts or not.
It was possible for this option to be applied after resolution
had already happened.

This change makes it so hosts are stored away, settings are read
and applied, and then resolution is done. This ensures that no
matter the ordering the srv_lookups option is in effect.

ASTERISK-26735

Change-Id: I750378cb277be0140f8c5539450270afbfc43388
2017-01-23 10:10:27 -06:00
zuul 52f8a9e2ff Merge "res_pjsip_pubsub.c: Eliminate trivial SCOPED_LOCK usage." 2017-01-23 10:04:50 -06:00
Joshua Colp 4afe3c806e Merge "res_pjsip: alloca can never fail." 2017-01-23 05:53:23 -06:00
Richard Mudgett cfe72c39cf LISTFILTER: Remove outdated ERROR message.
Feeding LISTFILTER an empty variable results in an invalid ERROR message.
Earlier changes made the message useless because we can no longer tell if
the variable is empty or does not exist.  It is valid to try to remove a
value from an empty list just as it is valid to try to remove a value that
is not in a non-empty list.

* Removed the outdated ERROR message.

* Added more test cases to the LISTFILTER unit test.

Change-Id: Ided9040e6359c44a335ef54e02ef5950a1863134
2017-01-22 17:56:15 -06:00
Joshua Colp b4fa17f516 Merge "abstract/fixed/adpative jitter buffer: disallow frame re-inserts" 2017-01-20 13:49:12 -06:00
zuul 68968bc226 Merge "debug_utilities: Create ast_loggrabber" 2017-01-20 13:45:33 -06:00
Richard Mudgett ef9164b9ca res_pjsip_pubsub.c: Fix AMI event list counts.
Fix the AMI PJSIPShowSubscriptionsInbound, PJSIPShowSubscriptionsOutbound,
and PJSIPShowResourceLists actions event counts.  The reported counts may
not necessarily be accurate depending on what happens.

The subscriptions count would be wrong if Asterisk ever has outbound
subscriptions.

The resource list count could be wrong if a list were added or removed
during the AMI action being processed.

Change-Id: I4344301827523fa174960a42c413fd19abe4aed5
2017-01-20 12:39:41 -06:00
Richard Mudgett ab858295a2 res_pjsip_pubsub.c: Fix incorrect message string wrapping.
Change-Id: Id771e6fe56d89ce365ddcbb423f820af97211120
2017-01-20 12:37:19 -06:00
Richard Mudgett 6d648185bc res_pjsip_pubsub.c: Eliminate trivial SCOPED_LOCK usage.
Change-Id: Ie0b69a830385452042fa19e7d267c6790ec6b6be
2017-01-20 12:33:56 -06:00
Richard Mudgett 90f3b1270c res_pjsip: alloca can never fail.
Change-Id: Ia2a6158e5fdf311bc2a1c0c43417978de504b1f1
2017-01-20 12:31:05 -06:00
George Joseph d16b3a9917 debug_utilities: Create ast_loggrabber
ast_loggrabber gathers log files from customizable search patterns,
optionally converts POSIX timestamps to a readable format and
tarballs the results.

Also a few tweaks were made to ast_coredumper.

Change-Id: I8bfe1468ada24c1344ce4abab7b002a59a659495
(cherry picked from commit c709152878)
2017-01-20 11:20:22 -06:00
Richard Mudgett 48730ae65e res_pjsip_outbound_authenticator_digest.c: Fix spacing in warning messages.
Change-Id: I573f0343c0c63a785cd4da60d57cc9f8b9ce7f49
2017-01-20 07:22:13 -06:00
zuul fb02cc5a8b Merge "res_calendar: delete old calendars after reload" 2017-01-17 18:44:02 -06:00
Joshua Colp fdf481636a Merge "app_queue: Add QueueUpdate application." 2017-01-17 17:26:10 -06:00
Kevin Harwell 283c16c6b6 abstract/fixed/adpative jitter buffer: disallow frame re-inserts
It was possible for a frame to be re-inserted into a jitter buffer after it
had been removed from it. A case when this happened was if a frame was read
out of the jitterbuffer, passed to the translation core, and then multiple
frames were returned from said translation core. Upon multiple frames being
returned the first is passed on, but sebsequently "chained" frames are put
back into the read queue. Thus it was possible for a frame to go back into
the jitter buffer where this would cause problems.

This patch adds a flag to frames that are inserted into the channel's read
queue after translation. The abstract jitter buffer code then checks for this
flag and ignores any frames marked as such.

Change-Id: I276c44edc9dcff61e606242f71274265c7779587
2017-01-17 17:08:53 -06:00
Sebastian Gutierrez 8cc1cd5df7 app_queue: Add QueueUpdate application.
Add an application that allows tracking outbound calls
using app_queue.

ASTERISK-19862

Change-Id: Ia0ab64aed934c25b2a25022adcc7c0624224346e
2017-01-17 12:29:34 +00:00
Richard Mudgett f4e77a5678 taskprocessor.c: Change when high water warning logged.
The task processor queue reached X scheduled tasks message was originally
intended to get logged only once per task processor to prevent spamming
the log.  This is no longer necessary since high and low water thresholds
can better control when the message is logged.

It is beneficial to generate the warning each time a task processor
reaches the high water level because PJSIP stops processing new requests
while any high water alert is active.  Without this change you would have
to enable at least debug level 3 logging to know about a repeated alert
trigger.

* Made generate the warning message whenever a task is pushed into the
task processor that triggers the high water alert.

* Appended 'again' to the warning for a repeated high water alert trigger.

Change-Id: Iabf75a004f7edaf1e5e8c323099418e667cac999
2017-01-13 21:36:54 -06:00
Joshua Colp 7c27e71317 Merge "res_rtp_asterisk: Fix bug in function CHANNEL(rtcp, all_rtt)" 2017-01-12 19:55:28 -06:00
Aaron An e0e502d9d2 res_rtp_asterisk: Fix bug in function CHANNEL(rtcp, all_rtt)
Function CHANNEL(rtcp,all_rtt) CHANNEL(rtcp,all_loss) CHANNEL(rtcp,all_jitter)
always return 0.0 due to wrong define of macro "AST_RTP_SATA_SET" and
"AST_RTP_STAT_STRCPY".
It should compare "combined" with "stat" not "current_stat".

ASTERISK-26710 #close
Reported-by: Aaron An
Tested-by: AaronAn

Change-Id: Id4140fafbf92e2db689dac5b17d9caa009028a15
2017-01-12 16:55:30 -06:00
George Joseph 0d53c91fba debug_utilities: Create the ast_coredumper utility
This utility allows easy manipulation of asterisk coredumps.

* Configurable search paths and patterns for existing coredumps
* Can generate a consistent coredump from the running instance
* Can dump the lock_infos table from a coredump
* Dumps backtraces to separate files...
  - thread apply 1 bt full -> <coredump>.thread1.txt
  - thread apply all bt -> <coredump>.brief.txt
  - thread apply all bt full -> <coredump>.full.txt
  - lock_infos table -> <coredump>.locks.txt
* Can tarball corefiles and optionally delete them after processing
* Can tarball results files and optionally delete them after processing
* Converts ':' in coredump and results file names '-' to facilitate
  uploading.  Jira for instance, won't accept file names with colons
  in them.

Tested on Fedora24+, Ubuntu14+, Debian6+, CentOS6+ and FreeBSD9+[1].

[1] For *BSDs, the "devel/gdb" package might have to be installed to
get a recent gdb.  The utility will check all instances of gdb
it finds in $PATH and if one isn't found that can run python, it
prints a friendly error.

Change-Id: I935d37ab9db85ef923f32b05579897f0893d33cd
(cherry picked from commit cb47b45560)
2017-01-11 12:11:45 -06:00
zuul a0a74030ac Merge "app_queue: add new Service Level calculation" 2017-01-10 14:01:34 -06:00
zuul c2d4230354 Merge "res_pjsip_endpoint_identifier_ip: Add support for SRV lookups." 2017-01-09 12:44:58 -06:00
zuul acc7f3c243 Merge "chan_sip: Remember SDP negotiation on SIP_CODEC_INBOUND." 2017-01-09 08:38:46 -06:00
Joshua Colp 7632cd646c Merge "res_pjsip: Fix known compact header issues" 2017-01-09 07:23:17 -06:00
Joshua Colp 38b4189643 Merge changes from topic 'ASTERISK-26672'
* changes:
  res_rtp_asterisk.c: Fix uninitialized memory crash.
  chan_rtp.c: Fix uninitialized memory crash.
  res_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip().
2017-01-09 07:22:42 -06:00
George Joseph e54c8aec34 pjproject_bundled: Fix compilation with MALLOC_DEBUG
When MALLOC_DEBUG was specified, make was failing.  Immediately
remaking would work.  The issues was in the ordering of the make
dependencies.

Change-Id: If6030b54fc693f3179f32bfd20c6b5d5f1b3f7cd
2017-01-08 10:37:41 -06:00
Joshua Colp a7d856cd96 res_pjsip_endpoint_identifier_ip: Add support for SRV lookups.
This change implements SRV support for the IP based endpoint
identifier module. All possible addresses through SRV are looked
up and added as matches. If no SRV records are available a
fallback to normal host resolution is done. If an IP address
is provided then no SRV lookup occurs.

This is configured using the "srv_lookups" option on the
identify section and defaults to "yes".

ASTERISK-26693

Change-Id: I6b641e275bf96629320efa8b479737062aed82ac
2017-01-06 09:00:22 -06:00
zuul 6962a13466 Merge "core/pbx: dialplan show - display filename/line#" 2017-01-05 10:30:32 -06:00
Joshua Colp c5f406f763 Merge "res_pjsip_session: Access SIPDOMAIN via Dialplan." 2017-01-05 08:25:22 -06:00
George Joseph 68c6278c22 Merge "acl.c: Improve ast_ouraddrfor() diagnostic messages." 2017-01-04 22:09:22 -06:00
George Joseph 9280abd8a9 Merge "chan_pjsip: Use session for retrieving CHANNEL() information." 2017-01-04 16:26:35 -06:00
Sebastian Gutierrez 740ca862e4 app_queue: add new Service Level calculation
Adds a new formula for SL2 and documentation

ASTERISK-26559

Change-Id: I0970c620460507cd9d45b0d43600779c8915e770
2017-01-04 14:11:13 -06:00
Jonathan R. Rose d96e350256 core/pbx: dialplan show - display filename/line#
Adds the ability for extensions to be registered to include filename and
line number so that dialplan show output can show the filename and line
number of a config file responsible for generating a given extension.

This only affects config modules that are written to use the new extension
registering functions. In this patch, that only includes pbx_config, so
extensions registered in extensions.conf and any included extension will
be shown in this manner. Extensions registered in this manner will show
the filename and line number *instead* of the registrar.

ASTERISK-26658 #close
Reported by: Jonathan R. Rose

Change-Id: Ieccc6abccdff34ed5c7da3511fd24972b8f2dd30
2017-01-04 14:06:20 -06:00
Alexander Traud aea2285865 res_pjsip_session: Access SIPDOMAIN via Dialplan.
This feature was available in the SIP channel driver chan_sip. For example,
Asterisk is the outbound proxy and has to handle all SIP-URIs, even domains not
local to Asterisk. In that case, SIPDOMAIN is used in the Dialplan, to detect
and dial remote SIP-URIs. This change here sets the SIP destination domain of
an inbound call (SIPDOMAIN) in the SIP channel driver res_pjsip as well.

ASTERISK-26670 #close

Change-Id: I27c880dc404a3c1c6792e1ba3545475339577243
2017-01-04 14:11:30 +01:00
Alexander Traud e220c11bec chan_sip: Remember SDP negotiation on SIP_CODEC_INBOUND.
After a SIP_CODEC_INBOUND in the dialplan, do not continue with cached formats
but remember the joint format. Cached formats contain default parameters,
often create an empty fmtp line. However, a joint format might have passed
format_get_joint(.) in a res_format_attr_* module (like Opus Codec) and
contain the resulting format parameters from a SDP negotiation.

ASTERISK-26691 #close

Change-Id: I35712d98a793d4c3efdd156cec57deab9014b1dc
2017-01-04 12:50:11 +01:00
George Joseph ceb9dae566 pjproject_bundled: Compile pjsua with max log level = 2
A while back, we changed config_site.h to set PJ_LOG_MAX_LEVEL = 6.
This allowed us to control the log level better from inside Asterisk.
An unfortunate side effect of this was that the pjsua binary and
python bindings were also compiled with log level set to 6 so whenever
a testsuite test that uses pjsua runs, it spits out 6795 lines of
debug in an instant even before the test starts.  I believe this
overruns the Jenkins capture buffer and prevents the test from
properly terminating.  In turn, this results in the testsuite just
hanging until the job is killed.  It's more frequent on the higher
end agents because they can spit out the messages faster.

Unfortunately, the messages are all spit out before we have control
of the python pj.Lib instance where we can set logging levels so the
only alternative was to actually compile pjsua and _pjsua.so with an
overridden PJ_LOG_MAX_LEVEL.  Although defining a lower max level was
done in the Makefile, the define in config_site.h had to be wrapped
with "#ifndef" so the change would take effect.

Change-Id: I2af9e7d48dde1927279c586c9c725d868fe6f3ff
2017-01-03 16:03:28 -06:00
Joshua Colp ad8ada007a Merge "bridge_native_rtp.c: Minor code cleanups." 2017-01-03 08:39:27 -06:00
Joshua Colp ac480686bb Merge "bridge_native_rtp.c: Fix native rtp bridge data race." 2017-01-03 08:39:07 -06:00
Joshua Colp ae57652983 chan_pjsip: Use session for retrieving CHANNEL() information.
The CHANNEL() dialplan function implementation for PJSIP allows
querying of PJSIP specific information. This used the channel
passed in to get the PJSIP session and associated information.
It is possible for this channel to be masqueraded and end
up as a different channel type by the time the information
request is actually acted upon.

This change retrieves the PJSIP session safely and accesses
data from it (including channel). This provides a guarantee
that the session and channel will not be altered when the
request is being acted upon.

ASTERISK-26673

Change-Id: I335e12b89e1820cafdd92b3e7526b8ba649eb7e6
2017-01-03 05:47:05 -06:00
Joshua Elson 386e3a01b3 res_pjsip: Fix known compact header issues
ASTERISK-26684 #close

Change-Id: Ifd7e401c45015119dd5e8421dbfe3afa6381744a
2016-12-31 20:00:46 -06:00
Martin Tomec aad29b9bca res_calendar: delete old calendars after reload
When "fetch_again_at_reload" is set in config, we create now
new object and thread for each reloaded calendar (with new
configuration). Old calendar should be then unlinked, so the
old thread can exit and free memory.

ASTERISK-26683

Change-Id: Ic17fba9371c5a8b26a6bc54ea4957c13a32a343e
2016-12-31 08:43:50 +01:00
George Joseph 5a5953f98c res_pjsip_refer: Handle compact Refer-To header.
refer_incoming_refer_request needed to look for the "r" header as well
as the "Refer-To" header.

ASTERISK-26655 #close
patches:
	refer_compact_fix.diff	submitted by JoshE (license 6075)

Change-Id: I610410a99b02427ea5db887aeb454d5f12c2259f
2016-12-30 09:17:45 -06:00
Richard Mudgett ac04e63ac2 bridge_native_rtp.c: Minor code cleanups.
In native_rtp_bridge_compatible_check()

* Made one variable declaration per line.

* Extracted if test assignment to make the test easier to see.

* Made long if tests easier to see the combinatorial logic.

* Added bridge id to a couple debug messages.

Change-Id: I65bc5732aa7c9a2537f062f106fbea711cf2daad
2016-12-23 14:11:53 -06:00
Richard Mudgett da6f40c9ff bridge_native_rtp.c: Fix native rtp bridge data race.
native_rtp_bridge_compatible() didn't lock the bridge channels before
checking the channels for native bridging ability.  As a result, one of
the channel's native format capabilities structure got replaced out from
under the native bridge check.  Use of a stale pointer to freed memory
causes bad things to happen.

MALLOC_DEBUG, DO_CRASH, and the
tests/channels/pjsip/transfers/blind_transfer/caller_direct_media
testsuite test caught this.

* Add missing channel locking in native_rtp_bridge_compatible().

Change-Id: If25fdb3ac8e85563c4857fb8216b3d9dc3d0fa53
2016-12-23 14:11:53 -06:00