asterisk/asterisk.git
3 years agoMerge "res_pjsip_mwi: fix unsolicited mwi blocks PJSIP stack"
zuul [Tue, 9 Aug 2016 21:44:33 +0000 (16:44 -0500)]
Merge "res_pjsip_mwi: fix unsolicited mwi blocks PJSIP stack"

3 years agoMerge "res_pjsip_outbound_publish: Use a serializer shutdown group for unload."
zuul [Tue, 9 Aug 2016 21:19:03 +0000 (16:19 -0500)]
Merge "res_pjsip_outbound_publish: Use a serializer shutdown group for unload."

3 years agores_pjsip_mwi: fix unsolicited mwi blocks PJSIP stack
Alexei Gradinari [Mon, 8 Aug 2016 17:53:32 +0000 (13:53 -0400)]
res_pjsip_mwi: fix unsolicited mwi blocks PJSIP stack

The PJSIP taskprocessors could be overflowed on startup
if there are many (thousands) realtime endpoints
configured with unsolicited mwi.
The PJSIP stack could be totally unresponsive for a few minutes
after boot completed.

This patch creates a separate PJSIP serializers pool for mwi
and makes unsolicited mwi use serializers from this pool.
This patch also adds 2 new global options to tune taskprocessor
alert levels: 'mwi_tps_queue_high' and 'mwi_tps_queue_low'.

This patch also adds new global option 'mwi_disable_initial_unsolicited'
to disable sending unsolicited mwi to all endpoints on startup.
If disabled then unsolicited mwi will start processing
on next endpoint's contact update.

ASTERISK-26230 #close

Change-Id: I4c8ecb82c249eb887930980a800c9f87f28f861a

3 years agoapp_voicemail: Add taskprocessor alert level options.
Alexei Gradinari [Fri, 5 Aug 2016 20:34:15 +0000 (16:34 -0400)]
app_voicemail: Add taskprocessor alert level options.

On heavy loaded system with IMAP or DB storage,
'app_voicemail' taskprocessor queue could reach 500 scheduled tasks.
It could happen when the IMAP or DB server dies or is unreachable.
It could happen on startup when there are many (thousands)
realtime endpoints configured with unsolicited mwi.
If the taskprocessor queue reaches the high water level
then the alert is triggered and pjsip stops processing new requests
until the queue reaches the low water level to clear the alert.

This patch adds 2 new 'general' configuration options
to tune taskprocessor alert levels:
'tps_queue_high' - Taskprocessor high water alert trigger level.
'tps_queue_low' - Taskprocessor low water clear alert level

ASTERISK-26229 #close

Change-Id: I766294fbffedf64053c0d9ac0bedd3109f043ee8

3 years agores_pjsip_outbound_publish: Use a serializer shutdown group for unload.
Joshua Colp [Thu, 4 Aug 2016 15:16:33 +0000 (15:16 +0000)]
res_pjsip_outbound_publish: Use a serializer shutdown group for unload.

This change replaces the custom unload process for the outbound
publish module with the common serializer shutdown group.

ASTERISK-25217 #close

Change-Id: I280a0384d860c486202d87d2d674394cca77ffb6

3 years agoresource_channels: Sync with ARI stubs
Kevin Harwell [Thu, 4 Aug 2016 15:27:48 +0000 (10:27 -0500)]
resource_channels: Sync with ARI stubs

This file was out of sync with the current ARI definitions.

Change-Id: Ie7cb7d6d3c2eeb9cc9d683ca87b43b117e713d0a

3 years agoAdd missing checks during startup.
Corey Farrell [Wed, 3 Aug 2016 20:41:04 +0000 (16:41 -0400)]
Add missing checks during startup.

This ensures startup is canceled due to allocation failures from the
following initializations.
* channel.c: ast_channels_init
* config_options.c: aco_init

ASTERISK-26265 #close

Change-Id: I911ed08fa2a3be35de55903e0225957bcdbe9611

3 years agoastconfigparser: Really handle case where line is simply a comment.
Joshua Colp [Wed, 3 Aug 2016 14:47:04 +0000 (14:47 +0000)]
astconfigparser: Really handle case where line is simply a comment.

The regular expression would match causing the code that handled
the line if it was merely a comment to never get executed.

