4 years agoBuildSystem: Detect ca_list_path capabilities in external PJProject.
Alexander Traud [Wed, 17 Aug 2016 11:12:19 +0000 (13:12 +0200)]
BuildSystem: Detect ca_list_path capabilities in external PJProject.

Since Asterisk 13.8, pj_ssl_cert_load_from_files2 got detected only in the
bundled PJProject but not in an external PJProject. Therefore, ca_list_path
could not be used in pjsip.conf. With this change, pj_ssl_cert_load_from_files2
is detected again to enable ca_list_path again.

ASTERISK-26303 #close

Change-Id: I4a4a0cdc5cdff33730911fb4cfc0498c069043d0

4 years agoMerge "translate: Enables native Packet-Loss Concealment (PLC) for supporting codecs."
zuul [Tue, 16 Aug 2016 22:29:58 +0000 (17:29 -0500)]
Merge "translate: Enables native Packet-Loss Concealment (PLC) for supporting codecs."

4 years agoRefactor usage pattern of xmldoc info tag.
Corey Farrell [Mon, 15 Aug 2016 20:29:53 +0000 (16:29 -0400)]
Refactor usage pattern of xmldoc info tag.

This updates func_channel.c and main/message.c to use a generic xpointer
include instead of including info from each channel driver.  Now the
name attribute of info is CHANNEL or CHANNEL_EXAMPLES to be included in
documentation for func_channel.  Setting the name attribute of info to
MessageToInfo or MessageFromInfo causes it to be included in the
MessageSend application and AMI action.

Change-Id: I89fd8276a3250824241a618009714267d3a8d1ea

4 years agoMerge "chan_sip: Fix lastrtprx always updated"
Joshua Colp [Tue, 16 Aug 2016 15:26:27 +0000 (10:26 -0500)]
Merge "chan_sip: Fix lastrtprx always updated"

4 years agoMerge "core: Entity ID is not set or invalid"
zuul [Tue, 16 Aug 2016 15:03:20 +0000 (10:03 -0500)]
Merge "core: Entity ID is not set or invalid"

4 years agoMerge "res_sorcery_config.c: Cleanup ao2 container usage idioms."
Joshua Colp [Tue, 16 Aug 2016 13:24:38 +0000 (08:24 -0500)]
Merge "res_sorcery_config.c: Cleanup ao2 container usage idioms."

4 years agoMerge "sorcery.c: Minor optimizations."
Joshua Colp [Tue, 16 Aug 2016 13:24:31 +0000 (08:24 -0500)]
Merge "sorcery.c: Minor optimizations."

4 years agoMerge "sorcery.c: Tweak some container declaration formatting."
Joshua Colp [Tue, 16 Aug 2016 13:24:19 +0000 (08:24 -0500)]
Merge "sorcery.c: Tweak some container declaration formatting."

4 years agoMerge "manager: Add <see-also> tags to relate AoC events and actions"
Joshua Colp [Tue, 16 Aug 2016 10:34:33 +0000 (05:34 -0500)]
Merge "manager: Add <see-also> tags to relate AoC events and actions"

4 years agoMerge "res_agi: Improve documentation"
Joshua Colp [Tue, 16 Aug 2016 10:34:10 +0000 (05:34 -0500)]
Merge "res_agi: Improve documentation"

4 years agoMerge "func_channel: Reorganize documentation"
Joshua Colp [Tue, 16 Aug 2016 10:33:34 +0000 (05:33 -0500)]
Merge "func_channel: Reorganize documentation"

4 years agoMerge "pbx.c: Additional fixes to ast_context_remove_extension_callerid2."
Joshua Colp [Tue, 16 Aug 2016 10:32:30 +0000 (05:32 -0500)]
Merge "pbx.c: Additional fixes to ast_context_remove_extension_callerid2."

4 years agoMerge "manager: Add <see-also> links between related events"
zuul [Tue, 16 Aug 2016 05:26:26 +0000 (00:26 -0500)]
Merge "manager: Add <see-also> links between related events"

