]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
9 years agopbx.c: Allow dangerous functions when adding a hint to dialplan. 69/3369/1
Richard Mudgett [Wed, 27 Jul 2016 22:17:53 +0000 (17:17 -0500)] 
pbx.c: Allow dangerous functions when adding a hint to dialplan.

We can allow dangerous functions when adding a hint since altering
dialplan is itself a privileged activity.  Otherwise, we could never
execute dangerous functions.

ASTERISK-25996 #close
Reported by: Andrew Nagy

Change-Id: I4929ff100ad1200a0198262d069a34f2296e77ba

9 years agoMerge "rtp_engine: Failed assertion and wrong name given for codec" into 13
zuul [Thu, 28 Jul 2016 18:14:16 +0000 (13:14 -0500)] 
Merge "rtp_engine: Failed assertion and wrong name given for codec" into 13

9 years agoPortably sscanf tv_usec 56/3356/2
David M. Lee [Wed, 27 Jul 2016 15:33:23 +0000 (10:33 -0500)] 
Portably sscanf tv_usec

In a timeval, tv_usec is defined as a suseconds_t, which could be
different underlying types on different platforms. Instead of trying to
scanf directly into the timeval, scanf into a long int, then copy that
into the timeval.

Change-Id: I29f22d049d3f7746b6c0cc23fbf4293bdaa5eb95

9 years agortp_engine: Failed assertion and wrong name given for codec 60/3360/1
Kevin Harwell [Wed, 27 Jul 2016 17:36:22 +0000 (12:36 -0500)] 
rtp_engine: Failed assertion and wrong name given for codec

Fixed an assert check that would trigger when the passed in value was negative.
The negative value was being cast to an unsigned value. This resulted in the
check failing.

Also fixed another problem when loading formats in the engine. When setting the
mime type the format's name was being passed in instead of the codec's name.

Change-Id: I1a201cd419ba4d8e9a40d337e36b6fbe1737192c

9 years agodsp.c: Fix erroneous fax tone detection. 36/3336/1
Richard Mudgett [Fri, 22 Jul 2016 03:28:25 +0000 (22:28 -0500)] 
dsp.c: Fix erroneous fax tone detection.

The Goertzel calculations get less accurate the lower the signal level
being worked with becomes because there is less resolution remaining.
If it is too low we can erroneously detect a tone where none really
exists.  The searched for fax frequencies not only need to be so much
stronger than the background noise they must also be a minimum strength.

* Add needed minimum threshold test to tone_detect().

* Set TONE_THRESHOLD to allow low volume frequency spread detection.

ASTERISK-26237 #close
Reported by: Richard Mudgett

Change-Id: I84dbba7f7628fa13720add6a88eae3b129e066fc

9 years agoMerge "Fix sqlalchemy error regarding identifier length." into 13
zuul [Sat, 23 Jul 2016 21:54:27 +0000 (16:54 -0500)] 
Merge "Fix sqlalchemy error regarding identifier length." into 13

9 years agoMerge "chan_sip: Enable Session-Timers for SIP over TCP (and TLS)." into 13
zuul [Fri, 22 Jul 2016 21:55:13 +0000 (16:55 -0500)] 
Merge "chan_sip: Enable Session-Timers for SIP over TCP (and TLS)." into 13

9 years agoFix sqlalchemy error regarding identifier length. 15/3315/1
Mark Michelson [Fri, 22 Jul 2016 19:44:50 +0000 (14:44 -0500)] 
Fix sqlalchemy error regarding identifier length.

sqlalchemy was complaining:

sqlalchemy.exc.IdentifierError: Identifier
'ps_contacts_qualifyfreq_exptime' exceeds maximum length of 30
characters

This fixes the problem by changing the index name to be
"ps_contacts_qualifyfreq_exp" instead.

ASTERISK-26227 #close
Reported by Mark Michelson

Change-Id: I0ed784f87504be2a59ee8d3242ef6f625d5ed1a9

9 years agoMerge "res_pjsip: Whitespace and comment cleanup." into 13
zuul [Fri, 22 Jul 2016 12:13:13 +0000 (07:13 -0500)] 
Merge "res_pjsip: Whitespace and comment cleanup." into 13

9 years agochan_sip: Enable Session-Timers for SIP over TCP (and TLS). 31/3231/2
Alexander Traud [Fri, 22 Jul 2016 10:46:02 +0000 (12:46 +0200)] 
chan_sip: Enable Session-Timers for SIP over TCP (and TLS).

Asterisk defaults to timers=accept/refresher=uas. In that scenario, only in that
scenario, Sessions-Timers (RFC 4028) had no effect via TCP. This change enables
Session-Timers for SIP over TCP (and for SIP over TLS).

However with longer international calls via TCP, the SIP channel might break,
because all hops on the Internet route must stay online (have not a single power
outage, for example). Therefore with Session-Timers enabled (which are enabled
at default), you might see dropped calls. Consequently even with this change,
you might be better-off going for session-timers=refuse in your sip.conf.

ASTERISK-19968 #close

Change-Id: I1cd33453c77c56c8e1394cd60a6f17bb61c1d957

9 years agoMerge "chan_sip: Prevent deadlock when issuing "sip show channels"" into 13
Joshua Colp [Fri, 22 Jul 2016 09:47:13 +0000 (04:47 -0500)] 
Merge "chan_sip: Prevent deadlock when issuing "sip show channels"" into 13

9 years agoMerge "res_pjsip_pubsub: fixed a bug when pjsip_tx_data_dec_ref is called twice....
zuul [Fri, 22 Jul 2016 07:22:03 +0000 (02:22 -0500)] 
Merge "res_pjsip_pubsub: fixed a bug when pjsip_tx_data_dec_ref is called twice." into 13

9 years agores_pjsip: Whitespace and comment cleanup. 01/3301/2
Richard Mudgett [Fri, 15 Jul 2016 21:16:18 +0000 (16:16 -0500)] 
res_pjsip: Whitespace and comment cleanup.

Change-Id: I11139a4a95df34e223ba622aa6227e33ab8f6c38

9 years agoMerge "chan_dahdi.c: Fix deadlock potential in fax redirection." into 13
zuul [Fri, 22 Jul 2016 00:27:12 +0000 (19:27 -0500)] 
Merge "chan_dahdi.c: Fix deadlock potential in fax redirection." into 13

