]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
8 years agopjproject_bundled: Add MALLOC_DEBUG capability 38/4038/2
George Joseph [Wed, 5 Oct 2016 19:53:10 +0000 (13:53 -0600)] 
pjproject_bundled:  Add MALLOC_DEBUG capability

pjproject_bundled will now use the asterisk memory debugging APIs
if MALLOC_DEBUG is turned on in menuselect.

Because this required stubs for the executable programs and the python
bindings, some Makefile reorganization was needed to properly handle
the dependencies.  As a result, the makefile now individually makes
each of the pjproject libraries separately instead of making them all
in 1 shot.  The only visible change is that there are separate status
lines printed for each library instead oif 1 for all libs.  Also, the
making of the pjproject dependency files was eliminated.  They're not
needed for building unless you're actively modifying pjproject source
files and it makes the build process faster.  Finally, any issues with
parallel builds should be resolved again making the build faster.

NOTE:  The certified/13.8 version of this patch also builds libresample
which is needed by pjsua.  Later versions do not need libresample.

Change-Id: Icc5e3d658fbfb00e0a46b44c66dcc2522d5171b0

8 years agores_pjsip: Add ignore_uri_user_options option. 60/3860/2
Richard Mudgett [Mon, 29 Aug 2016 23:08:22 +0000 (18:08 -0500)] 
res_pjsip: Add ignore_uri_user_options option.

This implements the chan_sip legacy_useroption_parsing option but with a
better name.

* Made the caller-id number and redirecting number strings obtained from
incoming SIP URI user fields always truncated at the first semicolon.
People don't care about anything after the semicolon showing up on their
displays even though the RFC allows the semicolon.

ASTERISK-26316 #close
Reported by: Kevin Harwell

Change-Id: Ib42b0e940dd34d84c7b14bc2e90d1ba392624f62

8 years agoChangeLog: Updated for certified/13.8-cert3 certified/13.8-cert3
George Joseph [Thu, 8 Sep 2016 16:34:59 +0000 (11:34 -0500)] 
ChangeLog: Updated for certified/13.8-cert3

8 years agoRelease summaries: Add summaries for certified/13.8-cert3
George Joseph [Thu, 8 Sep 2016 16:34:57 +0000 (11:34 -0500)] 
Release summaries: Add summaries for certified/13.8-cert3

8 years agoRelease summaries: Remove previous versions
George Joseph [Thu, 8 Sep 2016 16:34:35 +0000 (11:34 -0500)] 
Release summaries: Remove previous versions

8 years ago.version: Update for certified/13.8-cert3
George Joseph [Thu, 8 Sep 2016 16:34:35 +0000 (11:34 -0500)] 
.version: Update for certified/13.8-cert3

8 years ago.lastclean: Update for certified/13.8-cert3
George Joseph [Thu, 8 Sep 2016 16:34:35 +0000 (11:34 -0500)] 
.lastclean: Update for certified/13.8-cert3

8 years agorealtime: Add database scripts for certified/13.8-cert3
George Joseph [Thu, 8 Sep 2016 16:34:35 +0000 (11:34 -0500)] 
realtime: Add database scripts for certified/13.8-cert3

8 years agochan_sip: Don't allocate new RTP instances on top of old ones.
Joshua Colp [Tue, 23 Aug 2016 11:35:11 +0000 (11:35 +0000)] 
chan_sip: Don't allocate new RTP instances on top of old ones.

In some scenarios dialog_initialize_rtp can be called multiple times on
the same dialog.  This can cause RTP instances to be leaked along with
multiple file descriptors for each instance.

This change makes it so the existing RTP instances are destroyed and
not overwritten, stopping the memory leak.

ASTERISK-26272 #close
patches:
  ASTERISK-26272-13.patch submitted by Corey Farrell (license 5909)

Change-Id: Id529de1184c68f2f4d254ab41a1f458dafdb5f73

8 years agoConfBridge: Make some announcements asynchronous. 06/3506/3
Mark Michelson [Wed, 10 Aug 2016 20:14:09 +0000 (15:14 -0500)] 
ConfBridge: Make some announcements asynchronous.

