]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
8 years agoapp_queue: Fix queues randomly disappearing on reload 22/4822/2
kkm [Wed, 25 Jan 2017 04:31:38 +0000 (20:31 -0800)] 
app_queue: Fix queues randomly disappearing on reload

With 500+ queues and a reload every minute, a random queue disappears
upon reload. The cause is mususe of the 'dead' flag. Namely, all queues
were marked dead up front, and then "resurrected" by dropping this flag
for those found in the configuration. But a queue marked dead can be
removed also when control leaves the app entry point on a PBX thread.

With this change, the queue is marked only not found, and at the end of
reload only the queues that are still not found are actually marked as
dead, so the dead flag is never reset, and set only on positively dead
queues.

ASTERISK-26755

Change-Id: I3a4537aec9eb8d8aeeaa0193407e3523feb004bf

8 years agoMerge "main/app.c: Memory corruption from early format destruction." into 13
zuul [Wed, 25 Jan 2017 21:13:49 +0000 (15:13 -0600)] 
Merge "main/app.c: Memory corruption from early format destruction." into 13

8 years agoMerge "stasis_bridge.c: Fix off-nominal stasis control ref leak." into 13
zuul [Wed, 25 Jan 2017 19:52:24 +0000 (13:52 -0600)] 
Merge "stasis_bridge.c: Fix off-nominal stasis control ref leak." into 13

8 years agoMerge "chan_oss.c: Fix format ref leak in oss_read()." into 13
zuul [Wed, 25 Jan 2017 19:32:38 +0000 (13:32 -0600)] 
Merge "chan_oss.c: Fix format ref leak in oss_read()." into 13

8 years agoMerge "res_pjsip_endpoint_identifier_ip: Ensure error defaults to 0." into 13
George Joseph [Wed, 25 Jan 2017 14:28:33 +0000 (08:28 -0600)] 
Merge "res_pjsip_endpoint_identifier_ip: Ensure error defaults to 0." into 13

8 years agoMerge "pjproject_bundled: Fix setting max log level" into 13
George Joseph [Wed, 25 Jan 2017 04:30:07 +0000 (22:30 -0600)] 
Merge "pjproject_bundled: Fix setting max log level" into 13

8 years agoMerge "Free endpoint ACLs when destroying PJSIP endpoints." into 13
George Joseph [Tue, 24 Jan 2017 21:49:07 +0000 (15:49 -0600)] 
Merge "Free endpoint ACLs when destroying PJSIP endpoints." into 13

8 years agoMerge "res_pjsip_pubsub.c: Implement "pjsip show subscriptions" commands." into 13
George Joseph [Tue, 24 Jan 2017 21:47:13 +0000 (15:47 -0600)] 
Merge "res_pjsip_pubsub.c: Implement "pjsip show subscriptions" commands." into 13

8 years agores_pjsip_endpoint_identifier_ip: Ensure error defaults to 0. 04/4804/1
Joshua Colp [Tue, 24 Jan 2017 21:39:39 +0000 (21:39 +0000)] 
res_pjsip_endpoint_identifier_ip: Ensure error defaults to 0.

When configuring a match using a netmask the error variable was
not defaulting to 0. For some people this would cause the code
to think an error occurred when adding the match when in reality
it added perfectly fine.

ASTERISK-26693

Change-Id: I850c250813742bddde65c84e739093c9e01dfe56

8 years agomain/app.c: Memory corruption from early format destruction. 95/4795/1
Richard Mudgett [Tue, 10 Jan 2017 19:11:20 +0000 (13:11 -0600)] 
main/app.c: Memory corruption from early format destruction.

* make_silence() created a malloced silence slin frame without adding a
slin format ref.  When the frame is destroyed it will unref the slin
format that never had a ref added.  Memory corruption is expected to
follow.

* Simplified and fixed counting the number of samples in a frame list for
make_silence().

* Eliminated an unnecessary RAII_VAR associated with the make_silence()
frame.

Change-Id: I47de3f9b92635b7f8b4d72309444d6c0aee6f747

8 years agostasis_bridge.c: Fix off-nominal stasis control ref leak. 89/4789/1
Richard Mudgett [Sat, 14 Jan 2017 01:08:53 +0000 (19:08 -0600)] 
stasis_bridge.c: Fix off-nominal stasis control ref leak.

Change-Id: Ib17218343a6596832060180e19386da9df150ac8

8 years agochan_oss.c: Fix format ref leak in oss_read(). 83/4783/1
Richard Mudgett [Tue, 10 Jan 2017 20:03:24 +0000 (14:03 -0600)] 
chan_oss.c: Fix format ref leak in oss_read().

Change-Id: I0a5d56c7dcf327d60f86a4c25a23571733709fd0