4 years agoMerge "manager: Add <see-also> tags to relate UserEvent actions/apps/events"
zuul [Tue, 16 Aug 2016 03:47:32 +0000 (22:47 -0500)]
Merge "manager: Add <see-also> tags to relate UserEvent actions/apps/events"

4 years agoMerge "manager: Add <see-also> tags to relate Bridge related events,actions, and...
Joshua Colp [Tue, 16 Aug 2016 00:17:46 +0000 (19:17 -0500)]
Merge "manager: Add <see-also> tags to relate Bridge related events,actions, and apps"

4 years agoMerge "manager: Add <see-also> tags to relate interrelated events/actions together"
zuul [Mon, 15 Aug 2016 23:36:44 +0000 (18:36 -0500)]
Merge "manager: Add <see-also> tags to relate interrelated events/actions together"

4 years agoMerge "app_dial: Improve documentation"
Joshua Colp [Mon, 15 Aug 2016 22:21:23 +0000 (17:21 -0500)]
Merge "app_dial: Improve documentation"

4 years agochan_sip: Fix lastrtprx always updated
cjack [Wed, 15 Jun 2016 22:10:11 +0000 (01:10 +0300)]
chan_sip: Fix lastrtprx always updated

Packets are read regulary, when there is no data in buffer fr->frametype
is AST_FRAME_NULL. There was no check of frametype and lastrtprx always
updated and, therefore, rtptimeout did not work at all.

ASTERISK-25270 #close

Change-Id: If3b5ca0dbb822582a86eb7d01dcae4e83448c41d

4 years agocore: Entity ID is not set or invalid
Alexei Gradinari [Wed, 10 Aug 2016 19:41:38 +0000 (15:41 -0400)]
core: Entity ID is not set or invalid

The Exchanging Device and Mailbox States could not working
if the Entity ID (EID) is not set manually and can't be obtained
from ethernet interface.

This patch replaces debug message to warning
and addes missing description about option 'entityid' to

With this patch the asterisk also:
(1) decline loading the modules which won't work without EID:
    res_corosync and res_pjsip_publish_asterisk.
(2) warn if EID is empty on loading next modules:
    pbx_dundi, res_xmpp

Starting with v197 systemd/udev will automatically assign "predictable"
names for all local Ethernet interfaces.
This patch also addes some new ethernet prefixes "eno" and "ens".

ASTERISK-26164 #close

Change-Id: I72d712f1ad5b6f64571bb179c5cb12461e7c58c6

4 years agores_sorcery_config.c: Cleanup ao2 container usage idioms.
Richard Mudgett [Fri, 5 Aug 2016 01:00:59 +0000 (20:00 -0500)]
res_sorcery_config.c: Cleanup ao2 container usage idioms.

Change-Id: Iad24b335fb121a2bc7f1d048ab7420569edcba5a

4 years agosorcery.c: Minor optimizations.
Richard Mudgett [Thu, 4 Aug 2016 20:57:12 +0000 (15:57 -0500)]
sorcery.c: Minor optimizations.

* Remove some unused parameters from internal functions:

* Created the struct sorcery_observer_invocation ao2 object without a lock
since it is not needed in sorcery_observer_invocation_alloc().

* Cleanup generic ao2 container sorcery object id hash, sort, and cmp

Change-Id: Iff71d75f52bc1b8cee955456838c149faaa4f92e

4 years agosorcery.c: Tweak some container declaration formatting.
Richard Mudgett [Mon, 1 Aug 2016 16:04:33 +0000 (11:04 -0500)]
sorcery.c: Tweak some container declaration formatting.

* Tweak sorcery_object_type_alloc() formatting.
* Tweak ast_sorcery_init() formatting.

Change-Id: Ib02430023f15268cd7a2ea53f2c331213e4d3944

