4 years agoMerge "netsock.c: fix includes for HURD"
Joshua Colp [Wed, 2 Nov 2016 10:24:21 +0000 (05:24 -0500)]
Merge "netsock.c: fix includes for HURD"

4 years agoMerge "bundled pjproject: Fix DNS write to freed memory."
zuul [Wed, 2 Nov 2016 06:21:45 +0000 (01:21 -0500)]
Merge "bundled pjproject: Fix DNS write to freed memory."

4 years agoMerge "pjproject_bundled: Fix compile of pjsua so it handles audio"
zuul [Wed, 2 Nov 2016 02:15:08 +0000 (21:15 -0500)]
Merge "pjproject_bundled:  Fix compile of pjsua so it handles audio"

4 years agoMerge "codecs.conf.sample: Add sample and option descriptions for codec_opus"
Joshua Colp [Tue, 1 Nov 2016 23:58:28 +0000 (18:58 -0500)]
Merge "codecs.conf.sample: Add sample and option descriptions for codec_opus"

4 years agoMerge "res_pjsip_outbound_publish: Fix crash when publishing device state."
Joshua Colp [Tue, 1 Nov 2016 23:32:54 +0000 (18:32 -0500)]
Merge "res_pjsip_outbound_publish: Fix crash when publishing device state."

4 years agoMerge "res/stasis: Add CLI commands for displaying/debugging ARI apps"
Joshua Colp [Tue, 1 Nov 2016 21:05:03 +0000 (16:05 -0500)]
Merge "res/stasis: Add CLI commands for displaying/debugging ARI apps"

4 years agobundled pjproject: Fix DNS write to freed memory.
Richard Mudgett [Tue, 1 Nov 2016 18:13:13 +0000 (13:13 -0500)]
bundled pjproject: Fix DNS write to freed memory.

PJPROJECT 2.5.5 introduced a race condition with the -r5349 IPv6 DNS

The patch below fixes a write to freed memory under cartain DNS lookup


Reported by:  Richard Mudgett

Change-Id: Ifdfae9ecf1e41b53080f33aab44ce1a220f349c5

4 years agoMerge "chan_sip: Incorrect display option Outbound reg. retry 403"
zuul [Tue, 1 Nov 2016 19:09:00 +0000 (14:09 -0500)]
Merge "chan_sip: Incorrect display option Outbound reg. retry 403"

4 years agocodecs.conf.sample: Add sample and option descriptions for codec_opus
Kevin Harwell [Mon, 31 Oct 2016 22:35:47 +0000 (17:35 -0500)]
codecs.conf.sample: Add sample and option descriptions for codec_opus

codecs.conf.sample was missing codec opus's configuration options, descriptions,
and examples. This patch adds the configuration options and examples to
codecs.conf.sample that can be used with codec_opus.

ASTERISK-26538 #close

Change-Id: I1d89bb5e01d3e3b5bd78951b8dd0ff077a83dc8b

4 years agores/stasis: Add CLI commands for displaying/debugging ARI apps
Matt Jordan [Thu, 20 Oct 2016 12:27:21 +0000 (07:27 -0500)]
res/stasis: Add CLI commands for displaying/debugging ARI apps

This patch adds three new CLI commands:
 - ari show apps: list the registered ARI applications
 - ari show app: show detailed information about an ARI application
 - ari set debug: dump events being sent to an ARI application

Note that while these CLI commands live in the res_stasis module, we use
the 'ari' family for these commands. This was done as most users of
Asterisk aren't aware of the semantic differences between ARI and
res_stasis, and some 'ari' CLI commands already exist.

ASTERISK-26488 #close

Change-Id: I51ad6ff0cabee0d69db06858c13f18b1c513c9f5

4 years agochan_sip: Incorrect display option Outbound reg. retry 403
Grachev Sergey [Tue, 1 Nov 2016 13:32:35 +0000 (16:32 +0300)]
chan_sip: Incorrect display option Outbound reg. retry 403

If in sip.conf (general section) set option register_retry_403=no,
the command "sip show settings" return value:
Outbound reg. retry 403:0
If in sip.conf (general section) set option register_retry_403=yes,
the command "sip show settings" return value:
Outbound reg. retry 403:-1

* In static char "sip show settings" for "Outbound.reg. retry 403"
option use AST_CLI_YESNO

ASTERISK-26476 #close

Change-Id: I3c14272f05f1067bd2aeaa8b3ef9cf8fcb12dcf9

4 years agonetsock.c: fix includes for HURD
Tzafrir Cohen [Tue, 1 Nov 2016 09:18:49 +0000 (11:18 +0200)]
netsock.c: fix includes for HURD


Change-Id: I43bf94d2d36d3d8a8d0df40cd6c027d65a462814

4 years agopjproject_bundled: Fix compile of pjsua so it handles audio
George Joseph [Mon, 31 Oct 2016 21:12:57 +0000 (15:12 -0600)]
pjproject_bundled:  Fix compile of pjsua so it handles audio

In order for pjsua and its python binding to actually negotiate
audio for the testsuite tests, it needs g711 and resample.  The
pj* libraries themselves do not.  Unfortunately, pjproject relies
on a brand new libresample that most distros don't ship so we need
to use the libresample already bundled with pjproject.  Only the pjsua
executable and the python library are linked with it so it
shouldn't interfere with asterisk itself.

Also it was pointed out that apply_patches couldn't handle multiple
patches that depended on each other during the dry-run, so the
dry-run was removed.

Change-Id: I24f397462b486dcdde0dcafe40e6c55a6593f098