Confbridge announcements tend to block a channel while they are being
played. In some circumstances, this is warranted since you want that
particular channel not to hear the announcement (Example: "John Doe has
entered the conference"). For others it makes less sense.

This change first introduces methods for playing sounds asynchronously
into the conference. This is very similar to how synchronous sounds are
played, except the channel initiating the playback does not wait for the
sound to complete before moving on.

Asynchronous announcements are used for two circumstances:
* Sounds played for a user after they have left the bridge
* Sounds that play first to a single user and then the rest of the
  conference (if the channel and conference use the same language)

ASTERISK-26289 #close
Reported by Mark Michelson

Change-Id: Ie486bb3de1646d50894489030326a423e594ab0a

8 years agores_rtp_multicast: Fix SEGV in ast_multicast_rtp_create_options 94/3694/1
George Joseph [Wed, 24 Aug 2016 19:42:34 +0000 (13:42 -0600)] 
res_rtp_multicast:  Fix SEGV in ast_multicast_rtp_create_options

ast_multicast_rtp_create_options now checks for NULL or empty options

Change-Id: Ib845eae46a67a9787e89a87ebd1027344e5e0362

8 years agoConfBridge: Rework announcer channel methodology 89/3689/1
Mark Michelson [Wed, 10 Aug 2016 20:14:09 +0000 (15:14 -0500)] 
ConfBridge: Rework announcer channel methodology

NOTE: This patch was submitted earlier and reverted because of a failing
test. The test has been patched so that it adjusts for the changes here,
so this is being resubmitted for review.

One feature that confbridge has is the ability to play sounds to all
participants in the conference. Prior to this commit, the algorithm for
this was as follows:

* Grab the playback lock
* Push the conference announcer channel into the bridge
* Play back the sound
* Pull the conference announcer channel from the bridge
* Release the playback lock

The issue here is that the act of adding the playback channel to the
bridge and removing it for each announcement is expensive. Amongst the
expenses:

* The announcer channel is imparted into the bridge, meaning a new
  thread is spun up for each playback.
* When the announcer is added or removed from the bridge, it results
  in the BRIDGEPEER channel variable being set on all channels in the
  bridge. This requires keeping the bridge locked and locking each
  individual channel in order to set it.
* There's also just the general overhead of adding the channel and
  removing it from the bridge. The bridge potentially has to reconfigure
  every single time

With this commit, the paradigm for playing back announcements has
shifted.

* The announcer channel is now added to the bridge when the conference
  is allocated, and it is hung up when the conference is destroyed.
* A taskprocessor is used to queue playbacks onto the announcer channel.
  This keeps the behavior from before where playbacks do not overlap.
* The announcer channel is no longer placed into the bridge as
  departable. Since we are not constantly removing the channel from
  the bridge, it is safe to add the channel using an independent thread
  and simply hang the channel up when it is time for the conference to
  be destroyed.

The use of the taskprocessor for playbacks opens up the interesting
possibility of having asynchronous announcements played. In this commit,
however, the behavior is still exactly the same as it previously was.

ASTERISK-26289
Reported by Mark Michelson

Change-Id: Ica9fa4907c2f3728cdd1cf0bc564ef4eb40754a0

8 years agoMerge "Revert "ConfBridge: Rework announcer channel methodology"" into certified...
Joshua Colp [Tue, 23 Aug 2016 10:53:57 +0000 (05:53 -0500)] 
Merge "Revert "ConfBridge: Rework announcer channel methodology"" into certified/13.8

8 years agoRevert "ConfBridge: Rework announcer channel methodology" 75/3675/1
Joshua Colp [Tue, 23 Aug 2016 10:53:48 +0000 (05:53 -0500)] 
Revert "ConfBridge: Rework announcer channel methodology"

This reverts commit 4ca730127ccdc895e4d9e32cb0828c27bf74817b.

Change-Id: I8886feb69ae2dbf521a8c0937792349b70db52b2

8 years agoMerge "ConfBridge: Rework announcer channel methodology" into certified/13.8
Joshua Colp [Tue, 23 Aug 2016 09:39:34 +0000 (04:39 -0500)] 
Merge "ConfBridge: Rework announcer channel methodology" into certified/13.8

8 years agoConfBridge: Rework announcer channel methodology 05/3505/2
Mark Michelson [Wed, 10 Aug 2016 20:14:09 +0000 (15:14 -0500)] 
ConfBridge: Rework announcer channel methodology

One feature that confbridge has is the ability to play sounds to all
participants in the conference. Prior to this commit, the algorithm for
this was as follows:

* Grab the playback lock
* Push the conference announcer channel into the bridge
* Play back the sound
* Pull the conference announcer channel from the bridge
* Release the playback lock

The issue here is that the act of adding the playback channel to the
bridge and removing it for each announcement is expensive. Amongst the
expenses:

* The announcer channel is imparted into the bridge, meaning a new
  thread is spun up for each playback.
* When the announcer is added or removed from the bridge, it results
  in the BRIDGEPEER channel variable being set on all channels in the
  bridge. This requires keeping the bridge locked and locking each
  individual channel in order to set it.
* There's also just the general overhead of adding the channel and
  removing it from the bridge. The bridge potentially has to reconfigure
  every single time

With this commit, the paradigm for playing back announcements has
shifted.

* The announcer channel is now added to the bridge when the conference
  is allocated, and it is hung up when the conference is destroyed.
* A taskprocessor is used to queue playbacks onto the announcer channel.
  This keeps the behavior from before where playbacks do not overlap.
* The announcer channel is no longer placed into the bridge as
  departable. Since we are not constantly removing the channel from
  the bridge, it is safe to add the channel using an independent thread
  and simply hang the channel up when it is time for the conference to
  be destroyed.

The use of the taskprocessor for playbacks opens up the interesting
possibility of having asynchronous announcements played. In this commit,
however, the behavior is still exactly the same as it previously was.

ASTERISK-26289
Reported by Mark Michelson

Change-Id: Ic5cd2c4b98a1eaa1715eb7a5b35d62f1a76d78a5

8 years agores_pjsip: Add contact_user to endpoint 95/3595/1
George Joseph [Tue, 16 Aug 2016 20:36:10 +0000 (14:36 -0600)] 
res_pjsip:  Add contact_user to endpoint

contact_user, when specified on an endpoint, will override the user
portion of the Contact header on outgoing requests.

Change-Id: Icd4ebfda2f2e44d3ac749d0b4066630e988407d4

8 years agoalembic/sqlalchemy: auto increment only allowed on a single column 88/3588/1
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
key.

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
(cherry picked from commit f6ec94cca66addac71d566d6fa48188b407f26ba)

8 years agoChangeLog: Updated for certified/13.8-cert2 certified/13.8-cert2
Joshua Colp [Mon, 15 Aug 2016 13:27:32 +0000 (08:27 -0500)] 
ChangeLog: Updated for certified/13.8-cert2

8 years agoRelease summaries: Add summaries for certified/13.8-cert2
Joshua Colp [Mon, 15 Aug 2016 13:27:30 +0000 (08:27 -0500)] 
Release summaries: Add summaries for certified/13.8-cert2

8 years agoRelease summaries: Remove previous versions
Joshua Colp [Mon, 15 Aug 2016 13:27:09 +0000 (08:27 -0500)] 
Release summaries: Remove previous versions

8 years ago.version: Update for certified/13.8-cert2
Joshua Colp [Mon, 15 Aug 2016 13:27:09 +0000 (08:27 -0500)] 
.version: Update for certified/13.8-cert2

8 years ago.lastclean: Update for certified/13.8-cert2
Joshua Colp [Mon, 15 Aug 2016 13:27:09 +0000 (08:27 -0500)] 
.lastclean: Update for certified/13.8-cert2

8 years agorealtime: Add database scripts for certified/13.8-cert2
Joshua Colp [Mon, 15 Aug 2016 13:27:09 +0000 (08:27 -0500)] 
realtime: Add database scripts for certified/13.8-cert2

8 years agores_rtp_asterisk: Cache local RTCP address. 48/3448/1
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

9 years agoChangeLog: Updated for certified/13.8-cert2-rc1 certified/13.8-cert2-rc1
Joshua Colp [Mon, 1 Aug 2016 11:57:17 +0000 (06:57 -0500)] 
ChangeLog: Updated for certified/13.8-cert2-rc1

9 years agoRelease summaries: Add summaries for certified/13.8-cert2-rc1
Joshua Colp [Mon, 1 Aug 2016 11:57:15 +0000 (06:57 -0500)] 
Release summaries: Add summaries for certified/13.8-cert2-rc1

9 years agoRelease summaries: Remove previous versions
Joshua Colp [Mon, 1 Aug 2016 11:57:00 +0000 (06:57 -0500)] 
Release summaries: Remove previous versions

9 years ago.version: Update for certified/13.8-cert2-rc1
Joshua Colp [Mon, 1 Aug 2016 11:57:00 +0000 (06:57 -0500)] 
.version: Update for certified/13.8-cert2-rc1

9 years ago.lastclean: Update for certified/13.8-cert2-rc1
Joshua Colp [Mon, 1 Aug 2016 11:57:00 +0000 (06:57 -0500)] 
.lastclean: Update for certified/13.8-cert2-rc1

9 years agorealtime: Add database scripts for certified/13.8-cert2-rc1
Joshua Colp [Mon, 1 Aug 2016 11:57:00 +0000 (06:57 -0500)] 
realtime: Add database scripts for certified/13.8-cert2-rc1

9 years agoPJSIP: provide transport type with received messages 79/3379/1
Scott Griepentrog [Tue, 21 Jun 2016 15:53:05 +0000 (10:53 -0500)] 
PJSIP: provide transport type with received messages

The receipt of a SIP MESSAGE may occur over any transport including TCP
and TLS. When the message is received, the original URI is added to the
message in the field PJSIP_RECVADDR, but this is insufficient to ensure
a reply message can reach the originating endpoint. This patch adds the
PJSIP_TRANSPORT field populated with the transport type.

ASTERISK-26132 #close

Change-Id: I28c4b1e40d573a056c81deb213ecf53e968f725e
(cherry picked from commit 69d58a1e377938e5236f51200e222eb219739441)

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

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

* Add needed minimum threshold test to tone_detect().

* Set TONE_THRESHOLD to allow low volume frequency spread detection.

ASTERISK-26237 #close
Reported by: Richard Mudgett

Change-Id: I84dbba7f7628fa13720add6a88eae3b129e066fc

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

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

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

ASTERISK-23013 #close

Change-Id: Id9980419909e811f89484950ed46ef117b9eb990

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

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

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

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

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

ASTERISK-26214 #close
Reported by: Richard Mudgett

Change-Id: Idc5e698dfe33572de9840bc68cd9fc043cbad976

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

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

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

ASTERISK-26214
Reported by: Richard Mudgett

Change-Id: Ieffd3fe788788d56282844774365546dce8ac810

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

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

ASTERISK-26214
Reported by: Richard Mudgett

Change-Id: Id5a87375fb2c4f9dc1d4b44c78ec8735ba65453d

9 years agoChangeLog: Updated for certified/13.8-cert1 certified/13.8-cert1
Joshua Colp [Wed, 13 Jul 2016 14:09:46 +0000 (09:09 -0500)] 
ChangeLog: Updated for certified/13.8-cert1

9 years agoRelease summaries: Add summaries for certified/13.8-cert1
Joshua Colp [Wed, 13 Jul 2016 14:08:58 +0000 (09:08 -0500)] 
Release summaries: Add summaries for certified/13.8-cert1

9 years agoRelease summaries: Remove previous versions
Joshua Colp [Wed, 13 Jul 2016 13:34:13 +0000 (08:34 -0500)] 
Release summaries: Remove previous versions

9 years ago.version: Update for certified/13.8-cert1
Joshua Colp [Wed, 13 Jul 2016 13:34:13 +0000 (08:34 -0500)] 
.version: Update for certified/13.8-cert1

9 years ago.lastclean: Update for certified/13.8-cert1
Joshua Colp [Wed, 13 Jul 2016 13:34:12 +0000 (08:34 -0500)] 
.lastclean: Update for certified/13.8-cert1

9 years agorealtime: Add database scripts for certified/13.8-cert1
Joshua Colp [Wed, 13 Jul 2016 13:34:12 +0000 (08:34 -0500)] 
realtime: Add database scripts for certified/13.8-cert1

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

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

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

ASTERISK-26179 #close

Change-Id: I0298494d3da6df3219bbfa4be9aa04015043145c

9 years agores_rtp_asterisk: Fix a self-comparison identified by gcc 6 23/3123/2
George Joseph [Wed, 22 Jun 2016 18:41:57 +0000 (12:41 -0600)] 
res_rtp_asterisk:  Fix a self-comparison identified by gcc 6

gcc 6 caught a previously unidentified self-comparison in
ice_candidate_cmp.  Fixed it and re-ordered the predicates for better
short-circuiting.

ASTERISK-26140 #close

Change-Id: I3da713c568e24064430257b3502fbdafd35af7a7

9 years agoconfigure: Fix HAVE_PJSIP_EVSUB_GRP_LOCK not set with external pjproject 15/3115/1
George Joseph [Thu, 30 Jun 2016 13:25:09 +0000 (07:25 -0600)] 
configure:  Fix HAVE_PJSIP_EVSUB_GRP_LOCK not set with external pjproject

There was a typo in configure.ac preventing HAVE_PJSIP_EVSUB_GRP_LOCK
from getting set when using an external pjproject.

ASTERISK-26099 #close
Reported-by: Ross Beer
Change-Id: I709af70428e125fb5ccd44b171d25dd29141f0ae

9 years agoBuildSystem: Fix a few issues hightlighted by gcc 6.x 01/3101/1
George Joseph [Tue, 28 Jun 2016 13:22:24 +0000 (07:22 -0600)] 
BuildSystem:  Fix a few issues hightlighted by gcc 6.x

gcc 6.1.1 caught a few more issues.
Made sure the unit tests still pass for the func_env and stdtime
issues.

ASTERISK-26157 #close

Change-Id: I6664d8f34a45bc1481d2a854481c7878b0c1cf8e

9 years agoChangeLog: Updated for certified/13.8-cert1-rc3 certified/13.8-cert1-rc3
Mark Michelson [Wed, 22 Jun 2016 21:15:11 +0000 (16:15 -0500)] 
ChangeLog: Updated for certified/13.8-cert1-rc3

9 years agoRelease summaries: Add summaries for certified/13.8-cert1-rc3
Mark Michelson [Wed, 22 Jun 2016 21:15:10 +0000 (16:15 -0500)] 
Release summaries: Add summaries for certified/13.8-cert1-rc3

9 years agoRelease summaries: Remove previous versions
Mark Michelson [Wed, 22 Jun 2016 21:14:14 +0000 (16:14 -0500)] 
Release summaries: Remove previous versions

9 years ago.version: Update for certified/13.8-cert1-rc3
Mark Michelson [Wed, 22 Jun 2016 21:14:13 +0000 (16:14 -0500)] 
.version: Update for certified/13.8-cert1-rc3

9 years ago.lastclean: Update for certified/13.8-cert1-rc3
Mark Michelson [Wed, 22 Jun 2016 21:14:13 +0000 (16:14 -0500)] 
.lastclean: Update for certified/13.8-cert1-rc3

9 years agorealtime: Add database scripts for certified/13.8-cert1-rc3
Mark Michelson [Wed, 22 Jun 2016 21:14:13 +0000 (16:14 -0500)] 
realtime: Add database scripts for certified/13.8-cert1-rc3

9 years agoMerge "build: Fix ast_sockaddr initialization to be more portable" into certified...
Joshua Colp [Wed, 22 Jun 2016 10:11:33 +0000 (05:11 -0500)] 
Merge "build:  Fix ast_sockaddr initialization to be more portable" into certified/13.8

9 years agobuild: Fix ast_sockaddr initialization to be more portable 60/3060/2
George Joseph [Thu, 9 Jun 2016 14:20:33 +0000 (08:20 -0600)] 
build:  Fix ast_sockaddr initialization to be more portable

A change to glibc 2.22 changed the order of the sockadddr_storage
members which caused the places where we do an initialization of
ast_sockaddr with '{ { 0, 0, } }' to fail compilation.  Those
initializers (which we shouldn't have been using anyway) have been
replaced with memsets.

Change-Id: Idd1b3b320903d8771bfe221f0b015685de628fa4

9 years agores_pjsip_pubsub: Address SEGV when attempting to terminate a subscription 61/3061/1
George Joseph [Sun, 12 Jun 2016 16:19:27 +0000 (10:19 -0600)] 
res_pjsip_pubsub: Address SEGV when attempting to terminate a subscription

Occasionally under load we'll attempt to send a final NOTIFY on a
subscription that's already been terminated and a SEGV will occur
down in pjproject's evsub_destroy function.  This is a result of a
race condition between all the paths that can generate a notify
and/or destroy the underlying pjproject evsub object:

 * The client can send a SUBSCRIBE with Expires: 0.
 * The client can send a SUBSCRIBE/refresh.
 * The subscription timer can expire.
 * An extension state can change.
 * An MWI event can be generated.
 * The pjproject transaction timer (timer_b) can expire.

Normally when our pubsub_on_evsub_state is called with a terminate,
we push a task to the serializer and return at which point the dialog
is unlocked.  This is usually not a problem because the task runs
immediately and locks the dialog again.  When the system is heavily
loaded though, there may be a delay between the unlock and relock
during which another event may occur such as the subscription timer
or timer_b expiring, an extension state change, etc.  These may also
cause a terminate to be processed and if so, we could cause pjproject
to try to destroy the evsub structure twice.  There's no way for us to
tell that the evsub was already destroyed and the evsub's group lock
can't tolerate this and SEGVs.

The remedy is twofold.

 * A patch has been submitted to Teluu and added to the bundled
   pjproject which adds add/decrement operations on evsub's group lock.

 * In res_pjsip_pubsub:
   * configure.ac and pjproject-bundled's configure.m4 were updated
     to check for the new evsub group lock APIs.
   * We now add a reference to the evsub group lock when we create
     the subscription and remove the reference when we clean up the
     subscription.  This prevents evsub from being destroyed before
     we're done with it.
   * A state has been added to the subscription tree structure so
     termination progress can be tracked through the asyncronous tasks.
   * The pubsub_on_evsub_state callback has been split so it's not doing
     double duty.  It now only handles the final cleanup of the
     subscription tree.  pubsub_on_rx_refresh now handles both client
     refreshes and client terminates.  It was always being called for
     both anyway.
   * The serialized_on_server_timeout task was removed since
     serialized_pubsub_on_rx_refresh was almost identical.
   * Missing state checks and ao2_cleanups were added.
   * Some debug levels were adjusted to make seeing only off-nominal
     things at level 1 and nominal or progress things at level 2+.

ASTERISK-26099 #close
Reported-by: Ross Beer.
Change-Id: I779d11802cf672a51392e62a74a1216596075ba1

9 years agores_rtp_multicast.c: Fix warning message typo. 22/3022/1
Richard Mudgett [Mon, 13 Jun 2016 18:33:53 +0000 (13:33 -0500)] 
res_rtp_multicast.c: Fix warning message typo.

Change-Id: Ic9928208b9957e09866abe3d9649030942ec52b3

9 years agochan_rtp: Backport changes from master. 15/3015/1
Richard Mudgett [Fri, 10 Jun 2016 17:35:33 +0000 (12:35 -0500)] 
chan_rtp: Backport changes from master.

* Deprecate chan_multicast_rtp.

Change-Id: Ib5a45e58c75ee8abd0b4f9575379b5321feb853e

9 years agochan_rtp.c: Copy file from chan_multicast_rtp.c 14/3014/1
Richard Mudgett [Fri, 10 Jun 2016 21:13:04 +0000 (16:13 -0500)] 
chan_rtp.c: Copy file from chan_multicast_rtp.c

Change-Id: I1119b53f2152ab1cbec74b5be7ea44844dbda8ef

9 years agores_pjsip_registrar.c: Eliminate rx REGISTER request race condition. 01/3001/1
Richard Mudgett [Sat, 4 Jun 2016 03:44:46 +0000 (22:44 -0500)] 
res_pjsip_registrar.c: Eliminate rx REGISTER request race condition.

This patch fixes a race condition processing received REGISTER requests
and their retransmissions caused by REGISTER requests being processed by
two threads.  The "sip_transaction Unable to register REGISTER transaction
(key exists)" message is a notable symptom of this issue.

This issue was more likely to happen before the pjsip/distributor
serializers were created.  Instead of steps one and two below placing the
REGISTER messages into the same pjsip/distributor they were placed in
random pjsip/default serializers.

1) REGISTER requests come in and get placed on the pjsip/distributor
serializer.

2) Before the first request is processed a retransmission comes in and is
placed on the same pjsip/distributor serializer.