4 years agopbx.c: Additional fixes to ast_context_remove_extension_callerid2.
Corey Farrell [Fri, 12 Aug 2016 04:30:27 +0000 (00:30 -0400)]
pbx.c: Additional fixes to ast_context_remove_extension_callerid2.

Do not check registrar of the first extension head.  We should only check
the registrar when we match the priority.

Additionally fix a couple calls to strcmp which used the input callerid
instead of the clean version ex.cidmatch.


Change-Id: I17ea6881a18f40840ae9c1f5394aab1fbb3769f1

4 years agoapp_dial: Improve documentation
Matt Jordan [Sun, 14 Aug 2016 03:02:24 +0000 (22:02 -0500)]
app_dial: Improve documentation

* Add some helpful <literal> and other embedded paragraph tags

* Document some of the lesser known channel variables set by Dial

* Add examples for some common Dial uses, along with some more
  challenging but useful options

Change-Id: Ib2fb9301e8e044d14fbb2815ec64161f19bbfbc1

4 years agomanager: Add <see-also> tags to relate interrelated events/actions together
Matt Jordan [Sun, 14 Aug 2016 01:16:58 +0000 (20:16 -0500)]
manager: Add <see-also> tags to relate interrelated events/actions together

Change-Id: Idbac539205aa732bf786c4f765577d8e9ff28ba4

4 years agomanager: Add <see-also> tags to relate Bridge related events,actions, and apps
Matt Jordan [Sun, 14 Aug 2016 01:15:58 +0000 (20:15 -0500)]
manager: Add <see-also> tags to relate Bridge related events,actions, and apps

Change-Id: I67e6b79fa3102e494b5fe6cc7510472249080e85

4 years agomanager: Add <see-also> tags to relate AoC events and actions
Matt Jordan [Sun, 14 Aug 2016 01:14:50 +0000 (20:14 -0500)]
manager: Add <see-also> tags to relate AoC events and actions

Change-Id: Iea89a36222712148c1775c05ed0ad1049d67a70e

4 years agomanager: Add <see-also> tags to relate UserEvent actions/apps/events
Matt Jordan [Sun, 14 Aug 2016 01:13:53 +0000 (20:13 -0500)]
manager: Add <see-also> tags to relate UserEvent actions/apps/events

Change-Id: I80f8a981f62f50e74609c69c49edcaca6c95efa4

4 years agores_agi: Improve documentation
Matt Jordan [Fri, 12 Aug 2016 20:53:52 +0000 (15:53 -0500)]
res_agi: Improve documentation

* Groups of AGI commands that have similar functionality now reference
  each other, and all reference the AGI application for ease of wiki

* The documentation for the AGI application has been improved, in
  particular noting the various AGI types and how they are invoked.

* A warning message has been added to DeadAGI, noting that it is

Change-Id: I479ccdee8a7393f01b18692c3d4ab7e6bdd1875d

4 years agomanager: Add <see-also> links between related events
Matt Jordan [Fri, 12 Aug 2016 18:53:41 +0000 (13:53 -0500)]
manager: Add <see-also> links between related events

This patch adds some see-also references between related AMI events. It
focuses primarily on those events that are guaranteed to come in pairs,
such as DTMFBegin/DTMFEnd, as well as those that occur during the life
cycle of an Asterisk channel, such as Newchannel/Hangup.

Change-Id: Iaab600477052018d0f8c03d0c624c0856e9ff1f3

4 years agofunc_channel: Reorganize documentation
Matt Jordan [Fri, 12 Aug 2016 16:15:38 +0000 (11:15 -0500)]
func_channel: Reorganize documentation

* Following the example of the PJSIP channel driver, the channel
  technology specific documentation has been moved to the respective
  channel drivers that provide that functionality. This has the benefit
  of locating the documentation of items with those modules that provide

* Examples of using the CHANNEL function for both standard items as well
  as for PJSIP have been added.

* The 'max_forwards' standard item has been documented.

Change-Id: Ifaa79a232c8ac99cf8da6ef6cc7815d398b1b79b