4 years agomanager: Add documentation for NewConnectedLine event.
Etienne Lessard [Mon, 31 Oct 2016 18:46:54 +0000 (14:46 -0400)]
manager: Add documentation for NewConnectedLine event.

The NewConnectedLine event has been added by commit fe7671f, but the
documentation was missing.

ASTERISK-26537 #close

Change-Id: I7fc331f18caa28492da9303e576f70884ca8c9e6

4 years agoMerge "bundled pjproject: Crashes while resolving DNS names."
zuul [Mon, 31 Oct 2016 17:44:45 +0000 (12:44 -0500)]
Merge "bundled pjproject: Crashes while resolving DNS names."

4 years agoMerge "astobj2: Declare private variable data_size for AO2_DEBUG only."
zuul [Mon, 31 Oct 2016 16:35:16 +0000 (11:35 -0500)]
Merge "astobj2: Declare private variable data_size for AO2_DEBUG only."

4 years agovector: Prevent NULL argument to memcpy.
Corey Farrell [Sun, 30 Oct 2016 18:33:12 +0000 (14:33 -0400)]
vector: Prevent NULL argument to memcpy.

Headers declare that memcpy does not accept NULL argument for the first
two parameters.  Add a conditional block to prevent memcpy and ast_free
from running on vectors with NULL element array.

ASTERISK-26526 #close

Change-Id: I988a476bb5fcfcbd3f6d6c6b3e7769e4f9629b71

4 years agoastobj2: Declare private variable data_size for AO2_DEBUG only.
Corey Farrell [Sat, 29 Oct 2016 15:19:53 +0000 (11:19 -0400)]
astobj2: Declare private variable data_size for AO2_DEBUG only.

Every ao2 object contains storage for a private variable data_size,
though the value is never read if AO2_DEBUG is disabled.  This change
makes the variable conditional, reducing memory usage.

ASTERISK-26524 #close

Change-Id: If859929e507676ebc58b0f84247a4231e11da07f

4 years agobundled pjproject: Crashes while resolving DNS names.
Richard Mudgett [Fri, 28 Oct 2016 19:55:08 +0000 (14:55 -0500)]
bundled pjproject: Crashes while resolving DNS names.

PJPROJECT 2.5.5 introduced a race condition with the -r5349 IPv6 DNS

The patches below fix the DNS lookup race condition crash caused by
attempting to send the same message twice for the single DNS lookup.


The patch below removes a cached DNS response from the hash table when
another thread is referencing the old entry.  The table still contained
the entry when it was destroyed which can result in inexplicable crashes.


ASTERISK-26344 #close
Reported by: Ian Gilmour

ASTERISK-26387 #close
Reported by: Harley Peters

Change-Id: I17fde80359e66f65a91341ceca58d914d0f61cc4

4 years agopjproject_bundled: Fix issue where "/version.mak" wasn't found
George Joseph [Fri, 28 Oct 2016 21:59:19 +0000 (15:59 -0600)]
pjproject_bundled:  Fix issue where "/version.mak" wasn't found

main/Makefile includes third-party/pjproject/build.mak but
doesn't set PJDIR beforehand so "include $(PJDIR)/version.mak"
evaluates to "/version.mak".  Fix is to set PJDIR in main/Makefile
before the include.

Change-Id: I0f7c67d60209049056fe9c4b041bf0463aa95604

4 years agoMerge "Fix shutdown crash caused by modules being left open."
zuul [Fri, 28 Oct 2016 21:21:50 +0000 (16:21 -0500)]
Merge "Fix shutdown crash caused by modules being left open."

4 years agores_pjsip_outbound_publish: Fix crash when publishing device state.
mkrokosz [Fri, 28 Oct 2016 18:30:02 +0000 (14:30 -0400)]
res_pjsip_outbound_publish: Fix crash when publishing device state.

While publishing device state between multiple instances of Asterisk,
a crash will sporadically occur under high CPS which looks to be a
race condition operating on the publisher queue.


Change-Id: I28da25d346deb358eff1d563485cabc433ce1ed6

4 years agoFix shutdown crash caused by modules being left open.
Corey Farrell [Fri, 28 Oct 2016 02:49:43 +0000 (22:49 -0400)]
Fix shutdown crash caused by modules being left open.

It is only safe to run ast_register_cleanup callbacks when all modules
have been unloaded.  Previously these callbacks were run during graceful
shutdown, making it possible to crash during shutdown.

ASTERISK-26513 #close

Change-Id: Ibfa635bb688d1227ec54aa211d90d6bd45052e21

4 years agoSAC documentation: don't specify transports for endpoints and registrations
Rusty Newton [Fri, 28 Oct 2016 14:50:32 +0000 (09:50 -0500)]
SAC documentation: don't specify transports for endpoints and registrations

Removing explicit transport definition for endpoints and registrations. It
isn't necessary and isn't generally advised.

ASTERISK-26514 #close

Change-Id: Ifdec5e631962438a4683600968dfa4bfd15909fb

4 years agoMerge "Remove ASTERISK_REGISTER_FILE."
zuul [Fri, 28 Oct 2016 03:23:00 +0000 (22:23 -0500)]

4 years agoMerge "res_pjsip_sdp_rtp: Fix address family of explicit media_address."
zuul [Fri, 28 Oct 2016 03:22:57 +0000 (22:22 -0500)]
Merge "res_pjsip_sdp_rtp: Fix address family of explicit media_address."

4 years agoMerge "pjsip: Fix a few media bugs with reinvites and asymmetric payloads."
Joshua Colp [Fri, 28 Oct 2016 00:37:47 +0000 (19:37 -0500)]
Merge "pjsip: Fix a few media bugs with reinvites and asymmetric payloads."