9 years agoMerge "chan_sip.c: Fix deadlock potential in fax redirection." into 13
zuul [Fri, 22 Jul 2016 00:18:20 +0000 (19:18 -0500)] 
Merge "chan_sip.c: Fix deadlock potential in fax redirection." into 13

9 years agoMerge "chan_pjsip.c: Fix deadlock potential in fax redirection." into 13
zuul [Fri, 22 Jul 2016 00:07:05 +0000 (19:07 -0500)] 
Merge "chan_pjsip.c: Fix deadlock potential in fax redirection." into 13

9 years agoMerge "res_fax.c: Fix deadlock potential in FAXOPT(faxdetect) framehook." into 13
zuul [Thu, 21 Jul 2016 23:35:12 +0000 (18:35 -0500)] 
Merge "res_fax.c: Fix deadlock potential in FAXOPT(faxdetect) framehook." into 13

9 years agoMerge changes from topic 'ASTERISK-26214' into 13
Joshua Colp [Thu, 21 Jul 2016 23:26:39 +0000 (18:26 -0500)] 
Merge changes from topic 'ASTERISK-26214' into 13

* changes:
  res_fax: Fix FAXOPT(faxdetect) timeout option.
  chan_dahdi: Add faxdetect_timeout option.

9 years agochan_sip: Prevent deadlock when issuing "sip show channels" 74/3274/5
George Joseph [Thu, 21 Jul 2016 14:05:03 +0000 (08:05 -0600)] 
chan_sip: Prevent deadlock when issuing "sip show channels"

sip_show_channels locks the dialogs container first then locks each
sip_pvt so it can spit out the details.  The rest of sip dialog
processing locks the sip_pvt first then locks the dialogs container
if it needs to.  Both lock in the order they need but deadlocks can
result.  To fix, sip_show_channels and sip_show_channelstats have
been converted to use an iterator rather than ao2_callback.  This way
the container is locked only while getting the next entry and is
unlocked when the callback is called.

ASTERISK-23013 #close

Change-Id: Id9980419909e811f89484950ed46ef117b9eb990

9 years agoMerge "res_pjsip: Add fax_detect_timeout endpoint option." into 13
Joshua Colp [Thu, 21 Jul 2016 21:54:32 +0000 (16:54 -0500)] 
Merge "res_pjsip: Add fax_detect_timeout endpoint option." into 13

9 years agoMerge "Add conditional support for noreturn functions." into 13
zuul [Thu, 21 Jul 2016 20:09:52 +0000 (15:09 -0500)] 
Merge "Add conditional support for noreturn functions." into 13

9 years agores_pjsip_pubsub: fixed a bug when pjsip_tx_data_dec_ref is called twice. 54/3254/5
Alexei Gradinari [Tue, 19 Jul 2016 20:22:39 +0000 (16:22 -0400)] 
res_pjsip_pubsub: fixed a bug when pjsip_tx_data_dec_ref is called twice.

This patch removed call of pjsip_tx_data_dec_ref in send_notify
if send_request failed.
The pjsip_dlg_send_request deletes the message on error by itself.

It seems this patch fixes next issues:
ASTERISK-26199
ASTERISK-26166
ASTERISK-26174

Change-Id: I8b05917c93d993f95d604c042ace5f1a5500f59a

9 years agoMerge "Makefile: Retain XML Declaration and DTD in docs." into 13
zuul [Wed, 20 Jul 2016 17:14:41 +0000 (12:14 -0500)] 
Merge "Makefile: Retain XML Declaration and DTD in docs." into 13

9 years agoMerge "Unit tests: Use AST_TEST_DEFINE in conditional code only." into 13
zuul [Wed, 20 Jul 2016 16:31:50 +0000 (11:31 -0500)] 
Merge "Unit tests: Use AST_TEST_DEFINE in conditional code only." into 13

9 years agoMerge "res_rtp_asterisk: Count a roll-over of the sequence number even on lost packet...
zuul [Wed, 20 Jul 2016 14:58:05 +0000 (09:58 -0500)] 
Merge "res_rtp_asterisk: Count a roll-over of the sequence number even on lost packets." into 13

9 years agoMerge "res_pjsip_mwi: remove unneeded check on endpoint's contacts." into 13
zuul [Wed, 20 Jul 2016 14:58:00 +0000 (09:58 -0500)] 
Merge "res_pjsip_mwi: remove unneeded check on endpoint's contacts." into 13

9 years agoAdd conditional support for noreturn functions. 57/3257/1
Corey Farrell [Tue, 19 Jul 2016 03:46:19 +0000 (23:46 -0400)] 
Add conditional support for noreturn functions.

This adds support for tagging functions with the noreturn attribute.
If DO_CRASH is enabled then ast_do_crash never returns.  If AST_DEVMODE
and DO_CRASH are enabled then failed assertions never return.  This can
resolve a large number of false positives with static analyzers.

ASTERISK-26220 #close

Change-Id: Icfb61e5fe54574eced4c3e88b317244f467ec753

9 years agochan_dahdi.c: Fix deadlock potential in fax redirection. 48/3248/1
Richard Mudgett [Tue, 19 Jul 2016 18:18:47 +0000 (13:18 -0500)] 
chan_dahdi.c: Fix deadlock potential in fax redirection.

The dahdi_handle_dtmf() and my_handle_dtmf() have the potential to
deadlock if an incoming fax happens during the Playback or similar
application.

* Fixed the potential deadlock by not calling ast_async_goto() with the
channel lock held.

ASTERISK-26216 #close
Reported by: Richard Mudgett

Change-Id: I9144b84ade5f96690996624ec8a2d40c56af40aa

9 years agochan_sip.c: Fix deadlock potential in fax redirection. 47/3247/1
Richard Mudgett [Wed, 13 Jul 2016 23:49:08 +0000 (18:49 -0500)] 
chan_sip.c: Fix deadlock potential in fax redirection.

The sip_read() has the potential to deadlock if an incoming fax happens
during the Playback or similar application.

* Fixed the potential deadlock by not calling ast_async_goto() with the
channel lock held.