4 years agomanager: Clarify that dialplan manipulation actions are under system class.
Joshua Colp [Mon, 15 Aug 2016 12:17:51 +0000 (12:17 +0000)]
manager: Clarify that dialplan manipulation actions are under system class.

ASTERISK-26246 #close

Change-Id: Id673b9786389f9d2a87f638ce1a25161f5f31657

4 years agoMerge "res_pjsip: Fail global load if debug or default_from_user are empty"
Joshua Colp [Fri, 12 Aug 2016 22:38:14 +0000 (17:38 -0500)]
Merge "res_pjsip:  Fail global load if debug or default_from_user are empty"

4 years agoMerge "res_pjsip_caller_id: Copy header name to short header name"
zuul [Fri, 12 Aug 2016 21:08:45 +0000 (16:08 -0500)]
Merge "res_pjsip_caller_id:  Copy header name to short header name"

4 years agoMerge "Run mandatory cleanup when startup fails."
zuul [Fri, 12 Aug 2016 18:34:10 +0000 (13:34 -0500)]
Merge "Run mandatory cleanup when startup fails."

4 years agoMerge "location.c: Misc fixes and cleanups."
Joshua Colp [Fri, 12 Aug 2016 17:08:57 +0000 (12:08 -0500)]
Merge "location.c: Misc fixes and cleanups."

4 years agoMerge "app_queue: Prevent crash when a call is forwarded to an invalid location"
Joshua Colp [Fri, 12 Aug 2016 15:50:34 +0000 (10:50 -0500)]
Merge "app_queue: Prevent crash when a call is forwarded to an invalid location"

4 years agoMerge "taskprocessor.c: Tweak high water checks."
Joshua Colp [Fri, 12 Aug 2016 09:47:51 +0000 (04:47 -0500)]
Merge "taskprocessor.c: Tweak high water checks."

4 years agoMerge "res_pjsip res_pjsip_mwi: Misc fixes and cleanups."
Joshua Colp [Fri, 12 Aug 2016 09:46:10 +0000 (04:46 -0500)]
Merge "res_pjsip res_pjsip_mwi: Misc fixes and cleanups."

4 years agoMerge "pjsip_distributor.c: Add missing allocation failure check."
zuul [Fri, 12 Aug 2016 08:46:22 +0000 (03:46 -0500)]
Merge "pjsip_distributor.c: Add missing allocation failure check."

4 years agoMerge "alembic: add auth_username to endpoint's identify_by enum"
zuul [Fri, 12 Aug 2016 04:58:48 +0000 (23:58 -0500)]
Merge "alembic: add auth_username to endpoint's identify_by enum"

4 years agoMerge "res_pjsip: Make aor named lock a mutex."
zuul [Fri, 12 Aug 2016 04:27:15 +0000 (23:27 -0500)]
Merge "res_pjsip: Make aor named lock a mutex."

4 years agoRun mandatory cleanup when startup fails.
Corey Farrell [Fri, 12 Aug 2016 03:12:32 +0000 (23:12 -0400)]
Run mandatory cleanup when startup fails.

Errors during startup result in an exit.  These error branches should be
calling ast_run_atexit(0) to ensure mandatory cleanup is run.

ASTERISK-26267 #close

Change-Id: If226f2326ae2df7add20040696132214cf2bb680

4 years agoMerge "res_odbc: Show only when there a fail attempt of connection in CLI"
zuul [Fri, 12 Aug 2016 02:04:35 +0000 (21:04 -0500)]
Merge "res_odbc: Show only when there a fail attempt of connection in CLI"

4 years agoMerge "cdr_adaptive_odbc: Fix DNSs mixed config quote quoted_identifiers"
Joshua Colp [Thu, 11 Aug 2016 23:24:10 +0000 (18:24 -0500)]
Merge "cdr_adaptive_odbc: Fix DNSs mixed config quote quoted_identifiers"