8 years agoMerge "res_pjsip_endpoint_identifier_ip: Read settings before resolving." into 13
George Joseph [Tue, 24 Jan 2017 13:08:44 +0000 (07:08 -0600)] 
Merge "res_pjsip_endpoint_identifier_ip: Read settings before resolving." into 13

8 years agores_pjsip_pubsub.c: Implement "pjsip show subscriptions" commands. 45/4745/2
Richard Mudgett [Thu, 5 Jan 2017 19:21:08 +0000 (13:21 -0600)] 
res_pjsip_pubsub.c: Implement "pjsip show subscriptions" commands.

ASTERISK-23828 #close

Change-Id: Ifb8a3b61f447aedc58a8e6b36a810f7566018567

8 years agoFree endpoint ACLs when destroying PJSIP endpoints. 72/4772/1
Mark Michelson [Mon, 23 Jan 2017 22:18:18 +0000 (16:18 -0600)] 
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

8 years agoMerge "LISTFILTER: Remove outdated ERROR message." into 13
George Joseph [Mon, 23 Jan 2017 21:05:06 +0000 (15:05 -0600)] 
Merge "LISTFILTER: Remove outdated ERROR message." into 13

8 years agoMerge "res_pjsip_pubsub.c: Fix incorrect message string wrapping." into 13
George Joseph [Mon, 23 Jan 2017 21:01:12 +0000 (15:01 -0600)] 
Merge "res_pjsip_pubsub.c: Fix incorrect message string wrapping." into 13

8 years agoMerge "res_pjsip_pubsub.c: Fix AMI event list counts." into 13
Joshua Colp [Mon, 23 Jan 2017 17:10:10 +0000 (11:10 -0600)] 
Merge "res_pjsip_pubsub.c: Fix AMI event list counts." into 13

8 years agopjproject_bundled: Fix setting max log level 59/4759/2
George Joseph [Mon, 23 Jan 2017 15:10:50 +0000 (08:10 -0700)] 
pjproject_bundled: Fix setting max log level

An earlier attempt to prevent pjsua from spitting out an extra 6795
lines of debug output every time the testsuite called it was also
turning off the ability for asterisk to output debug info when it
needed to.  This patch reverts the earlier fix and instead adds
a pjproject patch that sets the startup log level to 1 for pjsua
pjsystest and the pjsua python binding.  This is an asterisk-only
patch that does not affect pjproject functionality and will not be
submitted upstream.

Change-Id: I347a8b58b2626f2906ccfc1d339e907627a0c9e8

8 years agores_pjsip_endpoint_identifier_ip: Read settings before resolving. 64/4764/1
Joshua Colp [Mon, 23 Jan 2017 16:08:37 +0000 (16:08 +0000)] 
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

8 years agoMerge "res_pjsip_pubsub.c: Eliminate trivial SCOPED_LOCK usage." into 13
Joshua Colp [Mon, 23 Jan 2017 15:37:46 +0000 (09:37 -0600)] 
Merge "res_pjsip_pubsub.c: Eliminate trivial SCOPED_LOCK usage." into 13

8 years agoLISTFILTER: Remove outdated ERROR message. 56/4756/1
Richard Mudgett [Sun, 22 Jan 2017 23:25:57 +0000 (17:25 -0600)] 
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

8 years agoMerge "res_pjsip: alloca can never fail." into 13
zuul [Fri, 20 Jan 2017 22:14:39 +0000 (16:14 -0600)] 
Merge "res_pjsip: alloca can never fail." into 13

8 years agoMerge "debug_utilities: Create ast_loggrabber" into 13
zuul [Fri, 20 Jan 2017 20:24:33 +0000 (14:24 -0600)] 
Merge "debug_utilities:  Create ast_loggrabber" into 13

8 years agoMerge "abstract/fixed/adpative jitter buffer: disallow frame re-inserts" into 13
zuul [Fri, 20 Jan 2017 19:44:42 +0000 (13:44 -0600)] 
Merge "abstract/fixed/adpative jitter buffer: disallow frame re-inserts" into 13

8 years agores_pjsip_pubsub.c: Fix AMI event list counts. 42/4742/1
Richard Mudgett [Thu, 5 Jan 2017 21:11:12 +0000 (15:11 -0600)] 
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

8 years agores_pjsip_pubsub.c: Fix incorrect message string wrapping. 39/4739/1
Richard Mudgett [Thu, 5 Jan 2017 19:02:06 +0000 (13:02 -0600)] 
res_pjsip_pubsub.c: Fix incorrect message string wrapping.

Change-Id: Id771e6fe56d89ce365ddcbb423f820af97211120

