]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
8 years agoRevert "AGI: Only defer frames when in an interception routine." 75/4375/1
George Joseph [Thu, 10 Nov 2016 13:41:43 +0000 (08:41 -0500)] 
Revert "AGI: Only defer frames when in an interception routine."

This reverts commit 5c10091f3d1430c6fc04015226f8c3e3aa9d8282.
Multiple testsuite failures were detected after the fact.

Change-Id: I397a841acc17ae230c512449cd6bed89d2ef3b73

8 years agoAGI: Only defer frames when in an interception routine. 98/4298/2
Mark Michelson [Thu, 3 Nov 2016 21:42:40 +0000 (16:42 -0500)] 
AGI: Only defer frames when in an interception routine.

AGI recently was modified to defer important frames. This was because
when AGI was used in a connected line interception routine, the
resulting connected line frame would end up getting discarded by the
AGI.

However, this caused bad behavior in other cases. Specifically, during a
transfer, if someone attempted to manually set the Caller ID on a
channel in an AGI, the deferred connected line frame would end up
overwriting what had been manually set in the AGI.

Since the initial issue was specific to interception routines, this
change removes the manual frame deferral from AGI and instead uses the
new frame deferral API in interception routines.

ASTERISK-26343 #close
Reported by Morton Tryfoss

Change-Id: Iab7d39436d0ee99bfe32ad55ef91e9bd88db4208

8 years agoMerge "automon: restore mixing of the both channels after recording stops" into 13
zuul [Tue, 8 Nov 2016 13:58:28 +0000 (07:58 -0600)] 
Merge "automon: restore mixing of the both channels after recording stops" into 13

8 years agoMerge "Add API for channel frame deferral." into 13
zuul [Tue, 8 Nov 2016 13:58:25 +0000 (07:58 -0600)] 
Merge "Add API for channel frame deferral." into 13

8 years agoMerge "chan_ooh323: reset rrq count on gk registration" into 13
Joshua Colp [Tue, 8 Nov 2016 10:59:03 +0000 (04:59 -0600)] 
Merge "chan_ooh323: reset rrq count on gk registration" into 13

8 years agoMerge "chan_ooh323: Fixes to work right with Cisco devices" into 13
Joshua Colp [Tue, 8 Nov 2016 10:58:25 +0000 (04:58 -0600)] 
Merge "chan_ooh323: Fixes to work right with Cisco devices" into 13

8 years agoMerge "stasis_recording/stored: remove calls to deprecated readdir_r function." into 13
Joshua Colp [Tue, 8 Nov 2016 10:57:47 +0000 (04:57 -0600)] 
Merge "stasis_recording/stored: remove calls to deprecated readdir_r function." into 13

8 years agoMerge "res_stasis: Don't unsubscribe from a NULL bridge." into 13
Joshua Colp [Tue, 8 Nov 2016 01:48:23 +0000 (19:48 -0600)] 
Merge "res_stasis: Don't unsubscribe from a NULL bridge." into 13

8 years agoMerge "res_http_websocket: Increase the buffer size for non-LOW_MEMORY systems" into 13
Joshua Colp [Tue, 8 Nov 2016 01:32:05 +0000 (19:32 -0600)] 
Merge "res_http_websocket: Increase the buffer size for non-LOW_MEMORY systems" into 13

8 years agoMerge "res_stasis: Set a video source mode on Stasis created bridges" into 13
Joshua Colp [Tue, 8 Nov 2016 00:23:26 +0000 (18:23 -0600)] 
Merge "res_stasis: Set a video source mode on Stasis created bridges" into 13

8 years agoMerge "main/bridge: Add some verbose logging for video source changes" into 13
Joshua Colp [Mon, 7 Nov 2016 22:53:27 +0000 (16:53 -0600)] 
Merge "main/bridge: Add some verbose logging for video source changes" into 13

8 years agoMerge "main/bridge_channel: Fix channel reference leak on video source" into 13
Joshua Colp [Mon, 7 Nov 2016 22:31:45 +0000 (16:31 -0600)] 
Merge "main/bridge_channel: Fix channel reference leak on video source" into 13