4 years agoMerge "autohints: Update CHANGES and extensions.conf.sample"
Joshua Colp [Thu, 11 Aug 2016 21:10:54 +0000 (16:10 -0500)]
Merge "autohints:  Update CHANGES and extensions.conf.sample"

4 years agoMerge "Fixed compile flags for non-module libs"
Joshua Colp [Thu, 11 Aug 2016 21:09:59 +0000 (16:09 -0500)]
Merge "Fixed compile flags for non-module libs"

4 years agores_pjsip_caller_id: Copy header name to short header name
George Joseph [Thu, 11 Aug 2016 16:24:34 +0000 (10:24 -0600)]
res_pjsip_caller_id:  Copy header name to short header name

When compact_headers was set, we were sending a zero-length header name
for PAI and RPID because we always forced the short header name length
to 0.  We did this because we cloned the header from "From" and wanted
to clear "f" from the sname.  By cloning however, we bypass pjproject's
automatic logic that sets sname to name if there's no compact form of
the header, which there isn't for PAI and RPID.  So now we force sname
to be the same as name right after we set name.

res_pjsip_diversion needed the same treatment for the Diversion header.

ASTERISK-26241 #close

Change-Id: I633ec139630cd83809aae00336cee4a10077e467

4 years agoapp_queue: Prevent crash when a call is forwarded to an invalid location
Matt Jordan [Thu, 11 Aug 2016 16:13:07 +0000 (11:13 -0500)]
app_queue: Prevent crash when a call is forwarded to an invalid location

When a call forward attempt is made from a Queue member, the current
code will hang up the forwarding channel in an off-nominal condition
prior to raising the Stasis events informing the rest of Asterisk that
the call was forwarded. This will result in a slew of dreaded FRACKs,
most likely leading to a crash.

This patch modifies the code such that we don't hang up the forwarding
channel even in an off-nominal condition until we've safely raised the
Stasis messages.

ASTERISK-25797 #close

Change-Id: Ife5abed351691fd79105321636eaa8ea8dcdba38

4 years agoMerge "res_resolver_unbound: Allow compilation with libunbound version < 1.5"
zuul [Thu, 11 Aug 2016 18:49:45 +0000 (13:49 -0500)]
Merge "res_resolver_unbound:  Allow compilation with libunbound version < 1.5"

4 years agores_pjsip: Fail global load if debug or default_from_user are empty
George Joseph [Thu, 11 Aug 2016 17:18:15 +0000 (11:18 -0600)]
res_pjsip:  Fail global load if debug or default_from_user are empty

If debug was specified in the global configuration but left blank,
the logger would treat it as a wildcard and log all hosts.  If
default_from_user was empty, a crash would result.

The global apply handler now checks for empty strings.

ASTERISK-26239 #close
ASTERISK-26238 #close

Change-Id: Ie75727f5cd5808845d92cc81f5713842fb203336

4 years agores_pjsip res_pjsip_mwi: Misc fixes and cleanups.
Richard Mudgett [Mon, 1 Aug 2016 20:07:30 +0000 (15:07 -0500)]
res_pjsip res_pjsip_mwi: Misc fixes and cleanups.

* Eliminated RAII_VAR() usage in

* Added a missing allocation failure check to

* Made persistent_endpoint_find_or_create() create the new object without
a lock as it isn't needed.

* Cleaned up some ao2 container allocation idioms.

* Reordered res_pjsip_mwi.c load_module() and unload_module()

Change-Id: If8ce88fbd82a0c72a37a2388f74f77237a6a36a8

4 years agolocation.c: Misc fixes and cleanups.
Richard Mudgett [Thu, 4 Aug 2016 23:03:56 +0000 (18:03 -0500)]
location.c: Misc fixes and cleanups.

* Eliminated most RAII_VAR() usage.

* Added several missing allocation failure checks.

* Made ast_sip_for_each_contact() allocate the wrapper ao2 object without
a lock as it is not needed.

Change-Id: Ie20913365156c95dd79e5d471cfd25e99ae880bc