3) The first request goes up the pjsip stack and is then shunted off to
the pjsip/aor/<aor> serializer.

4) Before the first request is completed processing in the pjsip/aor/<aor>
serializer, the second request goes up the pjsip stack and is also shunted
off to the pjsip/aor/<aor> serializer.

5) The first request completes processing and sends out its response.

6) The second request completes processing and tries to send out its
response but pjlib complains that the REGISTER transaction key already
exists.

7) Sadness ensues.

* The race is eliminated by removing the pjsip/aor/<aor> serializer and
continuing the processing in the pjsip/distributor serializer.  Now any
retransmissions queued in the pjsip/distributor serializer will be
processed after the first message is completely processed.

ASTERISK-26088 #close
Reported by:  Richard Mudgett

Change-Id: I842d714346088bf717ea27437f1dd85bff0bab5a

9 years agostasis: Add setting subscription congestion levels. 00/3000/1
Richard Mudgett [Fri, 3 Jun 2016 16:35:49 +0000 (11:35 -0500)] 
stasis: Add setting subscription congestion levels.

Stasis subscriptions and message routers create taskprocessors to process
the event messages.  API calls are needed to be able to set the congestion
levels of these taskprocessors for selected subscriptions and message
routers.

* Updated CDR, CEL, and manager's stasis subscription congestion levels
based upon stress testing.  Increased the congestion levels to reduce the
potential for bursty call setup/teardown activity from triggering the
taskprocessor overload alert.  CDRs in particular need an extra high
congestion level because they can take awhile to process the stasis
messages.