8 years agoMerge "bridges/bridge_softmix: Remove SSRC changes on join/leave; update video source...
Joshua Colp [Mon, 7 Nov 2016 20:23:35 +0000 (14:23 -0600)] 
Merge "bridges/bridge_softmix: Remove SSRC changes on join/leave; update video source" into 13

8 years agoAdd API for channel frame deferral. 97/4297/2
Mark Michelson [Thu, 3 Nov 2016 21:36:13 +0000 (16:36 -0500)] 
Add API for channel frame deferral.

There are several places in Asterisk that have duplicated logic
for deferring important frames until later.

This commit adds a couple of API calls to facilitate this automatically.

ast_channel_start_defer_frames(): Future reads of deferrable frames on
this channel will be deferred until later.

ast_channel_stop_defer_frames(): Any frames that have been deferred get
requeued onto the channel.

ASTERISK-26343

Change-Id: I3e1b87bc6796f222442fa6f7d1b6a4706fb33641

8 years agoMerge "pjproject_bundled: Fix issue with libasteriskpj needing libresample" into 13
zuul [Mon, 7 Nov 2016 16:18:59 +0000 (10:18 -0600)] 
Merge "pjproject_bundled:  Fix issue with libasteriskpj needing libresample" into 13

8 years agochan_ooh323: Fixes to work right with Cisco devices 32/4332/1
Alexander Anikin [Thu, 3 Nov 2016 12:42:20 +0000 (16:42 +0400)] 
chan_ooh323: Fixes to work right with Cisco devices

Changed output packets queue processing algo to one read-one write
instead of all read-all send

Remove h.245 tunneling parameter from ReleaseComplete packet

ASTERISK-24400 #close
Reported by: Dmitry Melekhov
Tested by: Dmitry Melekhov

Change-Id: I0b31933b062a21011dbac9a82b8bcfe345f406f6

8 years agochan_ooh323: reset rrq count on gk registration 29/4329/1
Alexander Anikin [Thu, 3 Nov 2016 18:10:53 +0000 (22:10 +0400)] 
chan_ooh323: reset rrq count on gk registration

reset registration attempts count on success registration on gatekeeper

Change-Id: I5f47351852e0ca76c9ac78421659600e0f106336

8 years agoMerge "chan_ooh323: Fix infinite loop on read second part of H.225 packet" into 13
zuul [Mon, 7 Nov 2016 13:50:38 +0000 (07:50 -0600)] 
Merge "chan_ooh323: Fix infinite loop on read second part of H.225 packet" into 13

8 years agoMerge "rtp_engine: Allow more than 32 dynamic payload types." into 13
zuul [Mon, 7 Nov 2016 12:38:25 +0000 (06:38 -0600)] 
Merge "rtp_engine: Allow more than 32 dynamic payload types." into 13

8 years agoautomon: restore mixing of the both channels after recording stops 19/4319/2
Michael Kuron [Sun, 6 Nov 2016 09:46:30 +0000 (10:46 +0100)] 
automon: restore mixing of the both channels after recording stops

This is a regression over Asterisk 11, introduced by
2dc8a060064f359a17f5ebcd515d85fe5203c019. Previously, recordings started via
the automon DTMF code would automatically be mixed together using sox because
app_monitor would be called with the m option. This commit restores this
behavior.

Change-Id: Ibaf58684285c3f1b6ca3714524e6d638ae3b3759

8 years agores_http_websocket: Increase the buffer size for non-LOW_MEMORY systems 13/4313/1
Matt Jordan [Fri, 4 Nov 2016 20:42:09 +0000 (15:42 -0500)] 
res_http_websocket: Increase the buffer size for non-LOW_MEMORY systems

Not surprisingly, using Respoke (and possibly other systems) it is
possible to blow past the 16k limit for a WebSocket packet size. This
patch bumps it up to 32k, which, at least for Respoke, is sufficient.
For now.

Because 32k is laughable on a LOW_MEMORY system (as is 16k, for that
matter), this patch adds a LOW_MEMORY directive that sets the buffer to
8k for systems who have asked for their reduced memory availability to
be considered.