Change-Id: I3e4022481037ebcba9905587fe8c764b4ce21819

3 years agoMerge "res_pjsip: SIP/SDP origin (o=) contained square brackets on IP6 transports."
zuul [Tue, 2 Aug 2016 22:38:14 +0000 (17:38 -0500)]
Merge "res_pjsip: SIP/SDP origin (o=) contained square brackets on IP6 transports."

3 years agoMerge "menuselect: Add an opaque "member_data" string to the acceptable xml"
zuul [Tue, 2 Aug 2016 18:24:44 +0000 (13:24 -0500)]
Merge "menuselect:  Add an opaque "member_data" string to the acceptable xml"

3 years agoMerge "sorcery: Use more compatible regex for local expressions."
zuul [Tue, 2 Aug 2016 15:57:59 +0000 (10:57 -0500)]
Merge "sorcery: Use more compatible regex for local expressions."

3 years agoMerge "pjproject: fixed a few bugs"
zuul [Tue, 2 Aug 2016 15:50:49 +0000 (10:50 -0500)]
Merge "pjproject: fixed a few bugs"

3 years agosorcery: Use more compatible regex for local expressions.
Joshua Colp [Mon, 1 Aug 2016 16:08:15 +0000 (16:08 +0000)]
sorcery: Use more compatible regex for local expressions.

This changes the use of an empty regex for both res_sorcery_config
and res_sorcery_memory to "." instead. This is a more compatible
regular expression which also works on FreeBSD.

ASTERISK-26206 #close

Change-Id: Ia9166dd176f1597555ba22b6931180d0626c1388

3 years agores_pjsip: SIP/SDP origin (o=) contained square brackets on IP6 transports.
Alexander Traud [Tue, 2 Aug 2016 08:08:34 +0000 (10:08 +0200)]
res_pjsip: SIP/SDP origin (o=) contained square brackets on IP6 transports.

ASTERISK-26256 #close

Change-Id: I3fd68df561f81fdb8c6c497d465b50c12422f058

3 years agomenuselect: Add an opaque "member_data" string to the acceptable xml
George Joseph [Mon, 1 Aug 2016 21:13:17 +0000 (15:13 -0600)]
menuselect:  Add an opaque "member_data" string to the acceptable xml

Change-Id: Id5ac43b95c8d7395f3be37f983632169db3d1afe

3 years agoMerge "astconfigparser: Handle case where line is simply a comment."
zuul [Mon, 1 Aug 2016 20:05:05 +0000 (15:05 -0500)]
Merge "astconfigparser: Handle case where line is simply a comment."

3 years agoMerge "Remove SILK payload mappings from Asterisk core."
Joshua Colp [Mon, 1 Aug 2016 19:52:36 +0000 (14:52 -0500)]
Merge "Remove SILK payload mappings from Asterisk core."

3 years agoMerge "pbx.c: Fix handling of '-' in extension name and callerid"
Joshua Colp [Mon, 1 Aug 2016 14:31:27 +0000 (09:31 -0500)]
Merge "pbx.c: Fix handling of '-' in extension name and callerid"

3 years agoRemove SILK payload mappings from Asterisk core.
Mark Michelson [Fri, 29 Jul 2016 18:13:55 +0000 (13:13 -0500)]
Remove SILK payload mappings from Asterisk core.

SILK is a bit of a hog when it comes to using up our limited number of
dynamic payload types in the RTP engine. By freeing up four slots, it
allows for other codecs to potentially take the place.

Now, codec_silk.so will dynamically use the payload slots in the RTP
engine when it loads.

A better fix would be make RTP dynamic payload types actually
dynamic. However, at this stage of Asterisk 14 development, this is a
risky move that would be imprudent.

Change-Id: I5774e09408f9a203db189529eabdc0d3f4c1e612

3 years agoMerge "pjproject_bundled: Update for pjproject 2.5.5"
zuul [Fri, 29 Jul 2016 15:52:55 +0000 (10:52 -0500)]
Merge "pjproject_bundled:  Update for pjproject 2.5.5"

3 years agoMerge "pbx.c: Allow dangerous functions when adding a hint to dialplan."
Joshua Colp [Fri, 29 Jul 2016 12:25:02 +0000 (07:25 -0500)]
Merge "pbx.c: Allow dangerous functions when adding a hint to dialplan."