* Made always eat the fax detection frame whether there is a fax extension
or not.

ASTERISK-26216
Reported by: Richard Mudgett

Change-Id: I6d3f5cccd4b77c3aa6ffc1a54c0f6bde61c9278e

9 years agochan_pjsip.c: Fix deadlock potential in fax redirection. 46/3246/1
Richard Mudgett [Wed, 13 Jul 2016 23:48:01 +0000 (18:48 -0500)] 
chan_pjsip.c: Fix deadlock potential in fax redirection.

The chan_pjsip_cng_tone_detected() has the potential to deadlock if an
incoming fax happens during the Playback or similar application.

* Fixed the potential deadlock by not calling ast_async_goto() with the
channel lock held.

* Made always eat the fax detection frame whether there is a fax extension
or not.

ASTERISK-26216
Reported by: Richard Mudgett

Change-Id: I32aecbb4818af646dc5a619f0dc040e9b1f222e5

9 years agores_fax.c: Fix deadlock potential in FAXOPT(faxdetect) framehook. 45/3245/1
Richard Mudgett [Tue, 12 Jul 2016 22:33:29 +0000 (17:33 -0500)] 
res_fax.c: Fix deadlock potential in FAXOPT(faxdetect) framehook.

The fax_detect_framehook() has the potential to deadlock if an incoming
fax happens during the Playback or similar application.

* Fixed the potential deadlock by not calling ast_async_goto() with the
channel lock held.

* Made always eat the fax detection frame whether there is a fax extension
or not.

* Made only detach the framehook if we detected a fax and not on other
possible frames.

ASTERISK-26216
Reported by: Richard Mudgett

Change-Id: I99da35c26d1cd802626ffb4c1b4eb5b015581b6d

9 years agores_fax: Fix FAXOPT(faxdetect) timeout option. 37/3237/1
Richard Mudgett [Tue, 12 Jul 2016 22:24:54 +0000 (17:24 -0500)] 
res_fax: Fix FAXOPT(faxdetect) timeout option.

The fax detection timeout option did not work because basically the wrong
variable was checked in fax_detect_framehook().  As a result, the timer
would timeout immediately and disable fax detection.

* Fixed ignoring negative timeout values.  We'd complain and then go right
on using the negative value.

* Fixed destroy_faxdetect() in the off-nominal case of an incomplete
object creation.

* Added more range checking to FAXOPT(gateway) timeout parameter.

ASTERISK-26214 #close
Reported by: Richard Mudgett

Change-Id: Idc5e698dfe33572de9840bc68cd9fc043cbad976

9 years agochan_dahdi: Add faxdetect_timeout option. 36/3236/1
Richard Mudgett [Mon, 18 Jul 2016 21:16:56 +0000 (16:16 -0500)] 
chan_dahdi: Add faxdetect_timeout option.

The new option allows the channel driver's faxdetect option to timeout on
a call after the specified number of seconds into a call.  The new feature
is disabled if the timeout is set to zero.  The option is disabled by
default.

* Don't clear dsp_features after passing them to the dsp code in
my_pri_ss7_open_media().  We should still remember them especially for the
new faxdetect_timeout option.

ASTERISK-26214
Reported by: Richard Mudgett

Change-Id: Ieffd3fe788788d56282844774365546dce8ac810

9 years agores_pjsip: Add fax_detect_timeout endpoint option. 35/3235/1
Richard Mudgett [Sat, 16 Jul 2016 01:44:52 +0000 (20:44 -0500)] 
res_pjsip: Add fax_detect_timeout endpoint option.

The new endpoint option allows the PJSIP channel driver's fax_detect
endpoint option to timeout on a call after the specified number of
seconds into a call.  The new feature is disabled if the timeout is set
to zero.  The option is disabled by default.

ASTERISK-26214
Reported by: Richard Mudgett

Change-Id: Id5a87375fb2c4f9dc1d4b44c78ec8735ba65453d

9 years agoMakefile: Retain XML Declaration and DTD in docs. 29/3229/1
Alexander Traud [Tue, 19 Jul 2016 09:48:25 +0000 (11:48 +0200)] 
Makefile: Retain XML Declaration and DTD in docs.

Since Asterisk 12, the documentation got an XML Stylesheet. Because of a typo,
the XML Declaration and DTD were overwritten by this.

ASTERISK-26212 #close

Change-Id: If5ee4625068042e98ab3fcb22a25e2f15d0c68bd

9 years agoUnit tests: Use AST_TEST_DEFINE in conditional code only. 26/3226/1
Corey Farrell [Mon, 18 Jul 2016 23:39:39 +0000 (19:39 -0400)] 
Unit tests: Use AST_TEST_DEFINE in conditional code only.

If AST_TEST_DEFINE is not conditional to TEST_FRAMEWORK it produces dead
code.  This places all existing unit tests into a conditional block if
they weren't already.

ASTERISK-26211 #close

Change-Id: I8ef83ee11cbc991b07b7a37ecb41433e8c734686

9 years agores_rtp_asterisk: Count a roll-over of the sequence number even on lost packets. 23/3223/1
Alexander Traud [Mon, 18 Jul 2016 10:13:25 +0000 (12:13 +0200)] 
res_rtp_asterisk: Count a roll-over of the sequence number even on lost packets.

With this change, the initial RTP sequence number is randomly chosen not between
0 and 65535 (0xffff) but 0 and 32767 (0x7fff). This assures, the roll-over
counter (ROC) synchronization is not lost for sRTP, when the very first RTP
packets get lost; see http://srtp.sourceforge.net/faq.html#Q6

ASTERISK-26207 #close

Change-Id: I9a527e3aa3ce8f3becc5131d7ba32b57b5845464

9 years agoMakefile: Suppress echoing of target 'config' again. 17/3217/1
Alexander Traud [Mon, 18 Jul 2016 09:14:59 +0000 (11:14 +0200)] 
Makefile: Suppress echoing of target 'config' again.

ASTERISK-26038 #close

Change-Id: I5746cf639f3fdc6332e8a97cf01f979e30bf403f

9 years agoMerge "app_queue: Only remove queue member from pending when state changes." into 13
zuul [Fri, 15 Jul 2016 17:26:52 +0000 (12:26 -0500)] 
Merge "app_queue: Only remove queue member from pending when state changes." into 13