4 years agoautohints: Update CHANGES and extensions.conf.sample
George Joseph [Thu, 11 Aug 2016 17:01:33 +0000 (11:01 -0600)]
autohints:  Update CHANGES and extensions.conf.sample

Make it clear that we're talking about device state hints and add
an entry to the sample config.

Change-Id: Iaef58ffb960191a21b713e8e0b51ce1fcd47e433

4 years agotaskprocessor.c: Tweak high water checks.
Richard Mudgett [Tue, 2 Aug 2016 18:53:35 +0000 (13:53 -0500)]
taskprocessor.c: Tweak high water checks.

* The high water check in ast_taskprocessor_alert_set_levels() would
trigger immediately if the new high water level is zero and the queue was

* The high water check in taskprocessor_push() was off by one.

Change-Id: I687729fb4efa6a0ba38ec9c1c133c4d407bc3d5d

4 years agores_pjsip: Make aor named lock a mutex.
Richard Mudgett [Wed, 3 Aug 2016 21:24:39 +0000 (16:24 -0500)]
res_pjsip: Make aor named lock a mutex.

The named aor lock was always being locked for writes so a rwlock adds no
benefit and may be slower because rwlocks are biased toward read locking.

Change-Id: I8c5c2c780eb30ce5441832257beeb3506fd12b28

4 years agopjsip_distributor.c: Add missing allocation failure check.
Richard Mudgett [Fri, 29 Jul 2016 22:41:15 +0000 (17:41 -0500)]
pjsip_distributor.c: Add missing allocation failure check.

Change-Id: I932ab2cea845e534d9ff318035b6de39972d3b28

4 years agoMerge "channels/chan_pjsip: Add PJSIP_SEND_SESSION_REFRESH"
zuul [Thu, 11 Aug 2016 16:43:22 +0000 (11:43 -0500)]
Merge "channels/chan_pjsip: Add PJSIP_SEND_SESSION_REFRESH"

4 years agoFixed compile flags for non-module libs
David M. Lee [Thu, 11 Aug 2016 15:50:09 +0000 (10:50 -0500)]
Fixed compile flags for non-module libs

The non-module libs libasteriskssl.dylib and libasteriskpj.dylib have
long been missing the AST_NOT_MODULE compile flag. This was mostly
okay, until a recent fix to improve compiler warnings when the
AST_MODULE_SELF_SYM is missing broke the build on OS X/macOS/whatever
they are calling it these days.

Change-Id: I2cb51c890824f001280a5114f2e775f97c163516

4 years agoalembic: add auth_username to endpoint's identify_by enum
Kevin Harwell [Thu, 11 Aug 2016 15:50:09 +0000 (10:50 -0500)]
alembic: add auth_username to endpoint's identify_by enum

A new identify_by option was added recently, auth_username. However, this
setting was not added as an allowable choice in the database enumeration

This patch updates the current enumeration, adding in the new setting.

ASTERISK-26268 #close

Change-Id: Ib4788e8485e4cd40172ec0abbf5810a147ab8bf8

4 years agoMerge "res_srtp: Move SDP SRTP code from the core to res_srtp."
zuul [Thu, 11 Aug 2016 11:19:33 +0000 (06:19 -0500)]
Merge "res_srtp: Move SDP SRTP code from the core to res_srtp."

4 years agoMerge "alembic/sqlalchemy: auto increment only allowed on a single column"
zuul [Thu, 11 Aug 2016 02:00:42 +0000 (21:00 -0500)]
Merge "alembic/sqlalchemy: auto increment only allowed on a single column"

4 years agores_srtp: Move SDP SRTP code from the core to res_srtp.
Richard Mudgett [Mon, 8 Aug 2016 19:50:53 +0000 (14:50 -0500)]
res_srtp: Move SDP SRTP code from the core to res_srtp.