8 years agores_pjsip_pubsub.c: Eliminate trivial SCOPED_LOCK usage. 36/4736/1
Richard Mudgett [Thu, 5 Jan 2017 19:01:17 +0000 (13:01 -0600)] 
res_pjsip_pubsub.c: Eliminate trivial SCOPED_LOCK usage.

Change-Id: Ie0b69a830385452042fa19e7d267c6790ec6b6be

8 years agores_pjsip: alloca can never fail. 33/4733/1
Richard Mudgett [Thu, 5 Jan 2017 18:58:52 +0000 (12:58 -0600)] 
res_pjsip: alloca can never fail.

Change-Id: Ia2a6158e5fdf311bc2a1c0c43417978de504b1f1

8 years agodebug_utilities: Create ast_loggrabber 16/4716/4
George Joseph [Fri, 13 Jan 2017 17:03:15 +0000 (10:03 -0700)] 
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 5fa1c56d7e76999aa14f133a33f6b168e7c3b99c)

8 years agores_pjsip_outbound_authenticator_digest.c: Fix spacing in warning messages. 30/4730/1
Richard Mudgett [Sun, 1 Jan 2017 09:47:50 +0000 (03:47 -0600)] 
res_pjsip_outbound_authenticator_digest.c: Fix spacing in warning messages.

Change-Id: I573f0343c0c63a785cd4da60d57cc9f8b9ce7f49

8 years agoabstract/fixed/adpative jitter buffer: disallow frame re-inserts 14/4714/2
Kevin Harwell [Thu, 12 Jan 2017 21:58:43 +0000 (15:58 -0600)] 
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

8 years agotaskprocessor.c: Change when high water warning logged. 20/4720/1
Richard Mudgett [Sat, 14 Jan 2017 03:23:49 +0000 (21:23 -0600)] 
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

8 years agoMerge "res_rtp_asterisk: Fix bug in function CHANNEL(rtcp, all_rtt)" into 13
zuul [Fri, 13 Jan 2017 01:54:09 +0000 (19:54 -0600)] 
Merge "res_rtp_asterisk:  Fix bug in function CHANNEL(rtcp, all_rtt)" into 13

8 years agores_rtp_asterisk: Fix bug in function CHANNEL(rtcp, all_rtt) 08/4708/2
Aaron An [Tue, 10 Jan 2017 11:54:16 +0000 (19:54 +0800)] 
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

8 years agodebug_utilities: Create the ast_coredumper utility 10/4710/2
George Joseph [Wed, 11 Jan 2017 00:10:39 +0000 (17:10 -0700)] 
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

8 years agoMerge "res_pjsip_endpoint_identifier_ip: Add support for SRV lookups." into 13
Joshua Colp [Mon, 9 Jan 2017 18:47:51 +0000 (12:47 -0600)] 
Merge "res_pjsip_endpoint_identifier_ip: Add support for SRV lookups." into 13

8 years agoMerge "chan_sip: Remember SDP negotiation on SIP_CODEC_INBOUND." into 13
Joshua Colp [Mon, 9 Jan 2017 14:46:32 +0000 (08:46 -0600)] 
Merge "chan_sip: Remember SDP negotiation on SIP_CODEC_INBOUND." into 13

8 years agoMerge "res_pjsip: Fix known compact header issues" into 13
Joshua Colp [Mon, 9 Jan 2017 13:23:10 +0000 (07:23 -0600)] 
Merge "res_pjsip: Fix known compact header issues" into 13

8 years agoMerge changes from topic 'ASTERISK-26672' into 13
Joshua Colp [Mon, 9 Jan 2017 13:22:18 +0000 (07:22 -0600)] 
Merge changes from topic 'ASTERISK-26672' into 13

* changes:
  res_rtp_asterisk.c: Fix uninitialized memory crash.
  chan_rtp.c: Fix uninitialized memory crash.

8 years agopjproject_bundled: Fix compilation with MALLOC_DEBUG 04/4704/2
George Joseph [Sun, 8 Jan 2017 16:29:01 +0000 (09:29 -0700)] 
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

8 years agoMerge "res_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip()." into 13
zuul [Fri, 6 Jan 2017 16:23:52 +0000 (10:23 -0600)] 
Merge "res_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip()." into 13

8 years agores_pjsip_endpoint_identifier_ip: Add support for SRV lookups. 97/4697/4
Joshua Colp [Thu, 5 Jan 2017 12:11:43 +0000 (12:11 +0000)] 
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

8 years agoMerge "bridge_native_rtp.c: Minor code cleanups." into 13
zuul [Thu, 5 Jan 2017 19:22:43 +0000 (13:22 -0600)] 
Merge "bridge_native_rtp.c: Minor code cleanups." into 13