9 years agofeatures.c: Remove unneeded adsi.h include. 11/3211/1
Corey Farrell [Thu, 14 Jul 2016 08:25:43 +0000 (04:25 -0400)] 
features.c: Remove unneeded adsi.h include.

adsi.h is no longer used by features.c since parking was moved to a
module.

Change-Id: I2248b8a455225a17cb6ddaafd6c20c511a1eaf59

9 years agoMerge "Update support for SILK format." into 13
zuul [Thu, 14 Jul 2016 23:54:51 +0000 (18:54 -0500)] 
Merge "Update support for SILK format." into 13

9 years agores_pjsip_mwi: remove unneeded check on endpoint's contacts. 10/3210/1
Alexei Gradinari [Thu, 14 Jul 2016 23:06:34 +0000 (19:06 -0400)] 
res_pjsip_mwi: remove unneeded check on endpoint's contacts.

The function create_mwi_subscriptions_for_endpoint checks
if there is active contacts by retrieving aors and contacts.

This function is used to create all unsolicited mwi subscriptions
on startup and is used when contact added.

In both cases it's not necessary to check if there are contacts.
The contacts are needed when asterisk sends mwi.

ASTERISK-26200 #close

Change-Id: I98e43bdc97f3c0829951cd9bf5f3c6348c6ac1fa

9 years agoUpdate support for SILK format. 36/3136/4
Mark Michelson [Thu, 30 Jun 2016 20:58:53 +0000 (15:58 -0500)] 
Update support for SILK format.

This commit adds scaffolding in order to support the SILK audio format
on calls. Roughly, this is what is added:

* Cached silk formats. One for each possible sample rate.
* ast_codec structures for each possible sample rate.
* RTP payload mappings for "SILK".

In addition, this change overhauls the res_format_attr_silk file in the
following ways:

* The "samplerate" attribute is scrapped. That's native to the format.
* There are far more checks to ensure that attributes have been
  allocated before attempting to reference them.
* We do not SDP fmtp lines for attributes set to 0.

These changes make way to be able to install a codec_silk module and
have it actually work. It also should allow for passthrough silk calls
in Asterisk.

Change-Id: Ieeb39c95a9fecc9246bcfd3c45a6c9b51c59380e

9 years agoMerge "translate: explicit format destination not properly set" into 13
zuul [Thu, 14 Jul 2016 18:40:42 +0000 (13:40 -0500)] 
Merge "translate: explicit format destination not properly set" into 13

9 years agoMerge "threadpool: Fix leak in ast_threadpool_serializer_group error path." into 13
Joshua Colp [Thu, 14 Jul 2016 17:42:17 +0000 (12:42 -0500)] 
Merge "threadpool: Fix leak in ast_threadpool_serializer_group error path." into 13

9 years agoMerge "pbx: Fix leak of timezone for time based includes." into 13
zuul [Thu, 14 Jul 2016 17:05:21 +0000 (12:05 -0500)] 
Merge "pbx: Fix leak of timezone for time based includes." into 13

9 years agoMerge "BuildSystem: Avoid obsolete warning with pthread.m4 on autoconf." into 13
zuul [Thu, 14 Jul 2016 17:05:20 +0000 (12:05 -0500)] 
Merge "BuildSystem: Avoid obsolete warning with pthread.m4 on autoconf." into 13

9 years agoMerge "res_rtp_asterisk: Enable Forward Secrecy (PFS) for DTLS." into 13
zuul [Thu, 14 Jul 2016 14:55:08 +0000 (09:55 -0500)] 
Merge "res_rtp_asterisk: Enable Forward Secrecy (PFS) for DTLS." into 13

9 years agoMerge "stasis_endpoint.c: Fix contactstatus_to_json()." into 13
zuul [Thu, 14 Jul 2016 13:02:29 +0000 (08:02 -0500)] 
Merge "stasis_endpoint.c: Fix contactstatus_to_json()." into 13

9 years agoapp_queue: Only remove queue member from pending when state changes. 05/3205/1
Joshua Colp [Thu, 14 Jul 2016 12:45:10 +0000 (09:45 -0300)] 
app_queue: Only remove queue member from pending when state changes.

It is possible for a not in use state change to occur multiple
times causing a queue member to be removed from the pending call
container prematurely.

The first not in use state change will remove the queue member
from the container. At this moment the member may be called and
placed in the pending container. After this another not in use
state change can be received which will remove it from the
container. Despite being called at this point the code will
incorrectly see that there are no pending calls to it.

This change only removes it from the pending container if the
state has actually changed.

ASTERISK-26133 #close
patches:
  app_queue.diff submitted by Richard Miller (license 5685)

Change-Id: Ie5a7f17a44f98e9159e9b85009ce3f8393aa78c0

9 years agoMerge "pjsip_options.c: Fix container operation." into 13
zuul [Thu, 14 Jul 2016 12:48:30 +0000 (07:48 -0500)] 
Merge "pjsip_options.c: Fix container operation." into 13

9 years agoMerge "pjsip_configuration.c: Misc cleanups." into 13
zuul [Thu, 14 Jul 2016 12:34:04 +0000 (07:34 -0500)] 
Merge "pjsip_configuration.c: Misc cleanups." into 13

9 years agopbx: Fix leak of timezone for time based includes. 02/3202/1
Corey Farrell [Thu, 14 Jul 2016 07:40:26 +0000 (03:40 -0400)] 
pbx: Fix leak of timezone for time based includes.

Create include_free to run ast_destroy_timing and ast_free, use that in
all places that freed an ast_include structure.  This fixes a couple of
paths that previously did not run ast_destroy_timing.

ASTERISK-26196 #close

Change-Id: I1671bd111bef0dc113e8bf8f77f89fcfc395d838

9 years agoMerge "chan_sip: Fix reference leak in mwi_event_cb" into 13
zuul [Thu, 14 Jul 2016 03:11:42 +0000 (22:11 -0500)] 
Merge "chan_sip: Fix reference leak in mwi_event_cb" into 13

9 years agoMerge "res/res_pjsip_session: Check for presence of an active negotiator" into 13
zuul [Thu, 14 Jul 2016 02:44:12 +0000 (21:44 -0500)] 
Merge "res/res_pjsip_session: Check for presence of an active negotiator" into 13