A patch made to the master branch (Now the 14 branch) inadvertently made
libsrtp a required dependency in order to compile Asterisk.  Rather than
create dummy defines to substitute for the defines supplied by libsrtp
when libsrtp is not available, most of the code in sdp_srtp.c is moved
into res_srtp.c.  This gets more code out of Asterisk's core that isn't
used when SRTP is not available.  This also makes another inadvertent
required dependency on libsrtp by Asterisk's core unlikely.

ASTERISK-26253 #close
Reported by: Ben Merrills

Change-Id: I0a46cde81501c0405399c2588633ae32706d1ee7

4 years agopjsip: Fix deadlock with suspend taskprocessor on masquerade
Alexei Gradinari [Sat, 6 Aug 2016 15:57:08 +0000 (11:57 -0400)]
pjsip: Fix deadlock with suspend taskprocessor on masquerade

If both channels which should be masqueraded
are in the same serializer:
1st channel will be locked waiting condition 'complete'
2nd channel will be locked waiting condition 'suspended'

On heavy load system a chance that both channels will be in
the same serializer 'pjsip/distibutor' is very high.

To reproduce compile res_pjsip/pjsip_distributor.c with

Steps to reproduce:
1. Party A calls Party B (bridged call 'AB')
2. Party B places Party A on hold
3. Party B calls Voicemail app (non-bridged call 'BV')
4. Party B attended transfers Party A to voicemail using REFER.
5. When asterisk masquerades calls 'AB' and 'BV',
   a deadlock is happened.

This patch adds a suspension indicator to the taskprocessor.
When a session suspends/unsuspends the serializer
it sets the indicator to the appropriate state.
The session checks the suspension indicator before
suspend the serializer.

ASTERISK-26145 #close

Change-Id: Iaaebee60013a58c942ba47b1b4930a63e686663b

4 years agoalembic/sqlalchemy: auto increment only allowed on a single column
Kevin Harwell [Tue, 9 Aug 2016 17:07:20 +0000 (12:07 -0500)]
alembic/sqlalchemy: auto increment only allowed on a single column

The extensions table defined two columns (id and priority) as primary key
autoincrement columns. However only one is allowed when defining the primary

This patch removes the autoincrement attribute from the priority column since
it does not need to be as such and really should not have been on there in the
first place.

This patch also removes 'context', 'exten', and 'priority' from the primary key
index and creates a new combined unique contraint index on them.

ASTERISK-26183 #close

Change-Id: Ib9c712c612a4d7ec1edb0dcb77f1bae0905a470b

4 years agores_resolver_unbound: Allow compilation with libunbound version < 1.5
George Joseph [Wed, 10 Aug 2016 16:47:32 +0000 (10:47 -0600)]
res_resolver_unbound:  Allow compilation with libunbound version < 1.5

libunbound at version 1.4.20 (which CentOS still uses) declared all
of their string function parameters as as 'char *'.  1.4.21 changed
them all to 'const char *'.  Thankfully 1.4.21 also introduced the
UNBOUND_VERSION_MAJOR define so configure now checks for that and
sets HAVE_UNBOUND_CONST_PARAMS.  res_resolver_unbound then checks
that and casts away the 'const' if it's not set.

Tested compile and testsuite on CentOS6 (1.4.20), Ubuntu14 (1.4.22) and
Fedora24 (1.5.4).  There are a few failing tests to be addressed though.

ASTERISK-26283 #close

Change-Id: Ib708b19b706c5d0ba7b7d5473e6df339d9ae4148

4 years agochannels/chan_pjsip: Add PJSIP_SEND_SESSION_REFRESH
Matt Jordan [Sun, 7 Aug 2016 14:58:59 +0000 (09:58 -0500)]
channels/chan_pjsip: Add PJSIP_SEND_SESSION_REFRESH

This patch adds a new PJSIP specific dialplan function,
PJSIP_SEND_SESSION_REFRESH. When invoked on a PJSIP channel, the media
session will be refreshed via either an UPDATE or re-INVITE request.
When used in conjunction with the PJSIP_MEDIA_OFFER dialplan function,
the formats in use on a PJSIP channel can be re-negotiated and changed
dynamically after call setup.