3 years agoastconfigparser: Handle case where line is simply a comment.
Joshua Colp [Fri, 29 Jul 2016 09:48:32 +0000 (06:48 -0300)]
astconfigparser: Handle case where line is simply a comment.

Change-Id: I2dea5815363f4d787d709228a04f33baee383ef5

3 years agoMerge "astconfigparser.py: Update with realtime fixes."
Joshua Colp [Fri, 29 Jul 2016 00:18:06 +0000 (19:18 -0500)]
Merge "astconfigparser.py: Update with realtime fixes."

3 years agopbx.c: Fix handling of '-' in extension name and callerid
Corey Farrell [Thu, 28 Jul 2016 19:10:04 +0000 (15:10 -0400)]
pbx.c: Fix handling of '-' in extension name and callerid

This adds a two strings to ast_exten.  name to go with exten and
cidmatch_display to go with cidmatch.  The new fields contain input used
to add the extension in the first place.  The existing fields now
contain stripped input that excludes insignificant spaces and dashes.
These stripped fields should always be used for comparisons.  The
unstripped fields should normally be used for display, but displaying
stripped values will not cause runtime errors.

Note the actual string is only stored twice if it contains dashes.  If
no dashes are found then both 'char *' fields point to the same memory.
So this change has a minimum effect on memory usage.

The existing functions ast_get_extension_name and
ast_get_extension_cidmatch return unstripped values as they did before
this change.  Other similar bugs likely still exist where unstripped
extensions are saved outside pbx.c then passed back in.

ASTERISK-26233 #close

Change-Id: I6cd61ce57acc1570ca6cc14960c4c3b0a9eb837f

3 years agoMerge "dsp.c: Add fax and DTMF detection unit tests."
Joshua Colp [Thu, 28 Jul 2016 22:35:13 +0000 (17:35 -0500)]
Merge "dsp.c: Add fax and DTMF detection unit tests."

3 years agoMerge "dsp.c: Added descriptive comments to Goertzel calculations."
Joshua Colp [Thu, 28 Jul 2016 22:35:09 +0000 (17:35 -0500)]
Merge "dsp.c: Added descriptive comments to Goertzel calculations."

3 years agoMerge "dsp.c: Fix incorrect format reference typo."
Joshua Colp [Thu, 28 Jul 2016 22:35:05 +0000 (17:35 -0500)]
Merge "dsp.c: Fix incorrect format reference typo."

3 years agoMerge "dsp.c: Correct DTMF twist dsp.conf documentation."
Joshua Colp [Thu, 28 Jul 2016 22:35:01 +0000 (17:35 -0500)]
Merge "dsp.c: Correct DTMF twist dsp.conf documentation."

3 years agoMerge "rtp_engine: Failed assertion and wrong name given for codec"
zuul [Thu, 28 Jul 2016 20:46:36 +0000 (15:46 -0500)]
Merge "rtp_engine: Failed assertion and wrong name given for codec"

3 years agopbx.c: Allow dangerous functions when adding a hint to dialplan.
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

3 years agopjproject: fixed a few bugs
Alexei Gradinari [Thu, 21 Jul 2016 15:36:44 +0000 (11:36 -0400)]
pjproject: fixed a few bugs

This patch fixes the issue in pjsip_tx_data_dec_ref()
when tx_data_destroy can be called more than once,
and checks if invalid value (e.g. NULL) is passed to.

This patch updates array limit checks and docs
in pjsip_evsub_register_pkg() and pjsip_endpt_add_capability().

Change-Id: I4c7a132b9664afaecbd6bf5ea4c951e43e273e40

3 years agoMerge "Portably sscanf tv_usec"
Joshua Colp [Thu, 28 Jul 2016 16:38:57 +0000 (11:38 -0500)]
Merge "Portably sscanf tv_usec"

3 years agopjproject_bundled: Update for pjproject 2.5.5
George Joseph [Sun, 17 Jul 2016 23:28:36 +0000 (17:28 -0600)]
pjproject_bundled:  Update for pjproject 2.5.5

Add more --disable-* switches to Makefile.rules including
--disable-opus which was causing bundled pjproject to fail with
"undefined reference" errors in libasteriskpj.