9 years agoMerge "res/res_pjsip_pubsub: Add additional debug statements" into 13
Joshua Colp [Wed, 13 Jul 2016 23:53:02 +0000 (18:53 -0500)] 
Merge "res/res_pjsip_pubsub: Add additional debug statements" into 13

9 years agoMerge "res/res_corosync: Raise a Stasis message on node join/leave events" into 13
Joshua Colp [Wed, 13 Jul 2016 23:52:56 +0000 (18:52 -0500)] 
Merge "res/res_corosync: Raise a Stasis message on node join/leave events" into 13

9 years agotranslate: explicit format destination not properly set 00/3200/1
Kevin Harwell [Wed, 13 Jul 2016 22:45:27 +0000 (17:45 -0500)] 
translate: explicit format destination not properly set

If the destination format's name differed from the codec name then the
translator's explict_dst field would be improperly set. In some circumstances
it would end up setting it to a newly created format that has the same name
as the codec when it actually needed to be the given destination codec.

This could cause the translation path to use the wrong format. For instance,
if an endpoint had specified 'myulaw' as a format the translator could end up
using a 'ulaw' format (with whatever/default settings) instead. If the format
attribute settings differed between the two then there may unexpected results
during processing.

This patch removes the name check when building the translation path. This
should make it always set the translator's explicit_dst to the given destination
format as long as the sample rate and types match.

Change-Id: Iaf8a03831d68e657d89569d54b505074efbefab5

9 years agostasis_endpoint.c: Fix contactstatus_to_json(). 94/3194/1
Richard Mudgett [Fri, 8 Jul 2016 16:46:04 +0000 (11:46 -0500)] 
stasis_endpoint.c: Fix contactstatus_to_json().

The roundtrip_usec json member is optional.  If it isn't present then
don't put it into the converted json structure where ast_json_pack()
will choke on it.

Change-Id: I39bb2f86154ef54591270c58bfda8635070f9ea0

9 years agochan_sip: Fix reference leak in mwi_event_cb 90/3190/1
Corey Farrell [Wed, 13 Jul 2016 18:45:07 +0000 (14:45 -0400)] 
chan_sip: Fix reference leak in mwi_event_cb

Cleanup the peer reference when stasis_subscription_final_message is
true.  Also free peer_name even if peer exists, after reload a new
peer_name will be allocated.

ASTERISK-26193 #close

Change-Id: If7ecd52facdc5c227f701c760841e3f6ca53cc69

9 years agores_rtp_asterisk: Enable Forward Secrecy (PFS) for DTLS. 67/3067/4
Alexander Traud [Wed, 22 Jun 2016 12:13:39 +0000 (14:13 +0200)] 
res_rtp_asterisk: Enable Forward Secrecy (PFS) for DTLS.

Since July 2014, TLS based protocols (SIP over TLS, Secure WebSockets, HTTPS)
support PFS thanks to ASTERISK-23905. In July 2015, the same feature was added
for DTLS. The source code from main/tcptls.c should have been re-used to ease
security audits. Therefore, this change rolls back the change from July 2015 and
re-uses the code from July 2014. This has the additional benefits to work under
CentOS 7 and enabling not just ECDHE but DHE based cipher suites as well.

ASTERISK-25659 #close
Reported by: StefanEng86, urbaniak, pay123
Tested by: sarumjanuch, traud
patches:
res_rtp_asterisk.patch submitted by sarumjanuch
dtls_centos_step_1.patch submitted by traud
dtls_centos_step_2.patch submitted by traud

Change-Id: I537cadf4421f092a613146b230f2c0ee1be28d5c

9 years agothreadpool: Fix leak in ast_threadpool_serializer_group error path. 88/3188/1
Corey Farrell [Wed, 13 Jul 2016 16:30:58 +0000 (12:30 -0400)] 
threadpool: Fix leak in ast_threadpool_serializer_group error path.

ast_threadpool_serializer_group leaks a reference to ser when listener
is allocated but tps is not.  Although listener takes the reference to
ser cleanup functions are not run without tps.

ASTERISK-26191 #close

Change-Id: Ie3ccf69a3f1e676c2ef62a77067c0cb57dc9a585

9 years agopjsip_options.c: Fix container operation. 93/3193/1
Richard Mudgett [Mon, 11 Jul 2016 15:22:35 +0000 (10:22 -0500)] 
pjsip_options.c: Fix container operation.

aor_observer_deleted() needs to operate on all contacts found for the
deleted AOR instead of only the first one found.  This is really only a
problem if there is more than one contact for the AOR.

Change-Id: Id24ac0d5e8c931330231fb45dd2a331a84339dc1

9 years agopjsip_configuration.c: Misc cleanups. 92/3192/1
Richard Mudgett [Mon, 11 Jul 2016 15:21:35 +0000 (10:21 -0500)] 
pjsip_configuration.c: Misc cleanups.

* Fix some whitespace in various routines.

* Rename i to iter in persistent_endpoint_update_state().

* Fix off-nominal copy/paste message wording in
persistent_endpoint_contact_deleted_observer()

Change-Id: Id8e34f5d09e7eebac3af22501c44c1110a3e29d8

9 years agoBuildSystem: Avoid obsolete warning with pthread.m4 on autoconf. 86/3186/1
Alexander Traud [Wed, 13 Jul 2016 13:57:08 +0000 (15:57 +0200)] 
BuildSystem: Avoid obsolete warning with pthread.m4 on autoconf.

Updated the macro-set autoconf/ax_pthread.m4 to its latest upstream version.

ASTERISK-26046 #close

Change-Id: I11abc11d17acd2b6a8a5a5be8ae8e0949dab9cc7

9 years agoMerge "res_pjsip: Fix statsd regression." into 13
zuul [Wed, 13 Jul 2016 12:28:31 +0000 (07:28 -0500)] 
Merge "res_pjsip: Fix statsd regression." into 13

9 years agoMerge "BuildSystem: Allow own CFLAGS on ./configure." into 13
zuul [Wed, 13 Jul 2016 11:13:27 +0000 (06:13 -0500)] 
Merge "BuildSystem: Allow own CFLAGS on ./configure." into 13