Change-Id: Id235902537091b58608196844dc4b045e383cd2e

8 years agores_stasis: Set a video source mode on Stasis created bridges 12/4312/1
Matt Jordan [Fri, 4 Nov 2016 20:40:58 +0000 (15:40 -0500)] 
res_stasis: Set a video source mode on Stasis created bridges

When a bridge is created via ARI (through res_stasis), no video source
mode is set by default. As a result, any endpoint sending video media
won't ever see any video reflected back to it.

This patch defaults a bridge to a 'follow the talker' video mode.
Further work can be done to add routes that allow for the video mode to
be controlled through the /bridges resource.

Change-Id: I7e9d530a5d7a97a4524a9ee4e468e1a6b3443866

8 years agomain/bridge_channel: Fix channel reference leak on video source 11/4311/1
Matt Jordan [Fri, 4 Nov 2016 20:37:57 +0000 (15:37 -0500)] 
main/bridge_channel: Fix channel reference leak on video source

When a channel is made the video source, the bridge holds a reference to
it. Whenever the video source changes, that reference is released.
However, a ref leak does occur if the channel leaves the bridge (such as
being hung up) while it is the video source, as the bridge never
releases the ref in such a case.

This patch adds a line to the bridge_channel_internal_join routine such
that, when a channel finishes its time in the bridge, it notifies the
bridge via ast_bridge_remove_video_src that if it is a video source its
reference should be released.

ASTERISK-26555 #close

Change-Id: I3a2f5238a9d2fc49c591f0e65199d782ab0be76a

8 years agomain/bridge: Add some verbose logging for video source changes 10/4310/1
Matt Jordan [Fri, 4 Nov 2016 20:36:42 +0000 (15:36 -0500)] 
main/bridge: Add some verbose logging for video source changes

It's actually quite useful to see the source of a video stream change.
This doesn't happen terribly often, even with talk detection - but when
it does, it's nice to know which channel is now providing your video
stream.

As a verbose 5 level message, it shouldn't be terribly spammy or costly
to have, and is 'lower level' then most other verbose messages that the
bridge system emits.

ASTERISK-26555

Change-Id: Ia1c20ecafa9670171fd38bddcf3beccae47fb15c

8 years agobridges/bridge_softmix: Remove SSRC changes on join/leave; update video source 09/4309/1
Matt Jordan [Fri, 4 Nov 2016 20:33:35 +0000 (15:33 -0500)] 
bridges/bridge_softmix: Remove SSRC changes on join/leave; update video source

WebRTC clients really, really want to know the SSRC of the media they're
getting. Changing the SSRC is generally not a good thing.

bridge_softmix, starting in Asterisk 12, started changing the SSRC of
parties as they joined or left the bridge. With most phones, this isn't
a problem: phones just play back the stream they're getting. With WebRTC
clients, however, the SSRC is tied to a media stream that may be
negotiated. When a new SSRC just shows up, the media can be dropped.

As it turns out, the SSRC change shouldn't even be necessary. From the
perspective of the client, it's still talking to Asterisk with the same
media stream: why indicate that the far party has suddenly changed to a
different source of media?

This patch opts to just remove the SSRC changes. With this patch, video
clients that join/leave a softmix bridge actually get the video stream
instead of freaking out.

ASTERISK-26555

Change-Id: I27fec098b32e7c8718b4b65f3fd5fa73527968bf

8 years agostasis_recording/stored: remove calls to deprecated readdir_r function. 24/4224/7
Kevin Harwell [Fri, 28 Oct 2016 20:11:35 +0000 (15:11 -0500)] 
stasis_recording/stored: remove calls to deprecated readdir_r function.

The readdir_r function has been deprecated and should no longer be used. This
patch removes the readdir_r dependency (replaced it with readdir) and also moves
the directory search code to a more centralized spot (file.c)

Also removed a strict dependency on the dirent structure's d_type field as it
is not portable. The code now checks to see if the value is available. If so,
it tries to use it, but defaults back to using the stats function if necessary.