ASTERISK-26088
Reported by:  Richard Mudgett

Change-Id: Id0a716394b4eee746dd158acc63d703902450244

9 years agosorcery: Add setting object type congestion levels. 99/2999/1
Richard Mudgett [Thu, 2 Jun 2016 23:19:13 +0000 (18:19 -0500)] 
sorcery: Add setting object type congestion levels.

Sorcery creates taskprocessors for object types to process object observer
callbacks.  An API call is needed to be able to set the congestion levels
of these taskprocessors for selected object types.

* Updated PJSIP's contact and contact_status sorcery object type observer
default congestion levels based upon stress testing.  Increased the
congestion levels to reduce the potential for bursty register/unregister
and subscribe/unsubscribe activity from triggering the taskprocessor
overload alert.

ASTERISK-26088
Reported by:  Richard Mudgett

Change-Id: I4542e83b556f0714009bfeff89505c801f1218c6

9 years agotaskprocessors: Implement high/low water mark alerts. 98/2998/1
Richard Mudgett [Thu, 2 Jun 2016 21:08:19 +0000 (16:08 -0500)] 
taskprocessors: Implement high/low water mark alerts.

When taskprocessors get backed up, there is a good chance that we are
being overloaded and need to defer adding new work to the system.

* Implemented a high/low water alert mechanism for modules to check if the
system is being overloaded and take appropriate action.  When a
taskprocessor is created it has default congestion levels set.  A
taskprocessor can later have those congestion levels altered for specific
needs if stress testing shows that the taskprocessor is a symptom of
overloading or needs to handle bursty activity without triggering an
overload alert.