9 years agoMerge "install_prereq: Checkout of libSRTP 1.5.x." into 13
zuul [Wed, 13 Jul 2016 00:19:38 +0000 (19:19 -0500)] 
Merge "install_prereq: Checkout of libSRTP 1.5.x." into 13

9 years agoMerge "chan_sip: Fix reference leaks in error paths." into 13
zuul [Tue, 12 Jul 2016 23:09:42 +0000 (18:09 -0500)] 
Merge "chan_sip: Fix reference leaks in error paths." into 13

9 years agoMerge "res_sorcery_realtime: fix bug when successful UPDATE is treated as failed...
zuul [Tue, 12 Jul 2016 22:33:37 +0000 (17:33 -0500)] 
Merge "res_sorcery_realtime: fix bug when successful UPDATE is treated as failed" into 13

9 years agoMerge "res_pjsip: Added "subscribe_context" to endpoint" into 13
zuul [Tue, 12 Jul 2016 22:10:57 +0000 (17:10 -0500)] 
Merge "res_pjsip: Added "subscribe_context" to endpoint" into 13

9 years agoMerge "BuildSystem: Avoid obsolete warning with libcurl.m4 on autoconf." into 13
zuul [Tue, 12 Jul 2016 20:44:35 +0000 (15:44 -0500)] 
Merge "BuildSystem: Avoid obsolete warning with libcurl.m4 on autoconf." into 13

9 years agoMerge "func_odbc: Fix connection deadlock." into 13
zuul [Tue, 12 Jul 2016 20:28:26 +0000 (15:28 -0500)] 
Merge "func_odbc: Fix connection deadlock." into 13

9 years agores_pjsip: Fix statsd regression. 75/3175/1
Richard Mudgett [Mon, 11 Jul 2016 15:25:04 +0000 (10:25 -0500)] 
res_pjsip: Fix statsd regression.

The ASTERISK-25904 change-id I8fad8aae9305481469c38d2146e1ba3a56d3108f
patch introduced several regressions when the newly created "Updated"
state goes out for each endpoint registration refresh.

1) It restarted any OPTIONS RTT ping cycle.

2) It would interfere with a currently active ping and throw off that
ping's resulting RTT calculation.

3) It cleared the RTT time each time the endpoint was refreshed.

4) The cleared RTT time was sent out as a statsd update each time.

5) It created two AMI events for each update.

* Revert the original patch and reimplement it.  Now the current contact
status state is re-sent instead of the state being momentarily toggled
every time the endpoint refreshes its registration.  The statsd events are
not created for the re-sent refresh because they are sent after every
OPTIONS ping.

ASTERISK-26160 #close
Reported by: Matt Jordan

Change-Id: Ie072be790fbb2a8f5c1c874266e4143fa31f66d1

9 years agoBuildSystem: Allow own CFLAGS on ./configure. 70/3170/1
Alexander Traud [Tue, 12 Jul 2016 08:50:22 +0000 (10:50 +0200)] 
BuildSystem: Allow own CFLAGS on ./configure.

Before this change, make failed with the error
Unknown value '' found in build_tools/menuselect-deps for NATIVE_ARCH
when CFLAGS were supplied to the configure script. This was introduced with
<https://reviewboard.asterisk.org/r/1852/> which disabled BUILD_NATIVE when
CFLAGS were supplied. Those who need different -march= values, please, go for
./configure
make menuselect.makeopts or make menuselect
./menuselect/menuselect --disable BUILD_NATIVE

ASTERISK-25289 #close

Change-Id: Ic6365d5a97bb9b3556858f06432a8d1cfa83eebc

9 years agoast_expr2: Fix off-nominal memory leak. 67/3167/1
Richard Mudgett [Mon, 11 Jul 2016 18:42:55 +0000 (13:42 -0500)] 
ast_expr2: Fix off-nominal memory leak.

Thanks to ibercom for pointing out a memory leak that was missed
in the earlier patch for the issue.

ASTERISK-26119
Reported by: Alexei Gradinari

Change-Id: I9a151f5c4725d97fb82a9e938bc73dc659532b71

9 years agoinstall_prereq: Checkout of libSRTP 1.5.x. 65/3165/1
Alexander Traud [Mon, 11 Jul 2016 15:17:47 +0000 (17:17 +0200)] 
install_prereq: Checkout of libSRTP 1.5.x.

Since 5th November 2014, the master branch of libSRTP changed the prefix of
several member names and is not compatible with the source code in Asterisk
anymore. Therefore instead, this change checks out the latest version of the
libSRTP 1.5.x branch. Furthermore now, libSRTP is compiled with OpenSSL as
backend. This makes AES-GCM and AES-IN possible.

ASTERISK-22131 #close

Change-Id: I2e396cdc01da0ff610686e398ed210ca7408f7d6

9 years agofunc_odbc: Fix connection deadlock. 72/3172/1
Joshua Colp [Mon, 11 Jul 2016 00:08:28 +0000 (21:08 -0300)] 
func_odbc: Fix connection deadlock.

The func_odbc module was modified to ensure that the
previous behavior of using a single database connection
was maintained. This was done by getting a single database
connection and holding on to it. With the new multiple
connection support in res_odbc this will actually starve
every other thread from getting access to the database as
it also maintains the previous behavior of having only
a single database connection.

This change disables the func_odbc specific behavior if
the res_odbc module is running with only a single database
connection active. The connection is only kept for the
duration of the request.

ASTERISK-26177 #close

Change-Id: I9bdbd8a300fb3233877735ad3fd07bce38115b7f

9 years agochan_sip: Fix reference leaks in error paths. 62/3162/1
Corey Farrell [Sat, 9 Jul 2016 18:32:27 +0000 (14:32 -0400)] 
chan_sip: Fix reference leaks in error paths.

* get_sip_pvt_from_replaces leaks sip_pvt_ptr on any error.
* build_peer leaks peer on failure to allocate the endpoint.

This patch fixes get_sip_pvt by using an RAII_VAR, build_peer is fixed
with an unref in the appropriate place.

ASTERISK-26184 #close

Change-Id: I728b424648ad041409f7d90880f4c28b3ce2ca12