4 years agoMerge "app_voicemail: Clear voice mailbox in MailboxExists and MAILBOX_EXISTS."
zuul [Thu, 27 Oct 2016 21:48:07 +0000 (16:48 -0500)]
Merge "app_voicemail: Clear voice mailbox in MailboxExists and MAILBOX_EXISTS."

4 years agoMerge "res_pjsip_caller_id: Fix crash on session timers UPDATE on inbound calls."
zuul [Thu, 27 Oct 2016 20:15:35 +0000 (15:15 -0500)]
Merge "res_pjsip_caller_id: Fix crash on session timers UPDATE on inbound calls."

4 years agopjproject_bundled: Remove usage of tar's --strip-components option
George Joseph [Wed, 26 Oct 2016 23:48:24 +0000 (17:48 -0600)]
pjproject_bundled:  Remove usage of tar's --strip-components option

Older versions of tar don't support the --strip-components option so
instead of doing 'tar --strip-components=1 -C source', we now just
untar to the tarball's root directory (pjproject-<version>) and
rename that directory to 'source'.

Also fixed an issue where the pjproject source directory is a hard
coded absolute pathname.

ASTERISK-26510 #close
ASTERISK-22480 #close

Change-Id: I9ec92952507a91ff4e4d01e0149e09fd8e8f32b0

Corey Farrell [Thu, 27 Oct 2016 02:40:49 +0000 (22:40 -0400)]

ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
all traces of it.

Previously exported symbols removed:
* __ast_register_file
* __ast_unregister_file
* ast_complete_source_filename

This also removes the mtx_prof static variable that was declared when
MTX_PROFILE was enabled.  This variable was only used in lock.c so it
is now initialized in that file only.

ASTERISK-26480 #close

Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966

4 years agores_pjsip_caller_id: Fix crash on session timers UPDATE on inbound calls.
Joshua Colp [Thu, 27 Oct 2016 13:07:02 +0000 (13:07 +0000)]
res_pjsip_caller_id: Fix crash on session timers UPDATE on inbound calls.

The res_pjsip_caller_id module wrongly assumed that a
saved From header would always exist on sessions. This
is true until an inbound call is received and a session
timer causes an UPDATE to be sent. In this case there will
be no saved From header and a crash will occur. This change
makes it fall back to the From header of the outgoing request
if no saved From header is present.

ASTERISK-26307 #close

Change-Id: Iccc3bc8d243b5ede9b81abf960292930c908d4fa

4 years agoMerge "test_astobj2_thrash: Fix multithreaded issues"
zuul [Wed, 26 Oct 2016 22:20:11 +0000 (17:20 -0500)]
Merge "test_astobj2_thrash:  Fix multithreaded issues"

4 years agoMerge "cdr_radius,cel_radius: Fix old memleak in unload"
zuul [Wed, 26 Oct 2016 16:13:43 +0000 (11:13 -0500)]
Merge "cdr_radius,cel_radius: Fix old memleak in unload"

4 years agoapp_voicemail: Clear voice mailbox in MailboxExists and MAILBOX_EXISTS.
Joshua Colp [Wed, 26 Oct 2016 12:51:50 +0000 (12:51 +0000)]
app_voicemail: Clear voice mailbox in MailboxExists and MAILBOX_EXISTS.

When executing the MailboxExists dialplan application and
MAILBOX_EXISTS dialplan function the passed in temporary voice
mailbox was not cleared, causing it to try to free garbage.

ASTERISK-26503 #close

Change-Id: Ie21ccfa1b80b9c59318e596f6b8e17da2b5a7cb3

4 years agopjsip: Fix a few media bugs with reinvites and asymmetric payloads.
Joshua Colp [Sun, 23 Oct 2016 12:38:59 +0000 (12:38 +0000)]
pjsip: Fix a few media bugs with reinvites and asymmetric payloads.

When channel format changes occurred as a result of an RTP
re-negotiation the bridge was not informed this had happened.
As a result the bridge technology was not re-evaluated and the
channel may have been in a bridge technology that was incompatible
with its formats. The bridge is now unbridged and the technology
re-evaluated when this occurs.

The chan_pjsip module also allowed asymmetric codecs for sending
and receiving. This did not work with all devices and caused one
way audio problems. The default has been changed to NOT do this
but to match the sending codec to the receiving codec. For users
who want asymmetric codecs an option has been added, asymmetric_rtp_codec,
which will return chan_pjsip to the previous behavior.

The codecs returned by the chan_pjsip module when queried by
the bridge_native_rtp module were also not reflective of the
actual negotiated codecs. The nativeformats are now returned as
they reflect the actual negotiated codecs.

ASTERISK-26423 #close

Change-Id: I6ec88c6e3912f52c334f1a26983ccb8f267020dc

4 years agores_pjsip_sdp_rtp: Fix address family of explicit media_address.
Joshua Colp [Wed, 26 Oct 2016 11:32:04 +0000 (11:32 +0000)]
res_pjsip_sdp_rtp: Fix address family of explicit media_address.

When an explicit media_address is provided the address family
in the SDP needs to be set to reflect it.


Change-Id: Ib9350cc91c120eb2f96f0623d3907d12af67eb79

4 years agotest_astobj2_thrash: Fix multithreaded issues
George Joseph [Tue, 25 Oct 2016 16:20:16 +0000 (10:20 -0600)]
test_astobj2_thrash:  Fix multithreaded issues