Lastly, for most implementations of readdir it *should* be thread-safe to make
concurrent calls to it as long as different directory streams are specified.
glibc falls into this category. However, since it is possible that there exist
some implementations that are not safe, locking has been added for those other
than glibc.

ASTERISK-26412
ASTERISK-26509 #close

Change-Id: Id8f54689b1e2873e82a09d0d0d2faf41964e80ba

8 years agoRevert "chan_sip: Fix lastrtprx always updated" 01/4301/1
Kevin Harwell [Fri, 4 Nov 2016 15:57:43 +0000 (10:57 -0500)] 
Revert "chan_sip: Fix lastrtprx always updated"

This reverts commit 93332cb1d0eea18021ea6538237297e627d6e2fc.

Unfortunately, the aforementioned commit caused a regression (incoming calls
would eventually disconnect). Thus it is being removed.

ASTERISK-26523 #close
ASTERISK-25270

Change-Id: Ibf5586adc303073a8eac667a4cbfdb6be184a64d

8 years agores_stasis: Don't unsubscribe from a NULL bridge. 34/4334/1
Joshua Colp [Wed, 2 Nov 2016 15:52:13 +0000 (15:52 +0000)] 
res_stasis: Don't unsubscribe from a NULL bridge.

A NULL bridge has special meaning in res_stasis for
unsubscribing. It means that a subscription to ALL
bridges should be removed. This should not be done
as part of the normal subscription management in
the res_stasis channel loop.

ASTERISK-26468

Change-Id: I6d5bea8246dd13a22ef86b736aefbf2a39c15af0

8 years agochan_ooh323: Fix infinite loop on read second part of H.225 packet 94/4294/1
Alexander Anikin [Thu, 3 Nov 2016 18:45:37 +0000 (22:45 +0400)] 
chan_ooh323: Fix infinite loop on read second part of H.225 packet

Fix logic on read second part of H.225 packet. There was infinite loop on
wrong connections due to read before poll.

Change-Id: I42b4bf75c46e4a5c5df5c5ca1f0bd74b8944e7ff

8 years agopjproject_bundled: Fix issue with libasteriskpj needing libresample 90/4290/1
George Joseph [Thu, 3 Nov 2016 16:55:06 +0000 (10:55 -0600)] 
pjproject_bundled:  Fix issue with libasteriskpj needing libresample

libresample is only needed by pjproject if we're building pjsua, which
we only do if TEST_FRAMEWORK is selected.  It's required by pjsua to
process audio which is needed by some testsuite tests.  Unfortunately,
pjproject relies on a newer version of libresample than the version
that ships by most distros so we need to compile the version that's
bundled with pjproject.  Since we only need it for pjsua, we DON'T want
it's symbols exposed when we actually build asterisk.

There was a problem however... TEST_FRAMEWORK is only known AFTER we've
already run ./configure on both asterisk and pjproject but pjproject's
./configure needs to test it to know whether to set up to build
libresample or not.  The previous way of figuring this out was to
always tell ./configure "yes" but not actually build the library.  This
caused an issue where building libasteriskpj was being told to include
libresample but it wasn't actually there.

The solution is to still do a default pjproject configure during an
asterisk ./configure but if makeopts or menuselect.makeopts changes
subsequently, we now reconfigure pjproject, taking into account the
current state of TEST_FRAMEWORK.  Previously, if makeopts or
menuselect.makeopts changed, only a recompile of pjproject was done.

Change-Id: I9b5d84c61384a3ae07fe30e85c49698378cc4685

8 years agoMerge "chan_sip: add missing account code" into 13
Joshua Colp [Wed, 2 Nov 2016 22:32:36 +0000 (17:32 -0500)] 
Merge "chan_sip: add missing account code" into 13

8 years agochan_sip: add missing account code 75/4275/2
Sebastian Gutierrez [Wed, 2 Nov 2016 00:48:50 +0000 (21:48 -0300)] 
chan_sip: add missing account code

Added missing account to AMI event of sip show peers

ASTERISK-26176 #close