ASTERISK-26277 #close

Change-Id: Ib98fe09ba889aafe26d58d32f0fd1323f8fd9b1b
(cherry picked from commit eec60dd77394f0519895fc6abce3a6f90f6470f1)

4 years agoMerge "res_rtp_asterisk: Cache local RTCP address."
zuul [Wed, 10 Aug 2016 15:22:49 +0000 (10:22 -0500)]
Merge "res_rtp_asterisk: Cache local RTCP address."

4 years agoMerge "Produce friendly error when AST_MODULE_SELF_SYM is not defined."
zuul [Wed, 10 Aug 2016 00:09:37 +0000 (19:09 -0500)]
Merge "Produce friendly error when AST_MODULE_SELF_SYM is not defined."

4 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"

4 years agores_rtp_asterisk: Cache local RTCP address.
Mark Michelson [Tue, 9 Aug 2016 21:19:34 +0000 (16:19 -0500)]
res_rtp_asterisk: Cache local RTCP address.

When an RTCP packet is sent or received, res_rtp_asterisk generates a
Stasis event that contains the RTCP report as well as the local and
remote addresses that the report pertains to.

The addresses are determined using ast_find_ourip(). For the local
address, this will typically result in a lookup of the hostname of the
server, and then a DNS lookup of that hostname. If you do not have the
host in /etc/hosts, then this results in a full DNS lookup, which can
potentially block for some time.

This is especially problematic when performing RTCP reads, since those
are done on the same thread responsible for reading and writing media.

This patch addresses the issue by performing a lookup of the local
address when RTCP is allocated. We then use this cached local address
for the Stasis events when necessary.

ASTERISK-26280 #close
Reported by Mark Michelson

Change-Id: I3dd61882c2e57036f09f0c390cf38f7c87e9b556

4 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."

4 years agoProduce friendly error when AST_MODULE_SELF_SYM is not defined.
Corey Farrell [Tue, 9 Aug 2016 00:14:20 +0000 (20:14 -0400)]
Produce friendly error when AST_MODULE_SELF_SYM is not defined.

Modules must define AST_MODULE_SELF_SYM to be used as the name of a
generated function.  This produces a friendly error when it's not

ASTERISK-26278 #close

Change-Id: Ib9d35a08104529c516d636771365e02c6e77a45b

4 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

4 years agores_odbc: Show only when there a fail attempt of connection in CLI
Rodrigo Ramírez Norambuena [Sat, 6 Aug 2016 06:37:35 +0000 (02:37 -0400)]
res_odbc: Show only when there a fail attempt of connection in CLI

When is executed CLI command "odbc show all" every time is show
information about variable last_negative_connect. If not there  a fail
attempt of connection will show date like "1969-12-31 21:00:00".

This patch fix there situation for to show only this information when
exists a fail attempt before.

Change-Id: I7c058b0be6f7642e922de75ee6b82c7276c9f113

4 years agocdr_adaptive_odbc: Fix DNSs mixed config quote quoted_identifiers
Rodrigo Ramírez Norambuena [Sat, 6 Aug 2016 03:06:53 +0000 (23:06 -0400)]
cdr_adaptive_odbc: Fix DNSs mixed config quote quoted_identifiers

When haved more than once DNSs config and one of their dont set
quoted_identifiers and before this is with configurated with
quoted_identifiers resulting a truncate statement for a reference null
for quote character identifier.

This patch initializes quoted flag before build SQL Query

Example config for this bugfix case in cdr_adaptive_odbc.conf file




Change-Id: Ibd95667b468e10d4a19a2b9d88b9934ec7207e1d

4 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

4 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

4 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

4 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

4 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

4 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."

4 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"

4 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."

4 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"

4 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

4 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

4 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

4 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."

4 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."

4 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"

4 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, 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

4 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"

4 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."

4 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

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

4 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

4 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."

4 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."

4 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."