The test uses 4 threads to grow, count, lookup and shrink 15K objects
in a container.  If there's only 1 execution engine available, the test
will complete in <50ms.  If each threads gets its own execution engine,
the test may timeout after 60 seconds because the count thread does a
locked ao2_callback on the whole container in a tight loop with only
a sched_yield to give up time.  The lock contention makes the test
execution times wildly variable and mostly timeout.  2 execution
engines are OK, 3 results in about 33% failure rate and >=4 causes
a 80% failure rate.

To fix, the sched_yield was changed to a usleep(500).

Also, the number of buckets specified for the container was an even
number so that was changed to the next prime number greater than
(MAX_HASH_ENTRIES / 100).  That's 151 currently.

Change-Id: I50cd2344161ea61bfe4b96d2a29a6ccf88385c77

4 years agochan_pjsip: segfault on already disconnected session
Alexei Gradinari [Tue, 18 Oct 2016 14:04:54 +0000 (10:04 -0400)]
chan_pjsip: segfault on already disconnected session

On heavy loaded system the TCP/TLS incoming calls could be
disconnected by pjproject while these calls are being
processed by asterisk.

This patch uses functions pjsip_inv_add_ref/pjsip_inv_dec_ref
to inform pjproject that an INVITE session is in use.

ASTERISK-26482 #close

Change-Id: Ia2e3e2f75358cdb530252a9ce158af3d5d9fdf33

4 years agocdr_radius,cel_radius: Fix old memleak in unload
Badalyan Vyacheslav [Mon, 10 Oct 2016 16:49:08 +0000 (12:49 -0400)]
cdr_radius,cel_radius: Fix old memleak in unload

- Call "rc_openlog" optional. If you do not call,
you will simply NULL instead of a name.

- On the one PID can be only one syslog channel.
And it can already be run in logger.c

- Calling rc_openlog we assigns a new name for
the channel syslog. This unexpected behavior for logger.c.

Most lesser evil, is to agree on a NULL name syslog
if the channel was not launched in logger.c.

It also solves the problem of memory leaks.

ASTERISK-26455 #close

Change-Id: Ic17c38de67583e971d78fe18807d1a9faf8f0afd

4 years agoMerge "pjsip: Support dual stack automatically."
Joshua Colp [Tue, 25 Oct 2016 10:29:45 +0000 (05:29 -0500)]
Merge "pjsip: Support dual stack automatically."

4 years agoMerge "pjproject_bundled: Fixed various build issues"
Joshua Colp [Tue, 25 Oct 2016 10:28:48 +0000 (05:28 -0500)]
Merge "pjproject_bundled:  Fixed various build issues"

4 years agoMerge "ARI: Add duplicate channel ID checking for channel creation."
Joshua Colp [Tue, 25 Oct 2016 01:01:47 +0000 (20:01 -0500)]
Merge "ARI: Add duplicate channel ID checking for channel creation."

4 years agoMerge "ARI: Detect duplicate channel IDs"
Joshua Colp [Tue, 25 Oct 2016 01:01:43 +0000 (20:01 -0500)]
Merge "ARI: Detect duplicate channel IDs"

4 years agopjproject_bundled: Fixed various build issues
George Joseph [Mon, 24 Oct 2016 15:55:23 +0000 (09:55 -0600)]
pjproject_bundled:  Fixed various build issues

* CFLAGS is now properly set when using older gcc.
* All third-party pjproject targets have been removed.  This fixes
  an issue with older libsrtp in some distros.
* Manually removing the source directory now causes a rebuild.
* EXTERNALS_CACHE_DIR is now properly checked.
* Whitespace fixes.

Change-Id: I98fec6847efc5602a9f41cb95096fd660a49fa60

4 years agotypo: s/paranthesis/parenthesis/ in a comment
Pascal Cadotte Michaud [Mon, 24 Oct 2016 19:13:43 +0000 (15:13 -0400)]
typo: s/paranthesis/parenthesis/ in a comment

Change-Id: I7c1f4eb051177ee22cbe97e063d4a3effe29be30

4 years agopjsip: Support dual stack automatically.
Joshua Colp [Mon, 19 Sep 2016 11:13:21 +0000 (11:13 +0000)]
pjsip: Support dual stack automatically.

This change adds support for dual stack automatically. No
configuration is required and the IP address and version
in the SIP messages and SDP will be automatically changed
based on the transport over which the message is being
sent. RTP usage has also been changed to listen on both
IPv4 and IPv6 simultaneously to allow media to flow, and
to allow ICE support on both simultaneously. This also
allows failover between IPv6 and IPv4 to work as expected.

ASTERISK-26309 #close

Change-Id: I235a421d8f9a326606d861b449fa6fe3a030572d

4 years agoARI: Add duplicate channel ID checking for channel creation.
Mark Michelson [Wed, 19 Oct 2016 17:05:28 +0000 (12:05 -0500)]
ARI: Add duplicate channel ID checking for channel creation.

This is similar to what is done for origination, but for the 14 and up
channel creation method. When attempting to create a channel, if a
channel ID is specified and a channel already exists with that ID, then
a 409 is returned.

Change-Id: I77f9253278c6947939c418073b6b31065489187c

4 years agoARI: Detect duplicate channel IDs
Mark Michelson [Mon, 17 Oct 2016 19:18:57 +0000 (14:18 -0500)]
ARI: Detect duplicate channel IDs

ARI and AMI allow for an explicit channel ID to be specified
when originating channels. Unfortunately, there is nothing in
place to prevent someone from using the same ID for multiple
channels. Further complicating things, adding ID validation to channel
allocation makes it impossible for ARI to discern why channel allocation
failed, resulting in a vague error code being returned.