Change-Id: Ieb6c2c80a838a1b59c82103eba4c63ba238dc482

8 years agortp_engine: Allow more than 32 dynamic payload types. 81/3681/10
Alexander Traud [Tue, 13 Sep 2016 09:08:34 +0000 (11:08 +0200)] 
rtp_engine: Allow more than 32 dynamic payload types.

The dynamic range (96-127) allows 32 RTP Payload Types. RFC 3551 section 3
allows to reassign other ranges. Consequently, when the dynamic range is
exhausted, you can go for "rtp_pt_dynamic = 35" (or 0) in asterisk.conf. This
enables the range 35-63 (or 0-63) giving room for another 29 (or 64) payload
types.

ASTERISK-26311 #close

Change-Id: I7bc96ab764bc30098a178b841cbf7146f9d64964
(cherry picked from commit 9ac53877f688c06acaa7c377f15da8770e4ee88b)

8 years agoapp_dial: Fix incorrect device state when channel is picked up. 78/4278/1
Joshua Colp [Wed, 2 Nov 2016 14:15:14 +0000 (14:15 +0000)] 
app_dial: Fix incorrect device state when channel is picked up.

Given the scenario where multiple channels are dialed using Dial()
but the caller is picked up using PickupChan() all outgoing channels
except the channel specified to PickupChan() would be marked
as ringing until the call had been hung up.

When using the PickupChan application the channel executing the
application is swapped into place of another channel. As part
of this process the channel is answered. The Dial application
has explicit logic which checks if the channel is answered,
cancels all other outgoing channels, and bridges. This logic is
different than the normal logic that is executed when an outgoing
channel is answered. This different logic failed to publish dial
events stating that the other outgoing channels had been canceled.
As a result references to the outgoing channels were held onto by
the dial masquerade process until the call had been ended and
the channels had gone away. This would result in the channels
appearing in the "core show channels" list despite not being present
anymore and would also result in incorrect device state.

This change makes it so that this logic also publishes
dial events stating that the other outgoing channels have been
canceled.

ASTERISK-26549

Change-Id: Iea7168e6e82f7d4609ec0366153804e4f55ea64f

8 years agoMerge "res_pjsip_sdp_rtp: Limit number of formats to defined maximum." into 13
Joshua Colp [Wed, 2 Nov 2016 13:31:02 +0000 (08:31 -0500)] 
Merge "res_pjsip_sdp_rtp: Limit number of formats to defined maximum." into 13

8 years agoMerge "bundled pjproject: Fix DNS write to freed memory." into 13
Joshua Colp [Wed, 2 Nov 2016 10:24:34 +0000 (05:24 -0500)] 
Merge "bundled pjproject: Fix DNS write to freed memory." into 13

8 years agoMerge "res/stasis: Add CLI commands for displaying/debugging ARI apps" into 13
Joshua Colp [Wed, 2 Nov 2016 10:23:51 +0000 (05:23 -0500)] 
Merge "res/stasis: Add CLI commands for displaying/debugging ARI apps" into 13

8 years agoMerge "define PATH_MAX for HURD" into 13
zuul [Wed, 2 Nov 2016 03:30:41 +0000 (22:30 -0500)] 
Merge "define PATH_MAX for HURD" into 13

8 years agoMerge "netsock.c: fix includes for HURD" into 13
zuul [Wed, 2 Nov 2016 02:15:09 +0000 (21:15 -0500)] 
Merge "netsock.c: fix includes for HURD" into 13

8 years agoMerge "pjproject_bundled: Fix compile of pjsua so it handles audio" into 13
zuul [Wed, 2 Nov 2016 00:30:33 +0000 (19:30 -0500)] 
Merge "pjproject_bundled:  Fix compile of pjsua so it handles audio" into 13

8 years agoMerge "codecs.conf.sample: Add sample and option descriptions for codec_opus" into 13
Joshua Colp [Tue, 1 Nov 2016 22:30:17 +0000 (17:30 -0500)] 
Merge "codecs.conf.sample: Add sample and option descriptions for codec_opus" into 13