* Add CLI "core show taskprocessor" low/high water columns.

* Fixed __allocate_taskprocessor() to not use RAII_VAR().  RAII_VAR() was
never a good thing to use when creating a taskprocessor because of the
nature of how its references needed to be cleaned up on a partial
creation.

* Made res_pjsip's distributor check if the taskprocessor overload alert
is active before placing a message representing brand new work onto a
distributor serializer.

ASTERISK-26088
Reported by:  Richard Mudgett

Change-Id: I182f1be603529cd665958661c4c05ff9901825fa

9 years agores_pjsip_session: Use distributor serializer for incoming calls. 97/2997/1
Richard Mudgett [Fri, 27 May 2016 22:31:52 +0000 (17:31 -0500)] 
res_pjsip_session: Use distributor serializer for incoming calls.

We must continue using the serializer that the original INVITE came in on
for the dialog.  There may be retransmissions already enqueued in the
original serializer that can result in reentrancy and message sequencing
problems.

Outgoing call legs create the pjsip/outsess/<endpoint> serializers for
their dialogs.

ASTERISK-26088
Reported by:  Richard Mudgett

Change-Id: I24d7948749c582b8045d5389ba3f6588508adbbc

9 years agores_pjsip_pubsub.c: Recreate subscriptions using distributor serializer. 96/2996/1
Richard Mudgett [Fri, 27 May 2016 21:28:39 +0000 (16:28 -0500)] 
res_pjsip_pubsub.c: Recreate subscriptions using distributor serializer.

* Resolves potential reentrancy problems if system restarted in the middle
of subscription message transactions.

* Fixes memory leak recreating persistent subscriptions when the
subscription resource tree could not be created.

ASTERISK-26088
Reported by:  Richard Mudgett

Change-Id: I71e34d7ae8ed35a694f1030e820e2548c48697be

9 years agores_pjsip_pubsub.c: Use distributor serializer for incoming subscriptions. 95/2995/1
Richard Mudgett [Fri, 27 May 2016 17:50:14 +0000 (12:50 -0500)] 
res_pjsip_pubsub.c: Use distributor serializer for incoming subscriptions.

We must continue using the serializer that the original SUBSCRIBE came in
on for the dialog.  There may be retransmissions already enqueued in the
original serializer that can result in reentrancy and message sequencing
problems.  The "sip_transaction Unable to register SUBSCRIBE transaction
(key exists)" message is a notable symptom of this issue.

Outgoing subscriptions still create the pjsip/pubsub/<endpoint>
serializers for their dialogs.

ASTERISK-26088
Reported by:  Richard Mudgett

Change-Id: I18b00bb74a56747b2c8c29543a82440b110bf0b0

9 years agopjsip_distributor.c: Consistently pick a serializer for messages. 94/2994/1
Richard Mudgett [Thu, 26 May 2016 22:35:04 +0000 (17:35 -0500)] 
pjsip_distributor.c: Consistently pick a serializer for messages.

Incoming messages that are not part of a dialog or a recognized response
to one of our requests need to be sent to a consistent serializer.  Under
load we may be queueing retransmissions before we can process the original
message.  We don't need to throw these messages onto random serializers
and cause reentrancy and message sequencing problems.

* Created a pool of pjsip/distributor serializers that get picked by
hashing the call-id and remote tag strings of the received messages.

* Made ast_sip_destroy_distributor() destroy items in the reverse order of
creation.

ASTERISK-26088
Reported by:  Richard Mudgett

Change-Id: I2ce769389fc060d9f379977f559026fbcb632407

9 years agopjsip_distributor.c: Ignore messages until fully booted. 93/2993/1
Richard Mudgett [Thu, 2 Jun 2016 17:51:31 +0000 (12:51 -0500)] 
pjsip_distributor.c: Ignore messages until fully booted.

We should not be processing any incoming messages until we are fully
booted.  We may not have dialplan or other needed configuration loaded
yet.

ASTERISK-26089 #close
Reported by: Scott Griepentrog

ASTERISK-26088
Reported by:  Richard Mudgett

Change-Id: I584aefb4f34b885a8927e1f13a2c64babd606264

9 years agores_pjsip contact: Lock expiration/addition of contacts 92/2992/1
George Joseph [Fri, 1 Apr 2016 18:30:56 +0000 (12:30 -0600)] 
res_pjsip contact:  Lock expiration/addition of contacts

Contact expiration can occur in several places:  res_pjsip_registrar,
res_pjsip_registrar_expire, and automatically when anyone calls
ast_sip_location_retrieve_aor_contact.  At the same time, res_pjsip_registrar
may also be attempting to renew or add a contact.  Since none of this was locked
it was possible for one thread to be renewing a contact and another thread to
expire it immediately because it was working off of stale data.  This was the
casue of intermittent registration/inbound/nominal/multiple_contacts test
failures.

Now, the new named lock functionality is used to lock the aor during contact
expire and add operations and res_pjsip_registrar_expire now checks the
expiration with the lock held before deleting the contact.

ASTERISK-25885 #close
Reported-by: Josh Colp
Change-Id: I83d413c46a47796f3ab052ca3b349f21cca47059