The fix for this is to institute a new method for channel errors to be
discerned. The method mirrors errno, in that when an error occurs, the
caller can consult the channel errno value to determine what the error
was. This initial iteration of the feature only introduces "unknown" and
"channel ID exists" errors. However, it's possible to add more errors as

ARI uses this feature to determine why channel allocation failed and can
return a 409 error during origination to show that a channel with the
given ID already exists.


Change-Id: Ibba7ae68842dab6df0c2e9c45559208bc89d3d06

4 years agoFix issue with CLI not returning to prompt after running "features show"
snuffy [Wed, 19 Oct 2016 22:53:24 +0000 (09:53 +1100)]
Fix issue with CLI not returning to prompt after running "features show"

ASTERISK-26444 #close

Change-Id: I91d645b7e6e5dba35f8c410df2be77a8c0e3acb8

4 years agoMerge "utils.c: Fix ast_set_default_eid for multiple platforms"
zuul [Wed, 19 Oct 2016 22:35:52 +0000 (17:35 -0500)]
Merge "utils.c:  Fix ast_set_default_eid for multiple platforms"

4 years agoMerge "res_rtp_asterisk: Add ice_blacklist option"
zuul [Wed, 19 Oct 2016 19:58:23 +0000 (14:58 -0500)]
Merge "res_rtp_asterisk: Add ice_blacklist option"

4 years agoMerge "chan_sip: Support nat=auto_comedia or nat=force_rport,auto_comedia."
Joshua Colp [Wed, 19 Oct 2016 16:06:41 +0000 (11:06 -0500)]
Merge "chan_sip: Support nat=auto_comedia or nat=force_rport,auto_comedia."

4 years agores_rtp_asterisk: Add ice_blacklist option
Michael Walton [Tue, 4 Oct 2016 23:24:54 +0000 (12:24 +1300)]
res_rtp_asterisk: Add ice_blacklist option

Introduces ice_blacklist configuration in rtp.conf. Subnets listed in the
form ice_blacklist = <subnet spec>, e.g. ice_blacklist =, are excluded from ICE host, srflx and relay
discovery. This is useful for optimizing the ICE process where a system
has multiple host address ranges and/or physical interfaces and certain
of them are not expected to be used for RTP. Multiple ice_blacklist
configuration lines may be used. If left unconfigured, all discovered
host addresses are used, as per previous behavior.

Documention in rtp.conf.sample.

ASTERISK-26418 #close

Change-Id: Ibee88f80d7693874fda1cceaef94a03bd86012c9

4 years agoCDR: Alter destruction pattern for CDR chains.
Mark Michelson [Tue, 18 Oct 2016 21:30:17 +0000 (16:30 -0500)]
CDR: Alter destruction pattern for CDR chains.

CDRs form chains. When the root of the chain is destroyed, it then
unreferences the next CDR in the chain. That CDR is destroyed, and it
then unreferences the next CDR in the chain. This repeats until the end
of the chain is reached. While this typically does not cause any sort of
problems, it is possible in strange scenarios for the CDR chain to grow
way longer than expected. In such a scenario, the destruction pattern
can result in a stack overflow.

This patch fixes the problem by switching from a recursive pattern to an
iterative pattern for destruction. When the root CDR is destroyed, it is
responsible for iterating over the rest of the CDRs and unreferencing
each one. Other CDRs in the chain, since they are not the root, will
simply destroy themselves and be done. This causes the stack depth not
to increase.

ASTERISK-26421 #close
Reported by Andrew Nagy

Change-Id: I3ca90c2b8051f3b7ead2e0e43f60d2c18fb204b8

4 years agoMerge "menuselect: invalid test for GTK2"
zuul [Tue, 18 Oct 2016 19:57:08 +0000 (14:57 -0500)]
Merge "menuselect: invalid test for GTK2"

4 years agoMerge "cli: Auto-complete File not Module for core set debug."
Joshua Colp [Tue, 18 Oct 2016 18:22:02 +0000 (13:22 -0500)]
Merge "cli: Auto-complete File not Module for core set debug."

4 years agoari: Update model validator based on addition of asterisk_id.
Joshua Colp [Tue, 18 Oct 2016 16:51:20 +0000 (16:51 +0000)]
ari: Update model validator based on addition of asterisk_id.


Change-Id: I9c386f7a1c7d969161b28f189eb6298bbc5b7541

4 years agoMerge "Binaural synthesis (confbridge): On/off setting for binaural synthesis."
Joshua Colp [Tue, 18 Oct 2016 16:38:59 +0000 (11:38 -0500)]
Merge "Binaural synthesis (confbridge): On/off setting for binaural synthesis."

4 years agoMerge "chan_rtp: Set a sane default rtp engine for unicast."
Joshua Colp [Tue, 18 Oct 2016 16:38:13 +0000 (11:38 -0500)]
Merge "chan_rtp: Set a sane default rtp engine for unicast."

4 years agomenuselect: invalid test for GTK2
Tzafrir Cohen [Sun, 11 Sep 2016 15:13:00 +0000 (10:13 -0500)]
menuselect: invalid test for GTK2 was only checking for the existence of pkg-config
and not the gtk2 package itself.  Now it calls AST_PKG_CONFIG_CHECK
for gtk+-2.0.

ASTERISK-26356 #close

Change-Id: I93e9d0166341f0e7f84b52955bb6f81da42f2ef6

4 years agoMerge "res/ari: Add the Asterisk EID field to outgoing events"
Joshua Colp [Tue, 18 Oct 2016 10:38:46 +0000 (05:38 -0500)]
Merge "res/ari: Add the Asterisk EID field to outgoing events"