9 years agoMerge "chan_sip/res_pjsip_t38: Handle a request to negotiate T.38 after it is enabled...
zuul [Fri, 8 Jul 2016 19:05:13 +0000 (14:05 -0500)] 
Merge "chan_sip/res_pjsip_t38: Handle a request to negotiate T.38 after it is enabled." into 13

9 years agoMerge "REF_DEBUG: Prevent logging of container node objects." into 13
zuul [Fri, 8 Jul 2016 11:46:58 +0000 (06:46 -0500)] 
Merge "REF_DEBUG: Prevent logging of container node objects." into 13

9 years agoREF_DEBUG: Prevent logging of container node objects. 59/3159/1
Corey Farrell [Thu, 7 Jul 2016 17:41:25 +0000 (13:41 -0400)] 
REF_DEBUG: Prevent logging of container node objects.

Using AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE can result in an unref being
recorded to the refs log for the node being replaced.  This prevents
logging of those unrefs since they would produce errors in
refcounter.py.

ASTERISK-26181 #close

Change-Id: Ie4fded84e8a1a58b3a59ce59dfd7eb0da3ddc5d4

9 years agoPJSIP: provide valid tcp nodelay option for reuse 51/3151/2
Scott Griepentrog [Thu, 7 Jul 2016 15:55:42 +0000 (10:55 -0500)] 
PJSIP: provide valid tcp nodelay option for reuse

When using TCP transport with chan_pjsip, the TCP_NODELAY
option value was allocated on the stack, then passed as a
pointer to the tcp transport configuration structure, and
later re-used on subsequently created sockets when it was
no longer valid.  This patch changes the allocation to be
a static.

ASTERISK-26180 #close
Reported by: Scott Griepentrog

Change-Id: I3251164c7f710dbdab031282f00e30a9770626a0

9 years agochan_sip/res_pjsip_t38: Handle a request to negotiate T.38 after it is enabled. 54/3154/1
Joshua Colp [Thu, 7 Jul 2016 15:38:45 +0000 (12:38 -0300)] 
chan_sip/res_pjsip_t38: Handle a request to negotiate T.38 after it is enabled.

Some T.38 implementations may send another re-invite after the initial
one which adds additional negotiation details (such as the max bitrate).
Currently this will fail when passthrough is being done in chan_sip as we
do nothing if T.38 is already active.

Other handlers of T.38 inside of Asterisk (such as res_fax) handle this
scenario so this change adds support for it to chan_sip and res_pjsip_t38.
If a request to negotiate is received while T.38 is already enabled a
new re-INVITE is sent and negotiation is done again.

ASTERISK-26179 #close

Change-Id: I0298494d3da6df3219bbfa4be9aa04015043145c

9 years agores_sorcery_realtime: fix bug when successful UPDATE is treated as failed 46/3146/2
Alexei Gradinari [Mon, 4 Jul 2016 21:38:57 +0000 (17:38 -0400)] 
res_sorcery_realtime: fix bug when successful UPDATE is treated as failed

If the SQL UPDATE statement changes nothing then SQLRowCount returns 0.
This value should be treated as success.
But the function sorcery_realtime_update treats it as failed.

This bug was found using stress tests on PJSIP.
If there are 2 consecutive SIP REGISTER requests with the same contact data
during 1 second then res_pjsip_registrar adds contact location on 1st request
and tries to update contact location on 2nd.
The update fails and res_pjsip_registrar even removes correct contact location.

The test "object_update_uncreated" was removed from test_sorcery_realtime.c
because it's now a valid situation.

This patch also adds missing debug of extra SQL parameter.

ASTERISK-26172 #close

Change-Id: I05a7f3051455336c9dda29efc229decf86071303

9 years agores/res_pjsip_session: Check for presence of an active negotiator 11/3111/5
Matt Jordan [Sat, 25 Jun 2016 00:55:09 +0000 (19:55 -0500)] 
res/res_pjsip_session: Check for presence of an active negotiator

It is possible in a hypothetical situation for a session refresh to be
invoked on a PJSIP when the negotiatior on the INVITE session has not
yet been established. While this shouldn't occur with existing uses of
ast_sip_session_refresh, the crashes that occur due to improperly
calling PJSIP functions that expect a non-NULL negotiatior are
avoidable. PJSIP will create the negotiator in pjsip_inv_reinvite; this
means that simply checking for the presence of the negotiator before
passing it to other PJSIP functions that use it is allowable. As such,
this patch adds checks for the presence of the negotiator before calling
PJSIP functions that assume it is non-NULL.

Change-Id: I1028323e7e01b0a531865e5412a71b6f6ec4276d

9 years agores/res_pjsip_pubsub: Add additional debug statements 10/3110/4
Matt Jordan [Mon, 19 Oct 2015 23:55:58 +0000 (18:55 -0500)] 
res/res_pjsip_pubsub: Add additional debug statements

When something very sad and wrong occurs, it's challenging sometimes to
figure out why. This patch adds some additional debug statements on
off-nominal paths to try and make debugging easier.

Change-Id: I7bffb73cc733b6f80193a23340881db4a102b640

9 years agores/res_corosync: Raise a Stasis message on node join/leave events 09/3109/4
Matt Jordan [Mon, 19 Oct 2015 23:55:33 +0000 (18:55 -0500)] 
res/res_corosync: Raise a Stasis message on node join/leave events

When res_corosync detects that a node leaves or joins, it currently is
informed of this via Corosync callbacks. However, there are a few
limitations with the information presented:
(1) While we have information that Corosync is aware of - such as the
    Corosync nodeid - that information is really only useful inside of
    Corosync or res_corosync. There's no way to translate a Corosync
    nodeid to some other internally useful unique identifier for the
    Asterisk instance that just joined or left the cluster.
(2) While res_corosync is notified of the instance joining or leaving
    the cluster, it has no mechanism to inform the Asterisk core or
    other modules of this event. This limits the usefulness of res_corosync
    as a heartbeat mechanism for other modules.

This patch addresses both issues.