8 years agoMerge "res_pjsip_session: Access SIPDOMAIN via Dialplan." into 13
zuul [Thu, 5 Jan 2017 13:43:51 +0000 (07:43 -0600)] 
Merge "res_pjsip_session: Access SIPDOMAIN via Dialplan." into 13

8 years agoMerge "acl.c: Improve ast_ouraddrfor() diagnostic messages." into 13
George Joseph [Thu, 5 Jan 2017 04:06:40 +0000 (22:06 -0600)] 
Merge "acl.c: Improve ast_ouraddrfor() diagnostic messages." into 13

8 years agoMerge "bridge_native_rtp.c: Fix native rtp bridge data race." into 13
George Joseph [Thu, 5 Jan 2017 04:05:31 +0000 (22:05 -0600)] 
Merge "bridge_native_rtp.c: Fix native rtp bridge data race." into 13

8 years agoMerge "chan_pjsip: Use session for retrieving CHANNEL() information." into 13
George Joseph [Wed, 4 Jan 2017 22:25:47 +0000 (16:25 -0600)] 
Merge "chan_pjsip: Use session for retrieving CHANNEL() information." into 13

8 years agores_pjsip_session: Access SIPDOMAIN via Dialplan. 53/4653/2
Alexander Traud [Thu, 22 Dec 2016 15:13:46 +0000 (16:13 +0100)] 
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

8 years agochan_sip: Remember SDP negotiation on SIP_CODEC_INBOUND. 95/4695/1
Alexander Traud [Wed, 4 Jan 2017 11:50:11 +0000 (12:50 +0100)] 
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

8 years agopjproject_bundled: Compile pjsua with max log level = 2 91/4691/2
George Joseph [Tue, 3 Jan 2017 21:14:09 +0000 (14:14 -0700)] 
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

8 years agochan_pjsip: Use session for retrieving CHANNEL() information. 71/4671/3
Joshua Colp [Thu, 22 Dec 2016 22:00:58 +0000 (22:00 +0000)] 
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

8 years agores_pjsip: Fix known compact header issues 87/4687/1
Joshua Elson [Sun, 1 Jan 2017 01:56:09 +0000 (18:56 -0700)] 
res_pjsip: Fix known compact header issues

ASTERISK-26684 #close

Change-Id: Ifd7e401c45015119dd5e8421dbfe3afa6381744a

8 years agores_pjsip_refer: Handle compact Refer-To header. 84/4684/1
George Joseph [Fri, 30 Dec 2016 15:10:09 +0000 (08:10 -0700)] 
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

8 years agobridge_native_rtp.c: Minor code cleanups. 76/4676/1
Richard Mudgett [Fri, 23 Dec 2016 18:11:02 +0000 (12:11 -0600)] 
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

8 years agobridge_native_rtp.c: Fix native rtp bridge data race. 75/4675/1
Richard Mudgett [Fri, 23 Dec 2016 18:10:40 +0000 (12:10 -0600)] 
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

8 years agores_rtp_asterisk.c: Fix uninitialized memory crash. 58/4658/1
Richard Mudgett [Wed, 21 Dec 2016 22:28:00 +0000 (16:28 -0600)] 
res_rtp_asterisk.c: Fix uninitialized memory crash.

ast_rtp_remote_address_set() could pass an uninitialized 'us' parameter to
ast_ouraddrfor().  If ast_ouraddrfor() returns an error then the 'us'
parameter may not get initialized.  Thus when the code tries to save the
'us' parameter to the local address we could try to copy a ridiculous
sized memory buffer and segfault.

* Made pass an initialized 'us' parameter to ast_ouraddrfor().

* Optimized out the 'us' struct variable.

ASTERISK-26672 #close

Change-Id: I4acea5dcdf0813da2c7d3e11c2d6067d160d17dc

8 years agores_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip(). 56/4656/1
Richard Mudgett [Wed, 21 Dec 2016 23:55:48 +0000 (17:55 -0600)] 
res_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip().

We access uninitialized memory when the 'ourip' parameter does not
have an initial guess to our IP address.

ASTERISK-26672

Change-Id: I35507ea1ad7455d2be188f6ccdd4add7bd150e15

8 years agoacl.c: Improve ast_ouraddrfor() diagnostic messages. 55/4655/1
Richard Mudgett [Wed, 21 Dec 2016 22:25:00 +0000 (16:25 -0600)] 
acl.c: Improve ast_ouraddrfor() diagnostic messages.

* Made not generate strings unless they will actually be used.

ASTERISK-26672

Change-Id: I155fbe7fdff5ce47dfe5326f3baf5446849702c3

8 years agochan_rtp.c: Fix uninitialized memory crash. 57/4657/1
Richard Mudgett [Wed, 21 Dec 2016 23:54:42 +0000 (17:54 -0600)] 
chan_rtp.c: Fix uninitialized memory crash.