4 years agocli: Auto-complete File not Module for core set debug.
Alexander Traud [Tue, 18 Oct 2016 08:01:47 +0000 (10:01 +0200)]
cli: Auto-complete File not Module for core set debug.

Since Asterisk 1.8, the command "core set debug" on the command-line interface
asks not for a file (.c) but a module name. This change shows modules (.so) on
the auto-completion via a tabulator or the question mark. Now, when you
partially type a module name, TAB or ?, you get the correct candidiates.


Change-Id: I1213f1dd409bd4ff8de08ad80cb0c73cafb1bae0

4 years agoMerge "app_queue: Added initialization for "context" parameter"
zuul [Mon, 17 Oct 2016 20:08:58 +0000 (15:08 -0500)]
Merge "app_queue: Added initialization for "context" parameter"

4 years agoBinaural synthesis (confbridge): On/off setting for binaural synthesis.
frahaase [Fri, 12 Aug 2016 16:22:58 +0000 (18:22 +0200)]
Binaural synthesis (confbridge): On/off setting for binaural synthesis.

Adds setting to confbridge.conf (binaural_active) that determines if binaural
synthesis can be available in bridge_softmix.


Change-Id: I59dfcb8e55fe1df4ef32045882fea5bb58fc71db

4 years agopjproject_bundled: Add patch to address SSL crash
George Joseph [Mon, 17 Oct 2016 16:39:10 +0000 (10:39 -0600)]
pjproject_bundled:  Add patch to address SSL crash

Addresses crashes when an attempt is made to operate on an SSL socket
after the socket has been closed.

ASTERISK-26477 #close

Change-Id: I421305b357558b4f9e690210dc0f4831ef4b3002

4 years agoapp_queue: Added initialization for "context" parameter
Leandro Dardini [Thu, 13 Oct 2016 19:09:18 +0000 (21:09 +0200)]
app_queue: Added initialization for "context" parameter

When using Asterisk Realtime Architecture, empty fields are skipped and the
default values are used. If the "context" parameter in queue was set and then
cleared from the database, the old value remains in memory and it continues
to be used. This change initialize the "context" parameter with an empty value,
allowing clearing the parameter.

ASTERISK-26462 #close

Change-Id: I64be73d5044ce38dd02408bd0e53de965ef65905

4 years agores/ari: Add the Asterisk EID field to outgoing events
Matt Jordan [Sun, 16 Oct 2016 01:05:05 +0000 (20:05 -0500)]
res/ari: Add the Asterisk EID field to outgoing events

This patch adds the Asterisk EID field to all outgoing ARI events.
Because this field should be added to all events as they are
transmitted, it is appended to the JSON message just prior to it being
handed off to the application message handler. This makes it somewhat
resilient to both new events being added to ARI, as well as other
potential event transport mechanisms.

ASTERISK-26470 #close

Change-Id: Ieff0ecc24464e83f3f44e9c3e7bd9a5d70b87a1d

4 years agochan_rtp: Set a sane default rtp engine for unicast.
Moises Silva [Thu, 13 Oct 2016 07:06:56 +0000 (03:06 -0400)]
chan_rtp: Set a sane default rtp engine for unicast.


Change-Id: I7f5ee2eeba8906e9ecb3293dbe3a747770bb5011

4 years agoutils.c: Fix ast_set_default_eid for multiple platforms
George Joseph [Sun, 16 Oct 2016 22:25:35 +0000 (16:25 -0600)]
utils.c:  Fix ast_set_default_eid for multiple platforms

ast_set_default_eid was searching for ethX, emX, enoX, ensX and even
pciD#U interface names.  While this was a good attempt, it wasn't
inclusive enough to capture interfaces like enp6s0 or ens6d1, etc.

Rather than relying on interface names, we now simply find the first
interface returned by the OS that has a hardware address and that
address isn't all 0x00 or all 0xff.  The code IS different for BSD,
Solaris and Linux based on what method is available for enumerating

Tested on:

I was unable to test on Solaris at this time but the code for Solaris
is used elsewhere at Digium.

Change-Id: Iaa6db87ca78a9a375e47d70e043ae08c1448cb72

4 years agochan_sip: Only send video on outgoing channel if incoming channel supports it
Michael Kuron [Sat, 15 Oct 2016 09:58:05 +0000 (11:58 +0200)]
chan_sip: Only send video on outgoing channel if incoming channel supports it

Previously, the settings videosupport=always and videosupport=yes behaved
identically and unconditionally caused a video offer to be sent in the SDP on
an outgoing call. This was a regression introduced with commit
5a1d90e1fbfc4b48927aad55311f3b38efbf1f54 in Asterisk 1.6.1.

This commit restores correct behavior: videosupport=always causes a video offer
to be sent unconditionally, while videosupport=yes will only offer video on an
outbound channel if the incoming channel it is bridged to also supports video.
That way, the device receiving the outgoing call can display the correct user
interface elements for audio or video and will not unnecessarily show a blank
video window on an audio-only call.

ASTERISK-17470 #close

Change-Id: I782f4409d436114dbc97061c3570c0cd24f7c3ae

4 years agoMerge "Fix issues with bundled pjproject cached download."
zuul [Fri, 14 Oct 2016 23:48:58 +0000 (18:48 -0500)]
Merge "Fix issues with bundled pjproject cached download."

4 years agoMerge "Audit ast_json_pack() calls for needed UTF-8 checks."
zuul [Fri, 14 Oct 2016 22:17:14 +0000 (17:17 -0500)]
Merge "Audit ast_json_pack() calls for needed UTF-8 checks."