Changed PJ_ENABLE_EXTRA_CHECK to 1.

Removed 2 obsolete patches and added a new one.
The new one was merged by Teluu on 6/27/2016.

ASTERISK-26148 #close

Change-Id: Ib8af6c6a9d31f7238ce65b336134c2efdc855063

3 years agoPortably sscanf tv_usec
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

3 years agortp_engine: Failed assertion and wrong name given for codec
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

3 years agoReplace strdupa with more portable ast_strdupa
David M. Lee [Wed, 27 Jul 2016 14:56:29 +0000 (09:56 -0500)]
Replace strdupa with more portable ast_strdupa

The strdupa function is a GNU extension, and not widely portable. We
have an ast_strdupa function used within Asterisk which is preferred.
I pulled the definition up from menuselect.c into the menuselect.h
header file so it can be shared across menuselect.

Change-Id: I9593c97f78386b47dc1e83201e80cb2f62b36c2e

3 years agodsp.c: Add fax and DTMF detection unit tests.
Richard Mudgett [Fri, 22 Jul 2016 03:44:55 +0000 (22:44 -0500)]
dsp.c: Add fax and DTMF detection unit tests.

* Add fax amplitude and frequency sweep tests.
* Add DTMF amplitude and twist unit tests.

Change-Id: I8d77c9a1eec89e440d715f998c928687e870c3f7

3 years agodsp.c: Added descriptive comments to Goertzel calculations.
Richard Mudgett [Thu, 21 Jul 2016 16:56:53 +0000 (11:56 -0500)]
dsp.c: Added descriptive comments to Goertzel calculations.

* Added doxygen to describe some struct members and what is going on in
the code.

Change-Id: I2ec706a33b52aee42b16dcc356c2bd916a45190d

3 years agodsp.c: Fix incorrect format reference typo.
Richard Mudgett [Wed, 13 Jul 2016 18:48:25 +0000 (13:48 -0500)]
dsp.c: Fix incorrect format reference typo.

Change-Id: Ia131da3ec29acf385cb43a586a29ecc975eb3896

3 years agodsp.c: Correct DTMF twist dsp.conf documentation.
Richard Mudgett [Tue, 26 Jul 2016 02:18:21 +0000 (21:18 -0500)]
dsp.c: Correct DTMF twist dsp.conf documentation.

Change-Id: Idf97e3a72f1edc5fca58f2fa7b20785922be0cae

3 years agoastconfigparser.py: Update with realtime fixes.
Joshua Colp [Fri, 22 Jul 2016 09:43:20 +0000 (06:43 -0300)]
astconfigparser.py: Update with realtime fixes.

When configuring SIP URIs in the pjsip.conf file it is
necessary to escape the semicolon so the parser does not
treat it as a comment. This change allows this to work in
the astconfigparser implementation.

A secondary bug where some data was lost if a configuration
option included a "=" in its value was also fixed.

A bug where sections would be considered equal despite
being different has also been fixed.

Change-Id: If229f656ef22050b50e7b34e90c4bffe796431f8

3 years agodsp.c: Fix erroneous fax tone detection.
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

3 years agoMerge "codecs: Add iLBC 20."
zuul [Tue, 26 Jul 2016 15:52:35 +0000 (10:52 -0500)]
Merge "codecs: Add iLBC 20."

3 years agoMerge "menuselect: Various menuselect enhancements"
Joshua Colp [Tue, 26 Jul 2016 11:40:16 +0000 (06:40 -0500)]
Merge "menuselect:  Various menuselect enhancements"

3 years agoMerge "asterisk.c: Add auto generation and persistence of UUID"
zuul [Tue, 26 Jul 2016 02:14:12 +0000 (21:14 -0500)]
Merge "asterisk.c:  Add auto generation and persistence of UUID"

3 years agoMerge "pbx.c: Remove duplicate code."
zuul [Tue, 26 Jul 2016 00:47:30 +0000 (19:47 -0500)]
Merge "pbx.c: Remove duplicate code."

3 years agomenuselect: Various menuselect enhancements
George Joseph [Sun, 24 Jul 2016 23:27:26 +0000 (17:27 -0600)]
menuselect:  Various menuselect enhancements