8 years agobundled pjproject: Fix DNS write to freed memory. 70/4270/1
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
patch.

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

0006-r5477-svn-backport-Fix-DNS-write-on-freed-memory.patch

ASTERISK-26516
Reported by:  Richard Mudgett

Change-Id: Ifdfae9ecf1e41b53080f33aab44ce1a220f349c5

8 years agoMerge "chan_sip: Incorrect display option Outbound reg. retry 403" into 13
zuul [Tue, 1 Nov 2016 19:28:22 +0000 (14:28 -0500)] 
Merge "chan_sip: Incorrect display option Outbound reg. retry 403" into 13

8 years agores_pjsip_sdp_rtp: Limit number of formats to defined maximum. 67/4267/1
Joshua Colp [Tue, 1 Nov 2016 11:56:24 +0000 (11:56 +0000)] 
res_pjsip_sdp_rtp: Limit number of formats to defined maximum.

The res_pjsip_sdp_rtp module did not restrict the number of
formats added to a media stream in the SDP to the defined
limit. If allow=all was used with additional loaded codecs this
could result in the next media stream being overwritten some.

This change restricts the module to limit it to the defined
maximum and also increases the maximum in our bundled pjproject.

ASTERISK-26541 #close

Change-Id: I0dc5f59d3891246cafa2f3df5ec406f088559ee8

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

ASTERISK-25070

Change-Id: I43bf94d2d36d3d8a8d0df40cd6c027d65a462814

8 years agodefine PATH_MAX for HURD 62/4262/1
Tzafrir Cohen [Tue, 1 Nov 2016 09:00:21 +0000 (11:00 +0200)] 
define PATH_MAX for HURD

PATH_MAX is not guaranteed to be defined. In parctice, all but the HURD
define it to a constant. It is indeed not safe to assume there won't be
longer paths and Asterisk generally does err safely on such cases.

So even for HURD we'll just pretend PATH_MAX is 4096.

ASTERISK-25070 #close

Change-Id: I53d10ba18c34c132bcb640a5fd8e0da1d9b22db3

8 years agocodecs.conf.sample: Add sample and option descriptions for codec_opus 50/4250/2
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

8 years agochan_sip: Incorrect display option Outbound reg. retry 403 61/4261/1
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

8 years agores/stasis: Add CLI commands for displaying/debugging ARI apps 64/4164/4
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

8 years agopjproject_bundled: Fix compile of pjsua so it handles audio 45/4245/1
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 _pjsua.so 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

8 years agomanager: Add documentation for NewConnectedLine event. 44/4244/1
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

8 years agoMerge "bundled pjproject: Crashes while resolving DNS names." into 13
Joshua Colp [Mon, 31 Oct 2016 16:37:55 +0000 (11:37 -0500)] 
Merge "bundled pjproject: Crashes while resolving DNS names." into 13

8 years agoMerge "astobj2: Declare private variable data_size for AO2_DEBUG only." into 13
zuul [Mon, 31 Oct 2016 15:13:45 +0000 (10:13 -0500)] 
Merge "astobj2: Declare private variable data_size for AO2_DEBUG only." into 13

8 years agovector: Prevent NULL argument to memcpy. 34/4234/1
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