4 years agoMerge "json: Check party id name, number, subaddresses for UTF-8."
zuul [Fri, 14 Oct 2016 21:32:18 +0000 (16:32 -0500)]
Merge "json: Check party id name, number, subaddresses for UTF-8."

4 years agoMerge "json: Add UTF-8 check call."
zuul [Fri, 14 Oct 2016 19:40:34 +0000 (14:40 -0500)]
Merge "json: Add UTF-8 check call."

4 years agoMerge "res_config_mysql: Fix several issues related to recent table changes"
zuul [Fri, 14 Oct 2016 16:49:14 +0000 (11:49 -0500)]
Merge "res_config_mysql:  Fix several issues related to recent table changes"

4 years agoMerge "aoc.c: Whitespace cleanup"
zuul [Fri, 14 Oct 2016 16:13:50 +0000 (11:13 -0500)]
Merge "aoc.c: Whitespace cleanup"

4 years agoMerge "app_queue.c: Fix clearing of pause reason string."
zuul [Fri, 14 Oct 2016 15:08:23 +0000 (10:08 -0500)]
Merge "app_queue.c: Fix clearing of pause reason string."

4 years agoFix issues with bundled pjproject cached download.
Corey Farrell [Fri, 14 Oct 2016 05:18:50 +0000 (01:18 -0400)]
Fix issues with bundled pjproject cached download.

Previously when testing I had a preexisting makeopts in ASTTOPDIR.  The
ordering of causes --with-externals-cache to be processed
after third-party configure.  In cases where the Asterisk clone is
cleaned it would cause pjproject to be downloaded to /tmp.  This
moves processing of the externals cache and sounds cache to happen
before third-party configure.

This also addresses a possible issue with the third-party Makefile.  If
TMPDIR is set by the environment it would override the path given to


Change-Id: Ifab7f35bfcd5a31a31a3a4353cc26a68c8c6592d

4 years agoAudit ast_json_pack() calls for needed UTF-8 checks.
Richard Mudgett [Wed, 12 Oct 2016 21:24:14 +0000 (16:24 -0500)]
Audit ast_json_pack() calls for needed UTF-8 checks.

Added needed UTF-8 checks before constructing json objects in various
files for strings obtained outside the system.  In this case string values
from a channel driver's peer and not from the user setting channel

* aoc.c: Fixed type mismatch in s_to_json() for time and granularity json
object construction.

Reported by: Richard Mudgett

Change-Id: Iac2d867fa598daba5c5dbc619b5464625a7f2096

4 years agojson: Check party id name, number, subaddresses for UTF-8.
Richard Mudgett [Wed, 12 Oct 2016 21:20:00 +0000 (16:20 -0500)]
json: Check party id name, number, subaddresses for UTF-8.

* Updated unit test as ast_json_name_number() is now NULL tolerant.

ASTERISK-26466 #close
Reported by: Richard Mudgett

Change-Id: I7d4e14194f8f81f24a1dc34d1b8602c0950265a6

4 years agojson: Add UTF-8 check call.
Richard Mudgett [Tue, 11 Oct 2016 23:14:39 +0000 (18:14 -0500)]
json: Add UTF-8 check call.

Since the json library does not make the check function public we
recreate/copy the function in our interface module.

Reported by: Richard Mudgett

Change-Id: I36d3d750b6f5f1a110bc69ea92b435ecdeeb2a99

4 years agoaoc.c: Whitespace cleanup
Richard Mudgett [Wed, 12 Oct 2016 22:42:11 +0000 (17:42 -0500)]
aoc.c: Whitespace cleanup

* In s_to_json() removed unnecessary ast_json_ref() to ast_json_null()
when creating the type json object.  The ref is a noop.

Change-Id: I2be8b836876fc2e34a27c161f8b1c53b58a3889a

4 years agoapp_minivm.c: Fix malformed ast_json_pack() call.
Richard Mudgett [Wed, 12 Oct 2016 21:22:34 +0000 (16:22 -0500)]
app_minivm.c: Fix malformed ast_json_pack() call.

Change-Id: I082b239022fac462666e52a14a44304748908dc0

4 years agoapp_queue.c: Fix clearing of pause reason string.
Richard Mudgett [Wed, 12 Oct 2016 22:27:06 +0000 (17:27 -0500)]
app_queue.c: Fix clearing of pause reason string.

The pause reason is not always cleared when it should be cleared.

* Made set_queue_member_pause() always clear pause reason if not pausing
with a reason string.

Change-Id: I993dad19626ec017478a230e980989438b778c53

4 years agores_config_mysql: Fix several issues related to recent table changes
George Joseph [Wed, 12 Oct 2016 21:30:40 +0000 (15:30 -0600)]
res_config_mysql:  Fix several issues related to recent table changes

Unlike any of the other database drivers, res_config_mysql checks that
the table definition matches the requirements for every insert and
update statement.  Since all requirements are forced to 'char', any
column that isn't a char, like ps_contacts' expiration_time,
qualify_timeout, etc., will throw a warning.  It's kinda harmless but
very misleading.  Since no other driver does those checks on insert
or update, they've been removed from res_config_mysql.  Also, all
the logic that actually attempted to ALTER the table to fix the issue
has been removed.  With the move to alembic, the auto-alter
functionality is not only unnecessary, it's also dangerous.