unicast_rtp_request() could pass an uninitialized 'us' parameter to
ast_ouraddrfor().  If ast_ouraddrfor() returns an error then the 'us'
parameter may not get initialized.  Thus when the code tries to save the
'us' parameter to the local address we could try to copy a ridiculous
sized memory buffer and segfault.

* Made pass an initialized 'us' parameter to ast_ouraddrfor() and abort
the UnicastRTP channel request if it fails.

ASTERISK-26672

Change-Id: I1ef7a7c09f4da4f15dcb6de660d2bcac5f2a95c0

8 years agores_rtp_asterisk.c: Fix off nominal memory leak. 45/4645/1
Richard Mudgett [Wed, 7 Dec 2016 21:23:02 +0000 (15:23 -0600)] 
res_rtp_asterisk.c: Fix off nominal memory leak.

Change-Id: I95b1088d11244a2edae6607c12fbf33b38658a75

8 years agoMerge "pjproject_bundled: Make build single threaded" into 13
Joshua Colp [Tue, 20 Dec 2016 11:31:15 +0000 (05:31 -0600)] 
Merge "pjproject_bundled:  Make build single threaded" into 13

8 years agoMerge "res_pjsip: Add/update ERROR msg if invalid URI." into 13
Joshua Colp [Tue, 20 Dec 2016 11:30:37 +0000 (05:30 -0600)] 
Merge "res_pjsip: Add/update ERROR msg if invalid URI." into 13

8 years agoMerge "autosupport: Add 'pjproject show buildopts'" into 13
George Joseph [Tue, 20 Dec 2016 04:21:19 +0000 (22:21 -0600)] 
Merge "autosupport: Add 'pjproject show buildopts'" into 13

8 years agoMerge "MESSAGE: Flush Message/ast_msg_queue channel alert pipe." into 13
George Joseph [Tue, 20 Dec 2016 04:18:28 +0000 (22:18 -0600)] 
Merge "MESSAGE: Flush Message/ast_msg_queue channel alert pipe." into 13

8 years agoMerge "chan_dahdi.c: Fix bounds check regression." into 13
Joshua Colp [Tue, 20 Dec 2016 00:27:48 +0000 (18:27 -0600)] 
Merge "chan_dahdi.c: Fix bounds check regression." into 13

8 years agoMerge "chan_sip: Reorder unload_module to deal with stuck TCP threads." into 13
Joshua Colp [Mon, 19 Dec 2016 22:19:11 +0000 (16:19 -0600)] 
Merge "chan_sip: Reorder unload_module to deal with stuck TCP threads." into 13

8 years agoMerge "app_queue: Ensure member is removed from pending when hanging up." into 13
zuul [Mon, 19 Dec 2016 18:41:08 +0000 (12:41 -0600)] 
Merge "app_queue: Ensure member is removed from pending when hanging up." into 13

8 years agoapp_queue: Ensure member is removed from pending when hanging up. 11/4611/2
Martin Tomec [Fri, 9 Dec 2016 18:23:37 +0000 (19:23 +0100)] 
app_queue: Ensure member is removed from pending when hanging up.

In some cases member is added to pending_members, and the channel
is hung up before any extension state change. So the member would
stay in pending_members forever. So when we call do_hang, we
should also remove member from pending.

ASTERISK-26621 #close

Change-Id: Iae476b5c06481db18ebe0fa594b3e80fdc9a7d54

8 years agopjproject_bundled: Make build single threaded 42/4642/1
George Joseph [Sun, 18 Dec 2016 21:23:17 +0000 (14:23 -0700)] 
pjproject_bundled:  Make build single threaded

There were just too many issues in various environments with
multi threaded building of pjproject.  It doesn't really speed
things up anyway since asterisk is already being compiled in
parallel.

Change-Id: Ie5648fb91bb89b4224b6bf43a0daa1af793c4ce1

8 years agochan_sip: Reorder unload_module to deal with stuck TCP threads. 40/4640/2
Corey Farrell [Fri, 9 Dec 2016 02:00:02 +0000 (21:00 -0500)] 
chan_sip: Reorder unload_module to deal with stuck TCP threads.

In some situations TCP threads may become frozen.  This creates the
possibility that Asterisk could segfault if they become unfrozen after
chan_sip has been dlclose'd.  This reorders the unload_module process to
allow abort if threads do not exit within 5 seconds.

High level order as follows:
1) Unregister from the core to stop new requests.
2) Signal threads to stop
3) Clear config based tables (but do not free the table itself).
4) Verify that threads have shutdown, cancel unload if not.
5) Clean all remaining resources.

ASTERISK-26586

Change-Id: Ie23692041d838fbd35ece61868f4c640960ff882