* Add 'external' as a support level.
* Add ability for module directories to add entries to the menu
  by adding members to the <module_prefix>/<module_prefix>.xml file.
* Expand the description field to 3 lines in the ncurses implementation.
* Allow the description field to wrap in the newt implementation.
* Add description field to the gtk implementation.

Change-Id: I7f9600a1984a42ce0696db574c1051bc9ad7c808

3 years agoari: Update version.
Joshua Colp [Sun, 24 Jul 2016 21:51:25 +0000 (18:51 -0300)]
ari: Update version.

New functionality has been added so the version has been
bumped to one over the 13 version.

Change-Id: I5d30077f62640c0ac83599b4e9a9b657bf184f69

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

3 years agoasterisk.c: Add auto generation and persistence of UUID
George Joseph [Sat, 23 Jul 2016 13:51:48 +0000 (07:51 -0600)]
asterisk.c:  Add auto generation and persistence of UUID

Upcoming features will require the generation and persistence
of a UUID.

Change-Id: I3ec0062427e133217db6ef496a4216f427c3b92d

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

3 years agoFix sqlalchemy error regarding identifier length.
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

3 years agoMerge "Create Asterisk-14: Update CHANGES and UPGRADE files"
zuul [Fri, 22 Jul 2016 12:48:39 +0000 (07:48 -0500)]
Merge "Create Asterisk-14:  Update CHANGES and UPGRADE files"

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

3 years agoMerge "res_pjsip_pubsub: fixed a bug when pjsip_tx_data_dec_ref is called twice."
Joshua Colp [Fri, 22 Jul 2016 09:51:12 +0000 (04:51 -0500)]
Merge "res_pjsip_pubsub: fixed a bug when pjsip_tx_data_dec_ref is called twice."