The other issue is that res_config_mysql calls the mysql_insert_id
function inside store_mysql.  Presumably the intention was to return
the number of rows inserted DESPITE A NOTE IN THE CODE THAT THE VALUE
IS NON_PORTABLE AND MAY CHANGE.  That value is then returned to
config realtime as the number of rows inserted.  Guess what?  The value
changed.  It now only returns the number of rows inserted if there's an
auto increment column on the table, which ps_contacts doesn't have.
Otherwise it returns 0.  So now, the insert worked but we tell config
realtime and sorcery that no rows were inserted.  That call to
mysql_insert_id was removed and we now always return 1 if the insert
succeeded.  We're only inserting 1 row at a time anyway.  If the insert
fails, we still return -1.

ASTERISK-26362 #close
Reported-by: Carlos Chavez

Change-Id: I83ce633efdb477b03c8399946994ee16fefceaf4

4 years agoBinaural synthesis (confbridge): Adds libfftw3 as dependency.
frahaase [Fri, 12 Aug 2016 16:22:40 +0000 (18:22 +0200)]
Binaural synthesis (confbridge): Adds libfftw3 as dependency.

Adds libfftw3 to the build chain that is is going to be used for binaural
synthesis by bridge_softmix.


Change-Id: Iedc2f174e4ccb39ae5d9e698e339c6a17155867b

4 years agoMerge "Binaural synthesis (confbridge): interleaved two-channel audio."
zuul [Wed, 12 Oct 2016 16:36:06 +0000 (11:36 -0500)]
Merge "Binaural synthesis (confbridge): interleaved two-channel audio."

4 years agoMerge "bundled_pjproject: Add tests for programs used by the Makefile, et al."
zuul [Wed, 12 Oct 2016 16:04:53 +0000 (11:04 -0500)]
Merge "bundled_pjproject:  Add tests for programs used by the Makefile, et al."

4 years agores_fax: Fix a tight race condition causing fax to crash in audio fallback
Torrey Searle [Thu, 29 Sep 2016 18:08:07 +0000 (20:08 +0200)]
res_fax: Fix a tight race condition causing fax to crash in audio fallback

When T.38 gets rejected and G711 failback occurs there is a period of
time where neither AST_FAX_TECH_T38 nor AST_FAX_TECH_AUDIO is set,
leading to a crash.

Change-Id: Icc3f457b2292d48a9d7843dac0028347420cc982

4 years agoMerge "Add text of cdr directory into for ast-db-manage"
zuul [Wed, 12 Oct 2016 00:45:14 +0000 (19:45 -0500)]
Merge "Add text of cdr directory into for ast-db-manage"

4 years agoMerge "res_calendar: Add support for fetching calendars when reloading"
zuul [Wed, 12 Oct 2016 00:22:24 +0000 (19:22 -0500)]
Merge "res_calendar: Add support for fetching calendars when reloading"

4 years agoMerge "audiohooks: Remove redundant codec translations when using audiohooks"
zuul [Tue, 11 Oct 2016 22:45:56 +0000 (17:45 -0500)]
Merge "audiohooks: Remove redundant codec translations when using audiohooks"

4 years agoMerge "vector: After remove element recheck index"
zuul [Tue, 11 Oct 2016 21:41:33 +0000 (16:41 -0500)]
Merge "vector: After remove element recheck index"

4 years agoMerge "app_dial: Add the "Q" option to set the cause on unanswered channels"
zuul [Tue, 11 Oct 2016 20:15:56 +0000 (15:15 -0500)]
Merge "app_dial:  Add the "Q" option to set the cause on unanswered channels"

4 years agoMerge "logger: Prevent output of verbose messages initiated from rasterisk."
zuul [Tue, 11 Oct 2016 18:57:56 +0000 (13:57 -0500)]
Merge "logger: Prevent output of verbose messages initiated from rasterisk."

4 years agoapp_dial: Add the "Q" option to set the cause on unanswered channels
George Joseph [Thu, 6 Oct 2016 14:58:26 +0000 (08:58 -0600)]
app_dial:  Add the "Q" option to set the cause on unanswered channels

The "Q" option will set the cause on the unanswered channels when
another channel answers.  It overrides the default of

NOTE:  chan_sip does not support setting the cause on a CANCEL to
anything other than ANSWERED_ELSEWHERE.

ASTERISK-26446 #close

Change-Id: I71742e0919aaa16784c30a2b2e73fbeed7672e47

4 years agoMerge "res_rtp_asterisk: Fix infinite DTMF issue when switching to P2P bridge"
Joshua Colp [Tue, 11 Oct 2016 13:52:45 +0000 (08:52 -0500)]
Merge "res_rtp_asterisk: Fix infinite DTMF issue when switching to P2P bridge"

4 years agochan_sip: Support nat=auto_comedia or nat=force_rport,auto_comedia.
Alexander Traud [Tue, 11 Oct 2016 11:55:13 +0000 (13:55 +0200)]
chan_sip: Support nat=auto_comedia or nat=force_rport,auto_comedia.

In the SIP channel driver chan_sip, auto_comedia was expected to be used in
tandem with auto_force_rport. Or stated differently: Only when auto_force_rport
was chosen (the default), auto_comedia worked. This change allows auto_comedia
to be set independently of the state of (auto_)force_rport. For example,
nat=force_rport,auto_comedia is useful for IPv4/IPv6 Dual Stack deployments
when IPv6 clients are behind a Firewall.

ASTERISK-26457 #close

Change-Id: Ib29d66c6dbb61648e371e01fc36c6978ddae5bc2

4 years agovector: After remove element recheck index
Badalyan Vyacheslav [Mon, 10 Oct 2016 21:59:58 +0000 (17:59 -0400)]
vector: After remove element recheck index

Small fix. It is necessary to double-check
the index that we just removed because there
is a new element.

ASTERISK-26453 #close

Change-Id: Ib947fa94dc91dcd9341f357f1084782c64434eb7