8 years agoconfigure: fix with-pjproject-bundled 39/4639/1
David M. Lee [Fri, 16 Dec 2016 07:32:57 +0000 (01:32 -0600)] 
configure: fix with-pjproject-bundled

The AC_ARG_WITH macro's shell variable is withval; not enableval. Purely
coincidentally, the option would work when --enable-dev-mode is given.

Also fixed a portability problem with bootstrap.sh, since -printf is not
a portable option for find.

Change-Id: I0f0e5b1a934b5af5737713834361e9c95b96b376

8 years agoautosupport: Add 'pjproject show buildopts' 34/4634/1
Richard Mudgett [Thu, 15 Dec 2016 19:25:50 +0000 (13:25 -0600)] 
autosupport: Add 'pjproject show buildopts'

Change-Id: I8aa55a7c3fb175235ddc7f85e9457d5102d06fa7

8 years agochan_dahdi.c: Fix bounds check regression. 29/4629/1
Richard Mudgett [Wed, 14 Dec 2016 20:21:47 +0000 (14:21 -0600)] 
chan_dahdi.c: Fix bounds check regression.

Caused by ASTERISK-25494

Change-Id: I1fc408c1a083745ff59da5c4113041bbfce54bcb

8 years agores_pjsip: Add/update ERROR msg if invalid URI. 22/4622/1
Richard Mudgett [Tue, 13 Dec 2016 20:34:54 +0000 (14:34 -0600)] 
res_pjsip: Add/update ERROR msg if invalid URI.

ASTERISK-24499

Change-Id: Ie305153e47e922233b2ff24715e0e326e5fa3a6c

8 years agoMESSAGE: Flush Message/ast_msg_queue channel alert pipe. 21/4621/1
Richard Mudgett [Tue, 13 Dec 2016 00:38:42 +0000 (18:38 -0600)] 
MESSAGE: Flush Message/ast_msg_queue channel alert pipe.

ASTERISK-25083

Change-Id: Id54baa57a8dbca84e29f28bcd2ffc0a5ac12d8b2

8 years agores_sorcery_memory_cache: Change an error to a debug message 16/4616/3
George Joseph [Tue, 13 Dec 2016 20:06:34 +0000 (13:06 -0700)] 
res_sorcery_memory_cache:  Change an error to a debug message

When a sorcery user calls ast_sorcery_delete on an object that
may have already expired from the cache, res_sorcery_memory_cache
spits out an ERROR.  Since this can happen frequently and validly when
an inbound registration expires after the cache entry expired, the
errors are unnecessary and misleading.  Changed to a debug/1.

Change-Id: Idf3a67038c16e3da814cf612ff4d6d18ad29ecd7

8 years agopjproject_bundled: Retry download if previously saved tarball is bad 08/4608/1
George Joseph [Fri, 9 Dec 2016 14:14:09 +0000 (07:14 -0700)] 
pjproject_bundled:  Retry download if previously saved tarball is bad

If a tarball is corrupted during download, the makefile will attempt to
download it again. If the tarball somehow gets corrupted after it's
downloaded however, the makefile was just failing.  We now
retry the download.

ASTERISK-26653 #close

Change-Id: I1b24d454852d80186f60c5a65dc4624ea8a1c359

8 years agoMerge "Fix typo in chan_sip" into 13
Joshua Colp [Fri, 9 Dec 2016 11:33:16 +0000 (05:33 -0600)] 
Merge "Fix typo in chan_sip" into 13

8 years agoMerge "chan_sip: Delete unneeded check" into 13
Joshua Colp [Fri, 9 Dec 2016 11:32:09 +0000 (05:32 -0600)] 
Merge "chan_sip: Delete unneeded check" into 13

8 years agoMerge "Small code cleanup in chan_sip" into 13
zuul [Fri, 9 Dec 2016 09:25:12 +0000 (03:25 -0600)] 
Merge "Small code cleanup in chan_sip" into 13

8 years agoMerge "res_pjsip: Fix 'A = B != C' kind." into 13
zuul [Fri, 9 Dec 2016 03:54:37 +0000 (21:54 -0600)] 
Merge "res_pjsip: Fix 'A = B != C' kind." into 13

8 years agoMerge "res_pjsip_registrar: AMI Add RegistrationInboundContactStatuses command" into 13
Joshua Colp [Fri, 9 Dec 2016 00:42:06 +0000 (18:42 -0600)] 
Merge "res_pjsip_registrar: AMI Add RegistrationInboundContactStatuses command" into 13

8 years agochan_sip: Delete unneeded check 07/4607/1
Badalyan Vyacheslav [Thu, 8 Dec 2016 18:54:06 +0000 (18:54 +0000)] 
chan_sip: Delete unneeded check