9 years agolock: Add named lock capability 91/2991/1
George Joseph [Fri, 1 Apr 2016 01:04:29 +0000 (19:04 -0600)] 
lock:  Add named lock capability

Locking some objects like sorcery objects can be tricky because the underlying
ao2 object may not be the same for all callers.  For instance, two threads that
call ast_sorcery_retrieve_by_id on the same aor name might actually get 2
different ao2 objects if the underlying wizard had to rehydrate the aor from a
database. Locking one ao2 object doesn't have any effect on the other even if
those objects had locks in the first place.

Named locks allow access control by keyspace and key strings.  Now an "aor"
named "1000" can be locked and any other thread attempting to lock "aor" "1000"
will wait regardless of whether the underlying ao2 object is the same or not.
Mutex and rwlocks are supported.

This capability will initially be used to lock an aor when multiple threads may
be attempting to prune expired contacts from it.

Change-Id: If258c0b7f92b02d07243ce70e535821a1ea7fb45

9 years agores_odbc: Implement a connection pool. 44/2944/4
Joshua Colp [Thu, 2 Jun 2016 17:04:45 +0000 (14:04 -0300)] 
res_odbc: Implement a connection pool.

Testing has shown that our usage of UnixODBC is problematic
due to bugs within UnixODBC itself as well as the heavy weight
cost of connecting and disconnecting database connections, even
when pooling is enabled.

For users of UnixODBC 2.3.1 and earlier crashes would occur due
to insufficient protection of the disconnect operation. This was
fixed in UnixODBC 2.3.2 and above.

For users of UnixODBC 2.3.3 and higher a slow-down would occur
under heavy database use due to repeated connection establishment.
A regression is present where on each connection the database
configuration is cached again, with the cache growing out of
control.

The connection pool implementation present in this change helps
to mitigate these issues by reducing how much we connect and
disconnect database connections. We also solve the issue of
crashes under UnixODBC 2.3.1 by defaulting the maximum number of
connections to 1, returning us to the previous working behavior.
For users who may have a fixed version the maximum concurrent
connection limit can be increased helping with performance.

The connection pool works by keeping a list of active connections.
If the connection limit has not been reached a new connection is
established. If the connection limit has been reached then the
request waits until a connection becomes available before
continuing.

ASTERISK-26074 #close
ASTERISK-26054 #close

Change-Id: I6774bf4bac49a0b30242c76a09c403d2e856ecff

9 years agopjproject_bundled: Move to pjproject 2.5 41/2941/1
George Joseph [Mon, 30 May 2016 15:58:35 +0000 (09:58 -0600)] 
pjproject_bundled:  Move to pjproject 2.5

Although all the patches we had against 2.4.5 were applied by Teluu,
a new bug was introduced preventing re-use of tcp and tls transports
This patch removes all the previous patches against 2.4.5, updates
the version to 2.5, and adds a new patch to correct the transport
re-use problem.

Change-Id: I0dc6c438c3910f7887418a5832ca186aea23d068
(cherry picked from commit e8abfdcdc5ce4d32d1fe281e75b13fd652f9e5f7)

9 years agoMerge "udptl: Don't eat sequence numbers until OK is received" into certified/13.8
zuul [Thu, 19 May 2016 06:23:25 +0000 (01:23 -0500)] 
Merge "udptl:  Don't eat sequence numbers until OK is received" into certified/13.8

9 years agoudptl: Don't eat sequence numbers until OK is received 72/2872/3
George Joseph [Wed, 18 May 2016 12:54:14 +0000 (06:54 -0600)] 
udptl:  Don't eat sequence numbers until OK is received

Scenario:
Local fax -> Asterisk w/ firewall -> Provider -> Remote fax

* Local fax starts rtp call to remote fax
* Remote fax starts t38 call back to local fax.
* Local fax sends t38 no-signal to Asterisk before sending an OK.
* udptl processes the frame and increments the expected sequence number.
* chan_sip drops the frame because the call isn't up so nothing goes out
  the external interface to open the port for incoming packets.
* Local fax sends OK and Asterisk sends OK to the remote fax.
* Remote fax sends t38 packets which are dropped by the firewall.
* Local fax re-sends t38 no-signal with the same sequence number.
* udptl drops the frame because it thinks it's a dup.
* Still no outgoing packets to open the firewall.
* t38 negotiation fails.

The patch drops frames t38 received before udptl sequence processing
when the call hasn't been answered yet.  The second no-signal frame
is then seen as new and is relayed out the external interface which
opens the port and allows negotiation to continue.

ASTERISK-26034 #close

Change-Id: I11744b39748bd2ecbbe8ea84cdb4f3c5943c5af9

9 years agochan_sip: Prevent extra Session-Expires headers from being added 57/2857/2
George Joseph [Tue, 17 May 2016 16:14:51 +0000 (10:14 -0600)] 
chan_sip:  Prevent extra Session-Expires headers from being added

When chan_sip does a re-INVITE to refresh a session and authentication
is required, the INVITE with the Authorization header containes a
second Session-Expires header without the ";refersher=" parameter.
This is causing some proxies to return a 400.  Also, when Asterisk is
the uas and the refresher, it is including the Session-Expires and
Min-SE headers in OPTIONS messages which is not allowed per RFC4028.