8 years agoastobj2: Declare private variable data_size for AO2_DEBUG only. 33/4233/1
Corey Farrell [Sat, 29 Oct 2016 15:31:15 +0000 (11:31 -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

8 years agopjproject_bundled: Fix issue where "/version.mak" wasn't found 25/4225/1
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

8 years agoMerge "Fix shutdown crash caused by modules being left open." into 13
zuul [Fri, 28 Oct 2016 20:13:42 +0000 (15:13 -0500)] 
Merge "Fix shutdown crash caused by modules being left open." into 13

8 years agobundled pjproject: Crashes while resolving DNS names. 28/4228/1
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
patch.

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

0006-r5471-svn-backport-Various-fixes-for-DNS-IPv6.patch
0006-r5473-svn-backport-Fix-pending-query.patch

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.

0006-r5475-svn-backport-Remove-DNS-cache-entry.patch

ASTERISK-26344 #close
Reported by: Ian Gilmour

ASTERISK-26387 #close
Reported by: Harley Peters

Change-Id: I17fde80359e66f65a91341ceca58d914d0f61cc4

8 years agoSAC documentation: don't specify transports for endpoints and registrations 17/4217/1
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

8 years agoMerge "res_pjsip_sdp_rtp: Fix address family of explicit media_address." into 13
Joshua Colp [Fri, 28 Oct 2016 10:33:02 +0000 (05:33 -0500)] 
Merge "res_pjsip_sdp_rtp: Fix address family of explicit media_address." into 13

8 years agoFix shutdown crash caused by modules being left open. 14/4214/1
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

8 years agoMerge "pjsip: Fix a few media bugs with reinvites and asymmetric payloads." into 13
Joshua Colp [Thu, 27 Oct 2016 21:51:33 +0000 (16:51 -0500)] 
Merge "pjsip: Fix a few media bugs with reinvites and asymmetric payloads." into 13

8 years agoMerge "res_pjsip_caller_id: Fix crash on session timers UPDATE on inbound calls....
zuul [Thu, 27 Oct 2016 21:48:05 +0000 (16:48 -0500)] 
Merge "res_pjsip_caller_id: Fix crash on session timers UPDATE on inbound calls." into 13

8 years agoMerge "pjproject_bundled: Remove usage of tar's --strip-components option" into 13
zuul [Thu, 27 Oct 2016 20:05:15 +0000 (15:05 -0500)] 
Merge "pjproject_bundled:  Remove usage of tar's --strip-components option" into 13

8 years agoMerge "app_voicemail: Clear voice mailbox in MailboxExists and MAILBOX_EXISTS." into 13
zuul [Thu, 27 Oct 2016 18:26:59 +0000 (13:26 -0500)] 
Merge "app_voicemail: Clear voice mailbox in MailboxExists and MAILBOX_EXISTS." into 13

8 years agopjproject_bundled: Remove usage of tar's --strip-components option 99/4199/2
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

8 years agores_pjsip_caller_id: Fix crash on session timers UPDATE on inbound calls. 02/4202/1
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

8 years agoMerge "test_astobj2_thrash: Fix multithreaded issues" into 13
Joshua Colp [Wed, 26 Oct 2016 23:00:42 +0000 (18:00 -0500)] 
Merge "test_astobj2_thrash:  Fix multithreaded issues" into 13

8 years agoMerge "chan_pjsip: segfault on already disconnected session" into 13
Joshua Colp [Wed, 26 Oct 2016 14:14:39 +0000 (09:14 -0500)] 
Merge "chan_pjsip: segfault on already disconnected session" into 13

8 years agoapp_voicemail: Clear voice mailbox in MailboxExists and MAILBOX_EXISTS. 83/4183/1
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

8 years agopjsip: Fix a few media bugs with reinvites and asymmetric payloads. 72/4172/3
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

8 years agores_pjsip_sdp_rtp: Fix address family of explicit media_address. 80/4180/1
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.

ASTERISK-26309

Change-Id: Ib9350cc91c120eb2f96f0623d3907d12af67eb79

8 years agotest_astobj2_thrash: Fix multithreaded issues 78/4178/1
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

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

8 years agoMerge "pjproject_bundled: Fixed various build issues" into 13
zuul [Tue, 25 Oct 2016 02:55:30 +0000 (21:55 -0500)] 
Merge "pjproject_bundled:  Fixed various build issues" into 13

8 years agoMerge "typo: s/paranthesis/parenthesis/ in a comment" into 13
Joshua Colp [Mon, 24 Oct 2016 23:21:17 +0000 (18:21 -0500)] 
Merge "typo: s/paranthesis/parenthesis/ in a comment" into 13

8 years agoMerge "ARI: Detect duplicate channel IDs" into 13
Joshua Colp [Mon, 24 Oct 2016 23:20:33 +0000 (18:20 -0500)] 
Merge "ARI: Detect duplicate channel IDs" into 13

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

Change-Id: I7c1f4eb051177ee22cbe97e063d4a3effe29be30

8 years agopjproject_bundled: Fixed various build issues 65/4165/2
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

8 years agopjsip: Support dual stack automatically. 75/3975/6
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

8 years agoARI: Detect duplicate channel IDs 50/4150/3
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
needed.

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.

ASTERISK-26421

Change-Id: Ibba7ae68842dab6df0c2e9c45559208bc89d3d06

8 years agoFix issue with CLI not returning to prompt after running "features show" 62/4162/1
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

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

8 years agoMerge "res_rtp_asterisk: Add ice_blacklist option" into 13
zuul [Wed, 19 Oct 2016 20:02:16 +0000 (15:02 -0500)] 
Merge "res_rtp_asterisk: Add ice_blacklist option" into 13

8 years agoMerge "chan_sip: Support nat=auto_comedia or nat=force_rport,auto_comedia." into 13
zuul [Wed, 19 Oct 2016 15:57:01 +0000 (10:57 -0500)] 
Merge "chan_sip: Support nat=auto_comedia or nat=force_rport,auto_comedia." into 13

8 years agoMerge "CDR: Alter destruction pattern for CDR chains." into 13
Joshua Colp [Wed, 19 Oct 2016 13:31:42 +0000 (08:31 -0500)] 
Merge "CDR: Alter destruction pattern for CDR chains." into 13

8 years agores_rtp_asterisk: Add ice_blacklist option 23/4023/6
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 =
192.168.1.0/255.255.255.0, 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

8 years agoCDR: Alter destruction pattern for CDR chains. 51/4151/1
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

8 years agoMerge "cli: Auto-complete File not Module for core set debug." into 13
zuul [Tue, 18 Oct 2016 17:34:41 +0000 (12:34 -0500)] 
Merge "cli: Auto-complete File not Module for core set debug." into 13

8 years agoMerge "chan_rtp: Set a sane default rtp engine for unicast." into 13
zuul [Tue, 18 Oct 2016 17:24:52 +0000 (12:24 -0500)] 
Merge "chan_rtp: Set a sane default rtp engine for unicast." into 13

8 years agochan_pjsip: segfault on already disconnected session 42/4142/1
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

8 years agoMerge "menuselect: invalid test for GTK2" into 13
Joshua Colp [Tue, 18 Oct 2016 13:17:43 +0000 (08:17 -0500)] 
Merge "menuselect: invalid test for GTK2" into 13

8 years agocli: Auto-complete File not Module for core set debug. 39/4139/1
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.

ASTERISK-26480

Change-Id: I1213f1dd409bd4ff8de08ad80cb0c73cafb1bae0

8 years agoMerge "res/ari: Add the Asterisk EID field to outgoing events" into 13
zuul [Tue, 18 Oct 2016 04:58:30 +0000 (23:58 -0500)] 
Merge "res/ari: Add the Asterisk EID field to outgoing events" into 13

8 years agoMerge "app_queue: Added initialization for "context" parameter" into 13
zuul [Mon, 17 Oct 2016 20:45:43 +0000 (15:45 -0500)] 
Merge "app_queue: Added initialization for "context" parameter" into 13

8 years agomenuselect: invalid test for GTK2 32/4132/2
Tzafrir Cohen [Sun, 11 Sep 2016 15:13:00 +0000 (10:13 -0500)] 
menuselect: invalid test for GTK2

configuire.ac 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: I8079d515d6ea99f9ab320a7eaa71c2aaa101ccd5

8 years agopjproject_bundled: Add patch to address SSL crash 34/4134/2
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

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

ASTERISK-26439

Change-Id: I7f5ee2eeba8906e9ecb3293dbe3a747770bb5011

8 years agores/ari: Add the Asterisk EID field to outgoing events 15/4115/2
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

8 years agoutils.c: Fix ast_set_default_eid for multiple platforms 16/4116/2
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
interfaces.

Tested on:
FreeBSD9
CentOS6
Ubuntu14
Fedora24

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

Change-Id: Iaa6db87ca78a9a375e47d70e043ae08c1448cb72