P is always true. We check it before

Change-Id: Iee61cda002a9f61aee26b9f66c5f9b59e3389efb

8 years agoSmall code cleanup in chan_sip 05/4605/1
Badalyan Vyacheslav [Thu, 8 Dec 2016 18:58:19 +0000 (18:58 +0000)] 
Small code cleanup in chan_sip

The conditional expressions of the 'if' operators situated
alongside each other are identical.

Change-Id: I2cf7c317b106ec14440c7f1b5dcfbf03639f748a

8 years agoFix typo in chan_sip 03/4603/1
Badalyan Vyacheslav [Thu, 8 Dec 2016 18:43:23 +0000 (18:43 +0000)] 
Fix typo in chan_sip

The conditional expressions of the 'if' operators
situated alongside each other are identical.

Change-Id: I652b6dcddb3be007e669a6aa8107edb31a1ddafb

8 years agores_pjsip: Fix 'A = B != C' kind. 93/4593/2
Badalyan Vyacheslav [Thu, 8 Dec 2016 18:30:38 +0000 (18:30 +0000)] 
res_pjsip: Fix 'A = B != C' kind.

Consider reviewing the expression of the 'A = B != C' kind.
The expression is calculated as following: 'A = (B != C)'

Change-Id: Ibaa637dfda47d51a20e26069d3103e05ce80003d

8 years agoMerge "res_format_attr_opus: Fix crash when fmtp contains spaces." into 13
Kevin Harwell [Thu, 8 Dec 2016 17:07:12 +0000 (11:07 -0600)] 
Merge "res_format_attr_opus: Fix crash when fmtp contains spaces." into 13

8 years agochan_sip: Do not allow non-SP/HTAB between header key and colon. 83/4583/1
Walter Doekes [Wed, 30 Nov 2016 15:31:39 +0000 (16:31 +0100)] 
chan_sip: Do not allow non-SP/HTAB between header key and colon.

RFC says SIP headers look like:

    HCOLON  =  *( SP / HTAB ) ":" SWS
    SWS     =  [LWS]                    ; sep whitespace
    LWS     =  [*WSP CRLF] 1*WSP        ; linear whitespace
    WSP     =  SP / HTAB                ; from rfc2234

chan_sip implemented this:

    HCOLON  =  *( LOWCTL / SP ) ":" SWS
    LOWCTL  = %x00-1F                   ; CTL without DEL

This discrepancy meant that SIP proxies in front of Asterisk with
chan_sip could pass on unknown headers with \x00-\x1F in them, which
would be treated by Asterisk as a different (known) header.  For
example, the "To\x01:" header would gladly be forwarded by some proxies
as irrelevant, but chan_sip would treat it as the relevant "To:" header.

Those relying on a SIP proxy to scrub certain headers could mistakenly
get unexpected and unvalidated data fed to Asterisk.

This change fixes so chan_sip only considers SP/HTAB as valid tokens
before the colon, making it agree on the headers with other speakers of
SIP.

ASTERISK-26433 #close
AST-2016-009

Change-Id: I78086fbc524ac733b8f7f78cb423c91075fd489b

8 years agores_format_attr_opus: Fix crash when fmtp contains spaces. 78/4578/1
Joshua Colp [Tue, 15 Nov 2016 00:18:21 +0000 (00:18 +0000)] 
res_format_attr_opus: Fix crash when fmtp contains spaces.

When an opus offer or answer was received that contained an
fmtp line with spaces between the attributes the module would
fail to properly parse it and crash due to recursion.

This change makes the module handle the space properly and
also removes the recursion requirement.

ASTERISK-26579

Change-Id: I01f53e5d9fa9f1925a7365f8d25071b5b3ac2dc3

8 years agores_pjsip_registrar: AMI Add RegistrationInboundContactStatuses command 69/4569/3
George Joseph [Tue, 6 Dec 2016 20:54:25 +0000 (13:54 -0700)] 
res_pjsip_registrar: AMI Add RegistrationInboundContactStatuses command

The PJSIPShowRegistrationsInbound AMI command was just dumping out
all AORs which was pretty useless and resource heavy since it had
to get all endpoints, then all aors for each endpoint, then all
contacts for each aor.

PJSIPShowRegistrationInboundContactStatuses sends ContactStatusDetail
events which meets the intended purpose of the other command and has
significantly less overhead.  Also, some additional fields that were
added to Contact since the original creation of the ContactStatusDetail
event have been added to the end of the event.

For compatibility purposes, PJSIPShowRegistrationsInbound is left
intact.

ASTERISK-26644 #close

Change-Id: I326f12c9ecb52bf37ba03f0748749de4da01490a