This patch (based on the reporter's) Checks to see if a Session-Expires
header is already in the message before adding another one.  It also
checks that the method is INVITE or UPDATE.

ASTERISK-26030 #close

Change-Id: I58a7b07bab5a3177748d8a7034fb8ad8e11ce1d9

9 years agoconfig_transport: Tell pjproject to allow all SSL/TLS protocols 30/2830/1
George Joseph [Sat, 7 May 2016 19:39:25 +0000 (13:39 -0600)] 
config_transport:  Tell pjproject to allow all SSL/TLS protocols

The default tls settings for pjproject only allow TLS 1, TLS 1.1 and TLS 1.2.
SSL is not allowed.   So, even if you specify "sslv3" for a transport method,
it's silently ignored and one of the TLS protocols is used.  This was a new
behavior of pjsip_tls_setting_default() in 2.4 (when tls.proto was added) that
we never caught.

Now we need to set tls.proto = 0 after we call pjsip_tls_setting_default().
This tells pjproject to set the socket protocol to match the method.

ASTERISK-26004 #close

Change-Id: Icfb55c1ebe921298dedb4b1a1d3bdc3ca41dd078

9 years agores_pjsip_authenticator_digest: Don't use source port in nonce verification 72/2772/2
Kevin Harwell [Thu, 5 May 2016 16:37:37 +0000 (11:37 -0500)] 
res_pjsip_authenticator_digest: Don't use source port in nonce verification

From the issue reporter:
"res_pjsip_outbound_authenticator_digest builds a nonce that is a hash of
the timestamp, the source address, the source port, a server UUID that is
calculated at startup, and the authentication realm.

Rather than caching nonces that we create, we instead attempt to re-calculate
the nonce when receiving an incoming request with authentication. We then
compare the re-calculated nonce to the incoming nonce, and if they don't match,
then authentication has failed early.

The problem is that it is possible, especially when using TCP, to receive two
requests from the same endpoint but have differing source ports for those
requests. Asterisk itself commonly will use different source ports for
outbound TCP requests."

This patch removes the source port dependency when building the nonce.

ASTERISK-25978 #close

Change-Id: I871b5f4adce102df1c4988066283095ec509dffe

9 years agofile: Ensure nativeformats remains valid for lifetime of use. 64/2764/2
Joshua Colp [Thu, 5 May 2016 10:07:50 +0000 (07:07 -0300)] 
file: Ensure nativeformats remains valid for lifetime of use.

It is possible for the nativeformats of a channel to change
throughout its lifetime. As a result a user of it needs to either
ensure the channel is locked when accessing the formats or keep
a reference to the nativeformats themselves.

This change fixes the file playback support so it keeps a
reference to the nativeformats when accessing things.

ASTERISK-25998 #close

Change-Id: Ie45b65475e1481ddf05b874ee48f63e39fff8915

9 years agoChangeLog: Updated for certified/13.8-cert1-rc2 certified/13.8-cert1-rc2
Joshua Colp [Tue, 3 May 2016 12:55:28 +0000 (07:55 -0500)] 
ChangeLog: Updated for certified/13.8-cert1-rc2

9 years agoRelease summaries: Add summaries for certified/13.8-cert1-rc2
Joshua Colp [Tue, 3 May 2016 12:55:27 +0000 (07:55 -0500)] 
Release summaries: Add summaries for certified/13.8-cert1-rc2

9 years agoRelease summaries: Remove previous versions
Joshua Colp [Tue, 3 May 2016 12:54:57 +0000 (07:54 -0500)] 
Release summaries: Remove previous versions

9 years ago.version: Update for certified/13.8-cert1-rc2
Joshua Colp [Tue, 3 May 2016 12:54:57 +0000 (07:54 -0500)] 
.version: Update for certified/13.8-cert1-rc2

9 years ago.lastclean: Update for certified/13.8-cert1-rc2
Joshua Colp [Tue, 3 May 2016 12:54:56 +0000 (07:54 -0500)] 
.lastclean: Update for certified/13.8-cert1-rc2

9 years agorealtime: Add database scripts for certified/13.8-cert1-rc2
Joshua Colp [Tue, 3 May 2016 12:54:56 +0000 (07:54 -0500)] 
realtime: Add database scripts for certified/13.8-cert1-rc2

9 years agores_pjsip: disable multi domain to improve realtime performace 34/2734/1
Alexei Gradinari [Fri, 15 Apr 2016 16:59:42 +0000 (12:59 -0400)] 
res_pjsip: disable multi domain to improve realtime performace

This patch added new global pjsip option 'disable_multi_domain'.
Disabling Multi Domain can improve Realtime performance by reducing
number of database requests.

ASTERISK-25930 #close

Change-Id: I2e7160f3aae68475d52742107949a799aa2c7dc7

9 years agoapp_queue: Fix crash when unloading module. 07/2707/1
Joshua Colp [Tue, 26 Apr 2016 10:48:40 +0000 (07:48 -0300)] 
app_queue: Fix crash when unloading module.

When unloading the app_queue module the members in each queue are
destroyed and as part of this they are removed from the pending
members container. Unfortunately a crash would occur as the container
was destroyed before the members were removed.

This change tweaks ordering so the container destruction occurs
after the members are destroyed.

ASTERISK-16115

Change-Id: I48c728668c55aee3d05b751a5d450fb57e87f44b

9 years agoMerge "app_queue: queue members can receive multiple calls" into certified/13.8
Joshua Colp [Mon, 25 Apr 2016 20:26:44 +0000 (15:26 -0500)] 
Merge "app_queue: queue members can receive multiple calls" into certified/13.8

9 years agoapp_queue: queue members can receive multiple calls 98/2698/1
Kevin Harwell [Thu, 21 Apr 2016 19:23:21 +0000 (14:23 -0500)] 
app_queue: queue members can receive multiple calls

It was possible for a queue member that is a member of at least 2 or more
queues to receive mulitiple calls at the same time. This happened because
of a race between when a member was being rung and when the device state
notified the other queue(s) member object of the state change.

This patch makes it so when a queue member is being rung it gets added to
a global pool of queue members. If that same member is tried again, e.g.
from another queue, and it is found to already exist in the pending member
container then it will not ring that member.

ASTERISK-16115 #close

Change-Id: I546dd474776d158c2b6be44205353dee5bac7e48

9 years agores_agi: Prevent run_agi from eating frames it shouldn't 90/2690/3
George Joseph [Fri, 22 Apr 2016 22:53:23 +0000 (16:53 -0600)] 
res_agi:  Prevent run_agi from eating frames it shouldn't

The run_agi function is eating control frames when it shouldn't be. This is
causing issues when an AGI is run from CONNECTED_LINE_SEND_SUB in a blond
transfer.

Alice calls Bob. Bob attended transfers to Charlie but hangs up before Charlie
answers.

Alice gets the COLP UPDATE indicating Charlie but Charlie never gets an UPDATE
and is left thinking he's connected to Bob.

In this case, when CONNECTED_LINE_SEND_SUB runs on Alice's channel and it calls
an AGI, the extra eaten frames prevent CONNECTED_LINE_SEND_SUB from running on
Charlie's channel.

The fix was to accumulate deferrable frames in the "forever" loop instead of
dropping them, and re-queue them just before running the actual agi command
or exiting.

ASTERISK-25951 #close

Change-Id: I0f4bbfd72fc1126c2aaba41da3233a33d0433645

9 years agoMerge "res_stasis: Handle re-enter stasis bridge with swap channel." into certified...
zuul [Fri, 22 Apr 2016 22:08:00 +0000 (17:08 -0500)] 
Merge "res_stasis: Handle re-enter stasis bridge with swap channel." into certified/13.8

9 years agoMerge "bridge: Hold off more than one imparting channel at a time." into certified...
zuul [Fri, 22 Apr 2016 21:47:33 +0000 (16:47 -0500)] 
Merge "bridge: Hold off more than one imparting channel at a time." into certified/13.8

9 years agores_stasis: Handle re-enter stasis bridge with swap channel. 72/2672/1
Richard Mudgett [Fri, 15 Apr 2016 19:36:59 +0000 (14:36 -0500)] 
res_stasis: Handle re-enter stasis bridge with swap channel.

We lose the fact that there is a swap channel if there is one.  We
currently wind up rejoining the stasis bridge as a normal join after the
swap channel has already been kicked from the bridge.

This patch preserves the swap channel so the AMI/ARI events can note that
the channel joining the bridge is swapping with another channel.  Another
benefit to swaqpping in one operation is if there are any channels that
get lonely (MOH, bridge playback, and bridge record channels).  The lonely
channels won't leave before the joining channel has a chance to come back
in under stasis if the swap channel is the only reason the lonely channels
are staying in the bridge.

ASTERISK-25947 #close
Reported by: Richard Mudgett

ASTERISK-24649
Reported by: John Bigelow

ASTERISK-24782
Reported by: John Bigelow

Change-Id: If37ea508831d1fed6dbfac2f191c638fc0a850ee

9 years agobridge: Hold off more than one imparting channel at a time. 71/2671/1
Richard Mudgett [Tue, 19 Apr 2016 21:58:32 +0000 (16:58 -0500)] 
bridge: Hold off more than one imparting channel at a time.

An earlier patch blocked the ast_bridge_impart() call until the channel
either entered the target bridge or it failed.  Unfortuantely, if the
target bridge is stasis and the imprted channel is not a stasis channel,
stasis bounces the channel out of the bridge to come back into the bridge
as a proper stasis channel.  When the channel is bounced out, that
released the block on ast_bridge_impart() to continue.  If the impart was
a result of a transfer, then it became a race to see if the swap channel
would get hung up before the imparted channel could come back into the
stasis bridge.  If the imparted channel won then everything is fine.  If
the swap channel gets hung up first then the transfer will fail because
the swap channel is leaving the bridge.

* Allow a chain of ast_bridge_impart()'s to happen before any are
unblocked to prevent the race condition described above.  When the channel
finally joins the bridge or completely fails to join the bridge then the
ast_bridge_impart() instances are unblocked.

ASTERISK-25947
Reported by: Richard Mudgett

ASTERISK-24649
Reported by: John Bigelow

ASTERISK-24782
Reported by: John Bigelow

Change-Id: I8fef369171f295f580024ab4971e95c799d0dde1

9 years agores_pjsip_callerid: Clear out display name if id->name is not valid 58/2658/1
George Joseph [Tue, 19 Apr 2016 22:52:15 +0000 (16:52 -0600)] 
res_pjsip_callerid:  Clear out display name if id->name is not valid

When create_new_id_hdr creates a new RPID or PAI header, it starts by cloning
the From header, then it overwrites the display name and uri from the channel's
connected.id.  If the connected.id.name wasn't valid, create_new_id_hdr was
leaving the display name from the From header in the new RPID or PAI header.
On an attended transfer where the originator had a caller id number set but not
a display name, the re-INVITE to the final transferee had the number of the
originator but the display name of the transferer.

Added a check to clear out the display name in the new header if
connected.id.name was invalid.

ASTERISK-25942 #close

Change-Id: I60b4bf7a7ece9b7425eba74151c0b4969cd2738b

9 years agoapp_talkdetect: Make the module core supported. 51/2651/1
Joshua Colp [Tue, 19 Apr 2016 18:02:18 +0000 (15:02 -0300)] 
app_talkdetect: Make the module core supported.

This module is used as part of testsuite tests to confirm
stuff works. I'm accordingly marking it as core as it is
required by those tests.

Change-Id: I558e7af7679b22b8ed641d7dd37ee4ca35b11e88

9 years agoapp_talkdetect: Enable for testsuite tests.
Joshua Colp [Tue, 19 Apr 2016 18:00:14 +0000 (15:00 -0300)] 
app_talkdetect: Enable for testsuite tests.

Change-Id: I9acf2e2210f7a15cdd2c63c4c8dcb92de6b47d43

9 years agoPJSIP: Remove PJSIP parsing functions from uri length validation. 46/2646/3
Mark Michelson [Mon, 18 Apr 2016 17:12:37 +0000 (12:12 -0500)] 
PJSIP: Remove PJSIP parsing functions from uri length validation.

The PJSIP parsing functions provide a nice concise way to check the
length of a hostname in a SIP URI. The problem is that in order to use
those parsing functions, it's required to use them from a thread that
has registered with PJLib.

On startup, when parsing AOR configuration, the permanent URI handler
may not be run from a PJLib-registered thread. Specifically, this could
happen when Asterisk was started in daemon mode rather than
console-mode. If PJProject were compiled with assertions enabled, then
this would cause Asterisk to crash on startup.

The solution presented here is to do our own parsing of the contact URI
in order to ensure that the hostname in the URI is not too long. The
parsing does not attempt to perform a full SIP URI parse/validation,
since the hostname in the URI is what is important.

ASTERISK-25928 #close
Reported by Joshua Colp

Change-Id: Ic3d6c20ff3502507c17244a8b7e2ca761dc7fb60

9 years agoMerge "res_pjsip_transport_management: Allow unload to occur." into certified/13.8
Joshua Colp [Tue, 19 Apr 2016 14:40:47 +0000 (09:40 -0500)] 
Merge "res_pjsip_transport_management: Allow unload to occur." into certified/13.8

9 years agores_pjsip_registrar: Fix bad memory-ness with user_agent. 43/2643/3
Mark Michelson [Mon, 18 Apr 2016 22:00:42 +0000 (17:00 -0500)] 
res_pjsip_registrar: Fix bad memory-ness with user_agent.

Recent changes to the PJSIP registrar resulted in tests failing due to
missing AOR_CONTACT_ADDED test events. The reason for this was that the
user_agent string had junk values in it, resulting in being unable to
generate the event.

I'm going to be honest here, I have no idea why this was happening. Here
are the steps needed for the user_agent variable to get messed up:
* REGISTER is received
* First contact in the REGISTER results in a contact being removed
* Second contact in the REGISTER results in a contact being added
* The contact, AOR, expiration, and user agent all have to be passed as
  format parameters to the creation of a string. Any subset of those
  parameters would not be enough to cause the problem.

Looking into what was happening, the thing that struck me as odd was
that the user_agent variable was meant to be set to the value of the
User-Agent SIP header in the incoming REGISTER. However, when removing a
contact, the user_agent variable would be set (via ast_strdupa inside a
loop) to the stored contact's user_agent. This means that the
user_agent's value would be incorrect when attempting to process further
contacts in the incoming REGISTER.

The fix here is to use a different variable for the stored user agent
when removing a contact. Correcting the behavior to be correct also
means the memory usage is less weird, and the issue no longer occurs.

ASTERISK-25929 #close
Reported by Joshua Colp

Change-Id: I7cd24c86a38dec69ebcc94150614bc25f46b8c08