First, it adds the notion of a cluster discovery message both within the
Stasis message bus, as well as the binary event messages that
res_corosync uses to transmit data back and forth within the cluster.
When Asterisk joins the cluster, it sends a discovery message to the other
nodes in the cluster, which correlates the Corosync nodeid along with
the Asterisk EID. res_corosync now maintains a hash of Corosync nodeids
to Asterisk EIDs, such that it can map changes in cluster state with the
Asterisk instance that has that nodeid. Likewise, when an Asterisk
instance receives a discovery message from a node in the cluster, it now
sends its own discovery message back to the originating node with the
local Asterisk EID. This lets Asterisk instances within the cluster
build a complete picture of the other Asterisk instances within the
cluster.

Second, it publishes the discovery messages onto the Stasis message bus.
Said messages are published whenever a node joins or leaves the cluster.
Interested modules can subscribe for the ast_cluster_discovery_type()
message under the ast_system_topic() and be notified when changes in
cluster state occur.

Change-Id: I9015f418d6ae7f47e4994e04e18948df4d49b465

9 years agores_pjsip: Added "subscribe_context" to endpoint 45/3145/4
Alexei Gradinari [Mon, 4 Jul 2016 18:54:34 +0000 (14:54 -0400)] 
res_pjsip: Added "subscribe_context" to endpoint

If specified, incoming SUBSCRIBE requests will be searched for the matching
extension in the indicated context. If no "subscribe_context" is specified,
then the "context" setting is used.

ASTERISK-25471 #close

Change-Id: I3fb7a15f5bc154079bd348c08b7ad1cdd2d5e514

9 years agoBuildSystem: Avoid obsolete warning with libcurl.m4 on autoconf. 44/3144/1
Alexander Traud [Mon, 4 Jul 2016 10:58:39 +0000 (12:58 +0200)] 
BuildSystem: Avoid obsolete warning with libcurl.m4 on autoconf.

Updated the macro-set autoconf/libcurl.m4 to its latest upstream version. This
avoids a warning about an obsolete macro on AC_HELP_STRING, because Asterisk is
using AS_HELP_STRING everywhere else already.

ASTERISK-26046

Change-Id: I8299faf504ceaeee3e39930c59293809e116c631

9 years agoMerge "res_pjsip_session.c: Don't send extra BYE if SDP invalid." into 13
Joshua Colp [Fri, 1 Jul 2016 16:16:21 +0000 (11:16 -0500)] 
Merge "res_pjsip_session.c: Don't send extra BYE if SDP invalid." into 13

9 years agoMerge "res_pjsip_session.c: End call on initial invalid SDP negotiation." into 13
Joshua Colp [Fri, 1 Jul 2016 16:16:16 +0000 (11:16 -0500)] 
Merge "res_pjsip_session.c: End call on initial invalid SDP negotiation." into 13

9 years agoMerge "res_pjsip.c: Register PJMEDIA error code decoder." into 13
Joshua Colp [Fri, 1 Jul 2016 16:16:12 +0000 (11:16 -0500)] 
Merge "res_pjsip.c: Register PJMEDIA error code decoder." into 13

9 years agoMerge "res_pjsip_session.c: Remove unused parameter from handle_incoming()." into 13
Joshua Colp [Fri, 1 Jul 2016 16:16:06 +0000 (11:16 -0500)] 
Merge "res_pjsip_session.c: Remove unused parameter from handle_incoming()." into 13

9 years agoMerge "res_pjsip: Add missing NULL checks when using pjsip_inv_end_session()." into 13
Joshua Colp [Fri, 1 Jul 2016 16:15:59 +0000 (11:15 -0500)] 
Merge "res_pjsip: Add missing NULL checks when using pjsip_inv_end_session()." into 13

9 years agoMerge "features: Fix channel datastore access." into 13
Joshua Colp [Fri, 1 Jul 2016 14:59:40 +0000 (09:59 -0500)] 
Merge "features: Fix channel datastore access." into 13

9 years agoMerge "res_pjsip: improve realtime performance #2" into 13
Joshua Colp [Thu, 30 Jun 2016 20:53:16 +0000 (15:53 -0500)] 
Merge "res_pjsip: improve realtime performance #2" into 13

9 years agofeatures: Fix channel datastore access. 24/3124/1
Richard Mudgett [Thu, 30 Jun 2016 20:17:02 +0000 (15:17 -0500)] 
features: Fix channel datastore access.

Found as a result of the testsuite tests/callparking test crashing.

Several calls to ast_get_chan_featuremap_config() and
ast_get_chan_features_xfer_config() did not lock the channel before
calling so the channel's datastore list was accessed without the lock's
protection.  Apparently another thread deleted a datastore on the
channel's list while the crashing thread was walking the list.  Crash at
0xdeaddead due to MALLOC_DEBUG's memory filler value as a result.

* Add missing channel locks to calls that were not already protected
as the doxygen for those calls indicates.

Change-Id: Id273b3d305cc616406c353cbc841b2b7655efaa1

9 years agores_pjsip_session.c: Don't send extra BYE if SDP invalid. 30/3130/1
Richard Mudgett [Wed, 22 Jun 2016 22:26:38 +0000 (17:26 -0500)] 
res_pjsip_session.c: Don't send extra BYE if SDP invalid.

When an answer SDP is invalid we were disconnecting the outgoing call and
sending two BYE requests.  The first BYE was sent by PJPROJECT because of
the invalid SDP answer.  The second BYE was sent by Asterisk because it
thought the canceled call was the result of the RFC5407 section 3.1.2 race
condition.

* Made not send the BYE on a canceled session if the SDP negotiation is
incomplete because PJPROJECT has already sent a BYE for the failed
negotiation.

ASTERISK-25772 #close
Reported by:  Dmitriy Serov

Change-Id: I44ad0bd0605e8eeb7035c890d6f97a1331f1a836

9 years agores_pjsip_session.c: End call on initial invalid SDP negotiation. 29/3129/1
Richard Mudgett [Mon, 27 Jun 2016 22:19:08 +0000 (17:19 -0500)] 
res_pjsip_session.c: End call on initial invalid SDP negotiation.

When an incoming call defers SDP negotiation and then sends us an invalid
SDP in the ACK, we need to send a BYE to disconnect the call.  In this
case SDP negotiation has failed and we don't have valid media streams
negotiated.

ASTERISK-25772

Change-Id: Ia358516b0fc1e6c4c139b78246f10b9da7a2dfb8