3 years agochan_sip: Enable Session-Timers for SIP over TCP (and TLS).
Alexander Traud [Tue, 19 Jul 2016 11:16:02 +0000 (13:16 +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

3 years agocodecs: Add iLBC 20.
Alexander Traud [Tue, 19 Jul 2016 18:39:38 +0000 (20:39 +0200)]
codecs: Add iLBC 20.

Asterisk already supported iLBC 30. This change adds iLBC 20. Now, Asterisk
defaults to iLBC 20 but falls back to iLBC 30, when the remote party requests
this.

ASTERISK-26218 #close
ASTERISK-26221 #close
Reported by: Aaron Meriwether

Change-Id: I07f523a3aa1338bb5217a1bf69c1eeb92adedffa

3 years agoMerge "chan_sip: Prevent deadlock when issuing "sip show channels""
zuul [Fri, 22 Jul 2016 05:33:47 +0000 (00:33 -0500)]
Merge "chan_sip: Prevent deadlock when issuing "sip show channels""

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

Change-Id: I11139a4a95df34e223ba622aa6227e33ab8f6c38

3 years agopbx.c: Remove duplicate code.
Corey Farrell [Fri, 22 Jul 2016 03:34:46 +0000 (23:34 -0400)]
pbx.c: Remove duplicate code.

Merge code found in both branches of a conditional in
ast_add_extension2_lockopt.

The updated code initializes peer_table and peer_label_table of the
extension before linking it to the context.

Change-Id: Ic759e27cdc9906c6877df41d28ee9c5be8f41c20

3 years agoMerge "res_srtp: Enable AES-256 and AES-GCM."
zuul [Fri, 22 Jul 2016 02:11:07 +0000 (21:11 -0500)]
Merge "res_srtp: Enable AES-256 and AES-GCM."

3 years agoMerge "chan_dahdi.c: Fix deadlock potential in fax redirection."
zuul [Fri, 22 Jul 2016 01:47:33 +0000 (20:47 -0500)]
Merge "chan_dahdi.c: Fix deadlock potential in fax redirection."

3 years agoMerge "chan_sip.c: Fix deadlock potential in fax redirection."
zuul [Fri, 22 Jul 2016 01:36:30 +0000 (20:36 -0500)]
Merge "chan_sip.c: Fix deadlock potential in fax redirection."

3 years agoMerge "chan_pjsip.c: Fix deadlock potential in fax redirection."
zuul [Fri, 22 Jul 2016 01:34:44 +0000 (20:34 -0500)]
Merge "chan_pjsip.c: Fix deadlock potential in fax redirection."

3 years agoMerge "res_fax.c: Fix deadlock potential in FAXOPT(faxdetect) framehook."
zuul [Fri, 22 Jul 2016 00:58:55 +0000 (19:58 -0500)]
Merge "res_fax.c: Fix deadlock potential in FAXOPT(faxdetect) framehook."

3 years agoMerge "res_fax: Fix FAXOPT(faxdetect) timeout option."
Joshua Colp [Thu, 21 Jul 2016 23:25:55 +0000 (18:25 -0500)]
Merge "res_fax: Fix FAXOPT(faxdetect) timeout option."

3 years agoMerge "chan_dahdi: Add faxdetect_timeout option."
Joshua Colp [Thu, 21 Jul 2016 23:25:52 +0000 (18:25 -0500)]
Merge "chan_dahdi: Add faxdetect_timeout option."

3 years agoMerge "res_pjsip: Add fax_detect_timeout endpoint option."
Joshua Colp [Thu, 21 Jul 2016 23:25:47 +0000 (18:25 -0500)]
Merge "res_pjsip: Add fax_detect_timeout endpoint option."

3 years agoCreate Asterisk-14: Update CHANGES and UPGRADE files
George Joseph [Thu, 21 Jul 2016 21:35:39 +0000 (15:35 -0600)]
Create Asterisk-14:  Update CHANGES and UPGRADE files

Change-Id: I35b5f6657670cfa8985796fa1e1fe86ad299efdc

3 years agochan_sip: Prevent deadlock when issuing "sip show channels"
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

3 years agoMerge "pbx: Create pbx_sw.c for management of 'struct ast_sw'."
zuul [Thu, 21 Jul 2016 20:55:10 +0000 (15:55 -0500)]
Merge "pbx: Create pbx_sw.c for management of 'struct ast_sw'."

3 years agoMerge "Add conditional support for noreturn functions."
zuul [Thu, 21 Jul 2016 20:29:22 +0000 (15:29 -0500)]
Merge "Add conditional support for noreturn functions."

3 years agopbx: Create pbx_sw.c for management of 'struct ast_sw'.
Corey Farrell [Sat, 16 Jul 2016 00:28:16 +0000 (20:28 -0400)]
pbx: Create pbx_sw.c for management of 'struct ast_sw'.

This changes context switches from a linked list to a vector, makes
'struct ast_sw' opaque to pbx.c.

Although ast_walk_context_switches is maintained the procedure is no
longer efficient except for the first call (inc==NULL).  This
functionality is replaced by two new functions implemented by vector
macros.
* ast_context_switches_count (AST_VECTOR_SIZE)
* ast_context_switches_get (AST_VECTOR_GET)

As with ast_walk_context_switches callers of these functions are
expected to have locked contexts.  Only a few places in Asterisk walked
the switches, they have been converted to use the new functions.

Change-Id: I08deb016df22eee8288eb03de62593e45a1f0998

3 years agores_pjsip_pubsub: fixed a bug when pjsip_tx_data_dec_ref is called twice.
Alexei Gradinari [Thu, 21 Jul 2016 15:28:36 +0000 (11:28 -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

3 years agores_srtp: Enable AES-256 and AES-GCM.
Alexander Traud [Wed, 13 Jul 2016 10:24:46 +0000 (12:24 +0200)]
res_srtp: Enable AES-256 and AES-GCM.

ASTERISK-26190 #close

Change-Id: I11326d80edd656524a51a19450e586c583aa0a0b

3 years agoMerge "Makefile: Retain XML Declaration and DTD in docs."
zuul [Wed, 20 Jul 2016 16:36:08 +0000 (11:36 -0500)]
Merge "Makefile: Retain XML Declaration and DTD in docs."

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

3 years agoMerge "pbx: Create pbx_ignorepat.c for management of 'struct ast_ignorepat'."
zuul [Wed, 20 Jul 2016 15:57:41 +0000 (10:57 -0500)]
Merge "pbx: Create pbx_ignorepat.c for management of 'struct ast_ignorepat'."

3 years agoMerge "res_rtp_asterisk: Count a roll-over of the sequence number even on lost packets."
zuul [Wed, 20 Jul 2016 15:29:19 +0000 (10:29 -0500)]
Merge "res_rtp_asterisk: Count a roll-over of the sequence number even on lost packets."

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

3 years agoAdd conditional support for noreturn functions.
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

3 years agoMerge "Makefile: Suppress echoing of target 'config' again."
zuul [Tue, 19 Jul 2016 22:35:59 +0000 (17:35 -0500)]
Merge "Makefile: Suppress echoing of target 'config' again."

3 years agochan_dahdi.c: Fix deadlock potential in fax redirection.
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

3 years agochan_sip.c: Fix deadlock potential in fax redirection.
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

3 years agochan_pjsip.c: Fix deadlock potential in fax redirection.
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

3 years agores_fax.c: Fix deadlock potential in FAXOPT(faxdetect) framehook.
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

3 years agores_fax: Fix FAXOPT(faxdetect) timeout option.
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

3 years agochan_dahdi: Add faxdetect_timeout option.
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

3 years agores_pjsip: Add fax_detect_timeout endpoint option.
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

3 years agoMakefile: Retain XML Declaration and DTD in docs.
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

3 years agoUnit tests: Use AST_TEST_DEFINE in conditional code only.
Corey Farrell [Mon, 18 Jul 2016 23:40:22 +0000 (19:40 -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

3 years agores_pjsip_mwi: remove unneeded check on endpoint's contacts.
Alexei Gradinari [Mon, 18 Jul 2016 14:22:57 +0000 (10:22 -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

3 years agoMerge "pbx: Create pbx_include.c for management of 'struct ast_include'."
Joshua Colp [Mon, 18 Jul 2016 12:07:36 +0000 (07:07 -0500)]
Merge "pbx: Create pbx_include.c for management of 'struct ast_include'."

3 years agores_rtp_asterisk: Count a roll-over of the sequence number even on lost packets.
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

3 years agoMakefile: Suppress echoing of target 'config' again.
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

3 years agopbx: Create pbx_ignorepat.c for management of 'struct ast_ignorepat'.
Corey Farrell [Fri, 15 Jul 2016 07:59:48 +0000 (03:59 -0400)]
pbx: Create pbx_ignorepat.c for management of 'struct ast_ignorepat'.

This changes context ignore patterns from a linked list to a vector,
makes 'struct ast_ignorepat' opaque to pbx.c.

Although ast_walk_context_ignorepats is maintained the procedure is no
longer efficient except for the first call (inc==NULL).  This
functionality is replaced by two new functions implemented by vector
macros.
* ast_context_ignorepats_count (AST_VECTOR_SIZE)
* ast_context_ignorepats_get (AST_VECTOR_GET)

As with ast_walk_context_ignorepats callers of these functions are
expected to have locked contexts.  Only a few places in Asterisk walked
the ignorepats, they have been converted to use the new functions.

Change-Id: I78f2157d275ef1b7d624b4ff7d770d38e5d7f20a

3 years agoMerge "app_queue: Only remove queue member from pending when state changes."
zuul [Fri, 15 Jul 2016 16:57:52 +0000 (11:57 -0500)]
Merge "app_queue: Only remove queue member from pending when state changes."

3 years agopbx: Create pbx_include.c for management of 'struct ast_include'.
Corey Farrell [Thu, 14 Jul 2016 18:51:42 +0000 (14:51 -0400)]
pbx: Create pbx_include.c for management of 'struct ast_include'.

This changes context includes from a linked list to a vector, makes
'struct ast_include' opaque to pbx.c.

Although ast_walk_context_includes is maintained the procedure is no
longer efficient except for the first call (inc==NULL).  This
functionality is replaced by two new functions implemented by vector
macros.
* ast_context_includes_count (AST_VECTOR_SIZE)
* ast_context_includes_get (AST_VECTOR_GET)

As with ast_walk_context_includes callers of these functions are
expected to have locked contexts.  Only a few places in Asterisk walked
the includes, they have been converted to use the new functions.

const have been applied where possible to parameters for ast_include
functions.

Change-Id: Ib5c882e27cf96fb2aec67a39c18b4c71c9c83b60

3 years agofeatures.c: Remove unneeded adsi.h include.
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

3 years agoUpdate support for SILK format.
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