8 years agoMerge "Bundled pjproject: Fix finding SIP transactions." into 13
Joshua Colp [Wed, 7 Dec 2016 19:38:10 +0000 (13:38 -0600)] 
Merge "Bundled pjproject:  Fix finding SIP transactions." into 13

8 years agoBundled pjproject: Fix finding SIP transactions. 65/4565/2
Richard Mudgett [Tue, 6 Dec 2016 22:45:38 +0000 (16:45 -0600)] 
Bundled pjproject:  Fix finding SIP transactions.

Occasionally SIP message transactions are not found when they should be.
In the particular case an incoming INVITE transaction is CANCELed but the
INVITE transaction cannot be found so a 481 response is returned for the
CANCEL.  The problematic calls have a '_' character in the Via branch
parameter.

The problem is in the pjproject PJ_HASH_USE_OWN_TOLOWER feature's code.
The problem with the "own tolower" code is that it does not calculate the
same hash value as when the pj_tolower() function is used.  The "own
tolower" code will erroneously modify the ASCII characters '@', '[', '\\',
']', '^', and '_'.  Calls to pj_hash_calc_tolower() can use the
PJ_HASH_USE_OWN_TOLOWER substitute algorithm when enabled.  Calls to
pj_hash_get_lower(), pj_hash_set_lower(), and pj_hash_set_np_lower() call
find_entry() which never uses the PJ_HASH_USE_OWN_TOLOWER algorithm.  As a
result you may not be able to find a hash tabled entry because the
calculated hash values would differ.

* Simply disable PJ_HASH_USE_OWN_TOLOWER.

ASTERISK-26490 #close

Change-Id: If89bfdb5f301b8b685881a9a2a6e0c3c5af32253

8 years agopjproject_bundled: Fix missing inclusion of symbols 57/4557/1
George Joseph [Tue, 6 Dec 2016 18:06:45 +0000 (11:06 -0700)] 
pjproject_bundled:  Fix missing inclusion of symbols

Added back in a -g3, and an -O3 when DONT_OPTIMIZE is not set, to
the CFLAGS.  Not sure how they went missing.

Also fixed an uninstall problem where we weren't removing the
symlink from libasteriskpj.so.2 to libasteriskpj.so.  While I was
there, I fixed it for libasteriskssl as well.

Change-Id: I9e00873b1e9082d05b5549d974534b48a2142556

8 years agoMerge "res_pjsip_outbound_registration.c: Filter redundant statsd reporting." into 13
Joshua Colp [Tue, 6 Dec 2016 11:34:38 +0000 (05:34 -0600)] 
Merge "res_pjsip_outbound_registration.c: Filter redundant statsd reporting." into 13

8 years agoMerge "Remove files that got merged in error somehow to the 13 branch." into 13
Joshua Colp [Mon, 5 Dec 2016 17:43:21 +0000 (11:43 -0600)] 
Merge "Remove files that got merged in error somehow to the 13 branch." into 13

8 years agoRemove files that got merged in error somehow to the 13 branch. 52/4552/1
Richard Mudgett [Fri, 2 Dec 2016 18:04:31 +0000 (12:04 -0600)] 
Remove files that got merged in error somehow to the 13 branch.

Change-Id: Id79e2226c31084f9252d5aede9050d3cf13322c8

8 years agores_pjsip_outbound_registration.c: Filter redundant statsd reporting. 41/4541/2
Richard Mudgett [Thu, 1 Dec 2016 00:25:11 +0000 (18:25 -0600)] 
res_pjsip_outbound_registration.c: Filter redundant statsd reporting.

Increasing the testsuite shutdown timeout before forcibly killing
Asterisk allowed more events to be sent out.  Some tests failed as
a result.  The tests/channels/pjsip/statsd/registrations failed
because we now get the statsd events that a comment in the test
configuration stated couldn't be intercepted.  Unfortunately, we
get a variable number of events because of internal status state
transition races generating redundant statsd events.

We were reporting redundant statsd PJSIP.registrations.state changes
for internal state changes that equated to the same thing publicly.

* Made update_client_state_status() filter out redundant statsd
updates.

ASTERISK-26527

Change-Id: If851c7d514bb530d9226e4941ba97dcf52000646

8 years agoMerge "res_pjsip/chan_sip: Advertise 'ws' in the SIP URI transport parameter" into 13
Joshua Colp [Fri, 2 Dec 2016 17:30:09 +0000 (11:30 -0600)] 
Merge "res_pjsip/chan_sip: Advertise 'ws' in the SIP URI transport parameter" into 13

8 years agoMerge "tcptls: Use new certificate upon sip reload" into 13
Joshua Colp [Fri, 2 Dec 2016 13:56:51 +0000 (07:56 -0600)] 
Merge "tcptls: Use new certificate upon sip reload" into 13