]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
10 years agocontrib/ast-db-manage: Correct down_revision path for user_eq_phone
Matthew Jordan [Tue, 6 Jan 2015 22:46:26 +0000 (22:46 +0000)] 
contrib/ast-db-manage: Correct down_revision path for user_eq_phone

When the user_eq_phone patch was backported to 13, it referenced the downward
revision that the PJSIP optimistic encryption option also references. This
creates a multi-path upgrade Exception when generating the SQL files.

This patch corrects this in the 13 branch. Note that trunk, which already
contained both of these features, is unaffected by this problem.
........

Merged revisions 430252 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@430253 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agobridge: avoid leaking channel during blond transfer pt2
Scott Griepentrog [Tue, 6 Jan 2015 19:53:47 +0000 (19:53 +0000)] 
bridge: avoid leaking channel during blond transfer pt2

A blond transfer to a failed destination, when followed
by a recall attempt, lead to a leak of the reference to
the destination channel.  In addition to correcting the
regression on the previous attempt (r429826) this fixes
the leak and two additional reference leaks on failures
of bridge_import.

ASTERISK-24513 #close
Review: https://reviewboard.asterisk.org/r/4302/
........

Merged revisions 430199 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 430200 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@430245 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores/res_agi: Make Verbose message for 'stream file' match other playbacks
Matthew Jordan [Wed, 24 Dec 2014 15:27:53 +0000 (15:27 +0000)] 
res/res_agi: Make Verbose message for 'stream file' match other playbacks

The Verbose message displayed when a file is played back via 'stream file'
was formatted differently than other playbacks:
* It didn't include the channel name
* It didn't include the channel language
It does, however, include the playback offset as well as any escape digits.
That information was kept; however, this patch updates the formatting to more
closely match the Verbose messages displayed when a file is played back by
'control stream file', Playback, ControlPlayback, or any other file playback
operation.
........

Merged revisions 429519 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@430094 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores_pjsip: Backport missing commits for user_eq_phone
Matthew Jordan [Wed, 24 Dec 2014 15:27:22 +0000 (15:27 +0000)] 
res_pjsip: Backport missing commits for user_eq_phone

This backports the following from trunk, which were missed:

r427257 | file | 2014-11-04 16:31:16 -0600 (Tue, 04 Nov 2014) | 2 lines

res_pjsip: Allow + at the beginning of a phone number when user_eq_phone is enabled.

r427259 | file | 2014-11-04 16:51:32 -0600 (Tue, 04 Nov 2014) | 2 lines

res_pjsip: Apply the 'user_eq_phone' setting to the To header as well.

It also adds the Alembic script for the option.

ASTERISK-24643
........

Merged revisions 430092 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@430093 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoStasis: Update unittest for channel snapshots
Matthew Jordan [Wed, 24 Dec 2014 15:12:43 +0000 (15:12 +0000)] 
Stasis: Update unittest for channel snapshots

This adjusts the unit test for channel snapshots to take the new
language key into account.
........

Merged revisions 429352 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@430090 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores_pjsip_keepalive: Add runtime configurable keepalive module for connection-oriente...
Matthew Jordan [Wed, 24 Dec 2014 13:27:13 +0000 (13:27 +0000)] 
res_pjsip_keepalive: Add runtime configurable keepalive module for connection-oriented transports.

Note that this is backport from trunk of r425825.

This change adds a module which is configurable using the keep_alive_interval setting in the
global section that will send a CRLF keep alive to all active connection-oriented transports at
the provided interval. This is useful because it can help keep connections open through NATs.
This functionality also exists within PJSIP but can not be controlled at runtime and requires
recompiling it.

Review: https://reviewboard.asterisk.org/r/4084/

ASTERISK-24644 #close

........

Merged revisions 430084 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@430086 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores_pjsip: Add 'user_eq_phone' option to add a 'user=phone' parameter when applicable.
Matthew Jordan [Wed, 24 Dec 2014 13:26:21 +0000 (13:26 +0000)] 
res_pjsip: Add 'user_eq_phone' option to add a 'user=phone' parameter when applicable.

Note that this is a backport of r425804 from trunk.

This change adds a configuration option which adds a 'user=phone' parameter if the user
portion of the request URI or the From URI is determined to be a number.

Review: https://reviewboard.asterisk.org/r/4073/

ASTERISK-24643 #close

........

Merged revisions 430083 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@430085 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoDTMF atxfer: Setup recall channels as if the transferee initiated the call.
Richard Mudgett [Mon, 22 Dec 2014 21:22:16 +0000 (21:22 +0000)] 
DTMF atxfer: Setup recall channels as if the transferee initiated the call.

After the initial DTMF atxfer call attempt to the transfer target fails to
answer during a blonde transfer, the recall callback channels do not get
setup with information from the initial transferrer channel.  As a result,
the recall callback to the transferrer does not have callid, channel
variables, datastores, accountcode, peeraccount, COLP, and CLID setup.  A
similar situation happens with the recall callback to the transfer target
but it is less visible.  The recall callback to the transfer target does
not have callid, channel variables, datastores, accountcode, peeraccount,
and COLP setup.

* Added missing information to the recall callback channels before
initiating the call.  callid, channel variables, datastores, accountcode,
peeraccount, COLP, and CLID

* Set callid of the transferrer channel on the DTMF atxfer controller
thread attended_transfer_monitor_thread().

* Added missing channel unlocks and props unref to off nominal paths in
attended_transfer_properties_alloc().

ASTERISK-23841 #close
Reported by: Richard Mudgett

Review: https://reviewboard.asterisk.org/r/4259/
........

Merged revisions 430034 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@430046 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoqueue_log: Post QUEUESTART entry when Asterisk fully boots.
Richard Mudgett [Mon, 22 Dec 2014 20:50:17 +0000 (20:50 +0000)] 
queue_log: Post QUEUESTART entry when Asterisk fully boots.

The QUEUESTART log entry has historically acted like a fully booted event
for the queue_log file.  When the QUEUESTART entry was posted to the log
was broken by the change made by ASTERISK-15863.

* Made post the QUEUESTART queue_log entry when Asterisk fully boots.
This restores the intent of that log entry and happens after realtime has
had a chance to load.

AST-1444 #close
Reported by: Denis Martinez

Review: https://reviewboard.asterisk.org/r/4282/
........

Merged revisions 430009 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 430010 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@430030 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMultiple revisions 429128,429246
Asterisk Autobuilder [Mon, 22 Dec 2014 18:35:00 +0000 (18:35 +0000)] 
Multiple revisions 429128,429246

........
  r429128 | kmoore | 2014-12-09 08:00:50 -0600 (Tue, 09 Dec 2014) | 12 lines

  PJSIP: Stagger outbound qualifies

  This change staggers initiation of outbound qualify (OPTIONS) attempts
  to reduce instantaneous server load and prevent network congestion.

  Review: https://reviewboard.asterisk.org/r/4246/
  ASTERISK-24342 #close
  Reported by: Richard Mudgett
  ........

  Merged revisions 429127 from http://svn.asterisk.org/svn/asterisk/branches/12
........
  r429246 | kmoore | 2014-12-10 07:14:56 -0600 (Wed, 10 Dec 2014) | 8 lines

  PJSIP: Fix assert on initial mass qualify

  This fixes the MWI test regressions caused by r429127 and ensures that
  contacts have non-zero qualify_frequency before attempting scheduling.
  ........

  Merged revisions 429245 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 429128,429246 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@430008 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoPrevent possible race condition on dual redirect of channels in the same bridge.
Asterisk Autobuilder [Mon, 22 Dec 2014 18:28:33 +0000 (18:28 +0000)] 
Prevent possible race condition on dual redirect of channels in the same bridge.

The AST_FLAG_BRIDGE_DUAL_REDIRECT_WAIT flag was created to prevent bridges from
prematurely acting on orphaned channels in bridges. The problem with the AMI
redirect action was that it was setting this flag on channels based on the presence
of a PBX, not whether the channel was in a bridge. Whether a channel has a PBX
is irrelevant, so the condition has been altered to check if the channel is in a
bridge.

ASTERISK-24536 #close
Reported by Niklas Larsson

Review: https://reviewboard.asterisk.org/r/4268
........

Merged revisions 429741 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@430007 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoari: Add support for specifying an originator channel when originating.
Asterisk Autobuilder [Fri, 19 Dec 2014 21:52:43 +0000 (21:52 +0000)] 
ari: Add support for specifying an originator channel when originating.

If an originator channel is specified when originating a channel the linked ID
of it will be applied to the newly originated outgoing channel. This allows
an association to be made between the two so it is known that the originator
has dialed the originated channel.

ASTERISK-24552 #close
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/4243/
........

Merged revisions 429153 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429892 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoARI/AMI: Include language in standard channel snapshot output
Asterisk Autobuilder [Fri, 19 Dec 2014 21:48:28 +0000 (21:48 +0000)] 
ARI/AMI: Include language in standard channel snapshot output

The channel "language" was already part of a channel snapshot, however is was
not sent out over AMI or ARI. This patch makes it so the channel "language" is
included in the appropriate AMI or ARI events.

ASTERISK-24553 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/4245/
........

Merged revisions 429204 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 429206 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429891 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores_pjsip_session: Fix issue where a declined media stream in a re-INVITE would fail...
Asterisk Autobuilder [Fri, 19 Dec 2014 21:47:38 +0000 (21:47 +0000)] 
res_pjsip_session: Fix issue where a declined media stream in a re-INVITE would fail SDP negotiation.

In the past the SDP negotiation within res_pjsip_session was made more tolerant of
certain situations. The only case where SDP negotiation will fail is when a major
error occurs during negotiation. Receiving an already declined media stream is
not considered a major error.

When producing the local SDP the logic took this into account so on the initial INVITE
the declined media stream did not cause an SDP negotiation failure. Unfortunately
the logic for handling media streams with a handler did not mirror this logic and
considered an already declined media stream an error and thus failed the SDP
negotiation.

This change makes the logic between both situations match so only under major
errors will the SDP negotiation fail.

ASTERISK-24607 #close
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/4254/
........

Merged revisions 429407 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429890 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agomedia: Fix crash when determining sample count of a frame during shutdown.
Asterisk Autobuilder [Fri, 19 Dec 2014 21:11:17 +0000 (21:11 +0000)] 
media: Fix crash when determining sample count of a frame during shutdown.

When shutting down Asterisk the codecs are cleaned up. As a result anything
attempting to get a codec based on ID or details will find that no codec
exists. This currently occurs when determining the sample count of a frame.
This code did not take this situation into account.

This change fixes this by getting the codec directly from the format and
eliminates the lookup. This is both faster and also provides a guarantee
that the codec will exist and will be valid.

ASTERISK-24604 #close
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/4260/
........

Merged revisions 429497 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429871 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoPrevent potential infinite outbound authentication loops in registration.
Asterisk Autobuilder [Fri, 19 Dec 2014 20:55:46 +0000 (20:55 +0000)] 
Prevent potential infinite outbound authentication loops in registration.

Prior to this patch, Asterisk would always respond to 401 responses to
registration attempts by trying to provide a registration with authentication
credentials. Even if subsequent attempts were rejected with 401 responses,
Asterisk would continue this behavior. If authentication credentials were
incorrect, this could continue forever.

With this patch, we keep track of whether we have attempted authentication
on an outbound registration attempt. If we already have, we don not try
again until the next attempt. This prevents the infinite loop scenario.

Review: https://reviewboard.asterisk.org/r/4273
........

Merged revisions 429761 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429869 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores_pjsip_outbound_publish: stack overflow when using non-default sorcery wizard
Asterisk Autobuilder [Fri, 19 Dec 2014 20:51:12 +0000 (20:51 +0000)] 
res_pjsip_outbound_publish: stack overflow when using non-default sorcery wizard

When using a non-default sorcery wizard (in this instance realtime) for outbound
publishes Asterisk will crash after a stack overflow occurs due to the code
infinitely recursing.  The fix entails removing the outbound publish state
dependency from the outbound publish sorcery object and instead keeping an in
memory container that can be used to lookup the state when needed.

ASTERISK-24514 #close
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4178/
........

Merged revisions 429175 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429866 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoPJSIP: Allow use of 'inactive' streams for hold
Asterisk Autobuilder [Fri, 19 Dec 2014 20:47:52 +0000 (20:47 +0000)] 
PJSIP: Allow use of 'inactive' streams for hold

This allows use of the 'inactive' stream direction identifier to be
used for hold where 'sendonly' is normally used. Some Seimens phones
use 'inactive' and this change allows music on hold to operate
properly.

Review: https://reviewboard.asterisk.org/r/4252/
Reported by: Steve Pitts
........

Merged revisions 429432 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 429433 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429865 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores_pjsip_session: Delay sending BYE if a re-INVITE transaction is in progress.
Asterisk Autobuilder [Fri, 19 Dec 2014 20:42:56 +0000 (20:42 +0000)] 
res_pjsip_session: Delay sending BYE if a re-INVITE transaction is in progress.

Given the scenario where a PJSIP channel is in a native RTP bridge with direct
media and the channel is then hung up the code will currently re-INVITE the channel
back to Asterisk and send a BYE at the same time. Many SIP implementations dislike
this greatly.

This change makes it so that if a re-INVITE transaction is in progress the BYE
is queued to occur after the completion of the transaction (be it through normal
means or a timeout).

Review: https://reviewboard.asterisk.org/r/4248/
........

Merged revisions 429409 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429864 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agochan_pjsip: Race between channel answer and bridge setup when using direct media
Asterisk Autobuilder [Fri, 19 Dec 2014 20:40:13 +0000 (20:40 +0000)] 
chan_pjsip: Race between channel answer and bridge setup when using direct media

When direct media is enabled and a pjsip channel is answered a race would occur
between the handling of the answer and bridge setup. Sometimes the media
negotiation would take place after the native bridge was setup. This resulted
in a NULL media address, which in turn resulted in Asterisk using its address
as the remote media address when sending a reinvite.  This patch makes the
chan_pjsip answer handler synchronous thus alleviating the race condition (the
bridge won't start setting things up until after it returns).

ASTERISK-24563 #close
Reported by: Steve Pitts
Review: https://reviewboard.asterisk.org/r/4257/
........

Merged revisions 429477 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429863 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoDirect Media calls within private network sometimes get one way audio
Asterisk Autobuilder [Fri, 19 Dec 2014 20:39:52 +0000 (20:39 +0000)] 
Direct Media calls within private network sometimes get one way audio

When endpoints with direct_media enabled, behind a firewall (Asterisk on a
separate network) and were bridged sometimes Asterisk would send the ip
address of the firewall in the sdp to one of the phones in the reinvite
resulting in one way audio. When sending the reinvite Asterisk will retrieve
the media address from the associated rtp instance, but if frames were being
read this can be overwritten with another address (in this case the
firewall's).  This patch ensures that Asterisk uses the original device
address when using direct media.

ASTERISK-24563
Reported by: Steve Pitts
Review: https://reviewboard.asterisk.org/r/4216/
........

Merged revisions 429195 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 429196 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429862 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoEnsure the correct value is returned for CHANNEL(pjsip, secure)
Asterisk Autobuilder [Fri, 19 Dec 2014 20:38:03 +0000 (20:38 +0000)] 
Ensure the correct value is returned for CHANNEL(pjsip, secure)

Prior to this patch, we were using the PJSIP dialog's secure flag
to determine if a secure transport was being used. Unfortunately,
the dialog's secure flag was only set if a SIPS URI were in use,
as required by RFC 3261 sections 12.1.1 and 12.1.2. What we're interested
in is not dialog security, but transport security. This code change
switches to a model where we use the dialog's target URI to determine
what transport would be used to communicate, and then check if that
transport is secure.

AST-1450 #close
Reported by John Bigelow

Review: https://reviewboard.asterisk.org/r/4277
........

Merged revisions 429739 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429861 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agochan_dahdi: Don't ignore setvar when using configuration section scheme.
Asterisk Autobuilder [Fri, 19 Dec 2014 20:37:24 +0000 (20:37 +0000)] 
chan_dahdi: Don't ignore setvar when using configuration section scheme.

When the configuration section scheme of chan_dahdi.conf is used (keyword
dahdichan instead of channel) all setvar= options are completely ignored.
No variable defined this way appears in the created DAHDI channels.

* Move the clearing of setvar values to after the deferred processing of
dahdichan.

AST-1378 #close
Reported by: Guenther Kelleter
Patch by: Guenther Kelleter
........

Merged revisions 429825 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 429829 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429860 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoDEBUG_THREADS: Fix regression and lock tracking initialization problems.
Asterisk Autobuilder [Fri, 19 Dec 2014 20:36:38 +0000 (20:36 +0000)] 
DEBUG_THREADS: Fix regression and lock tracking initialization problems.

This patch started with David Lee's patch at
https://reviewboard.asterisk.org/r/2826/ and includes a regression fix
introduced by the ASTERISK-22455 patch.

The initialization of a mutex's lock tracking structure was not protected
in a critical section.  This is fine for any mutex that is explicitly
initialized, but a static mutex may have its lock tracking double
initialized if multiple threads attempt the first lock simultaneously.

* Added a global mutex to properly serialize initialization of the lock
tracking structure.  The painful global lock can be mitigated by adding a
double checked lock flag as discussed on the original review request.

* Defer lock tracking initialization until first use.

* Don't be "helpful" and initialize an uninitialized lock when
DEBUG_THREADS is enabled.  Debug code is not supposed to fix or change
normal code behavior.  We don't need a lock initialization race that would
force a re-setup of lock tracking.  Lock tracking already handles
initialization on first use.

* Properly handle allocation failures of the lock tracking structure.

* No need to initialize tracking data in __ast_pthread_mutex_destroy()
just to turn around and destroy it.

The regression introduced by ASTERISK-22455 is the result of manipulating
a pthread_mutex_t struct outside of the pthread library code.  The
pthread_mutex_t struct seems to have a global linked list pointer member
that can get changed by other threads.  Therefore, saving and restoring
the contents of a pthread_mutex_t struct is a bad thing.

Thanks to Thomas Airmont for finding this obscure regression.

* Don't overwrite the struct ast_lock_track.reentr_mutex member to restore
tracking data in __ast_cond_wait() and __ast_cond_timedwait().  The
pthread_mutex_t struct must be treated as a read-only opaque variable.

Miscellaneous other items fixed by this patch:

* Match ast_suspend_lock_info() with ast_restore_lock_info() in
__ast_cond_timedwait().

* Made some uninitialized lock sanity checks return EINVAL and try a
DO_THREAD_CRASH.

* Fix bad canlog initialization expressions.

ASTERISK-24614 #close
Reported by: Thomas Airmont

Review: https://reviewboard.asterisk.org/r/4247/
Review: https://reviewboard.asterisk.org/r/2826/
........

Merged revisions 429539 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 429540 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429859 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoActivate persistent subscriptions when they are recreated.
Asterisk Autobuilder [Fri, 19 Dec 2014 20:35:33 +0000 (20:35 +0000)] 
Activate persistent subscriptions when they are recreated.

Prior to this change, recreating persistent subscriptions would
create the subscription but would not activate it. This led to subscriptions
being listed in the "NULL" state by diagnostics and not sending NOTIFYs
when expected.

Review: https://reviewboard.asterisk.org/r/4261
........

Merged revisions 429571 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429858 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoUpdate properties; remove old summaries
Asterisk Autobuilder [Fri, 19 Dec 2014 20:20:47 +0000 (20:20 +0000)] 
Update properties; remove old summaries

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429856 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoCreate Certified Asterisk 13.1 branch
Asterisk Autobuilder [Fri, 19 Dec 2014 20:18:11 +0000 (20:18 +0000)] 
Create Certified Asterisk 13.1 branch

git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/13.1@429855 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoImporting release summary for 13.1.0 release. 13.1.0
Asterisk Autobuilder [Mon, 15 Dec 2014 15:37:36 +0000 (15:37 +0000)] 
Importing release summary for 13.1.0 release.

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/13.1.0@429572 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoUpdate .version; remove old summaries; update ChangeLog
Asterisk Autobuilder [Mon, 15 Dec 2014 15:21:19 +0000 (15:21 +0000)] 
Update .version; remove old summaries; update ChangeLog

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/13.1.0@429568 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoCreate 13.1.0
Asterisk Autobuilder [Mon, 15 Dec 2014 15:11:27 +0000 (15:11 +0000)] 
Create 13.1.0

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/13.1.0@429565 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoImporting release summary for 13.1.0-rc2 release. 13.1.0-rc2
Asterisk Autobuilder [Wed, 10 Dec 2014 15:05:03 +0000 (15:05 +0000)] 
Importing release summary for 13.1.0-rc2 release.

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/13.1.0-rc2@429324 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerge r429273 for AST-2014-019
Asterisk Autobuilder [Wed, 10 Dec 2014 14:41:05 +0000 (14:41 +0000)] 
Merge r429273 for AST-2014-019

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/13.1.0-rc2@429317 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoRemove old summaries; update .version
Asterisk Autobuilder [Wed, 10 Dec 2014 14:36:09 +0000 (14:36 +0000)] 
Remove old summaries; update .version

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/13.1.0-rc2@429314 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoCreate 13.1.0-rc2
Asterisk Autobuilder [Wed, 10 Dec 2014 14:31:20 +0000 (14:31 +0000)] 
Create 13.1.0-rc2

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/13.1.0-rc2@429311 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoImporting release summary for 13.1.0-rc1 release. 13.1.0-rc1
Asterisk Autobuilder [Mon, 8 Dec 2014 17:18:28 +0000 (17:18 +0000)] 
Importing release summary for 13.1.0-rc1 release.

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/13.1.0-rc1@429108 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoImporting files for 13.1.0-rc1 release.
Asterisk Autobuilder [Mon, 8 Dec 2014 17:18:17 +0000 (17:18 +0000)] 
Importing files for 13.1.0-rc1 release.

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/13.1.0-rc1@429107 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoCreating tag for the release of asterisk-13.1.0-rc1
Asterisk Autobuilder [Mon, 8 Dec 2014 17:16:46 +0000 (17:16 +0000)] 
Creating tag for the release of asterisk-13.1.0-rc1

git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/13.1.0-rc1@429103 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAMI/ARI: Update version to 2.6.0/1.6.0 respectively for new features
Matthew Jordan [Mon, 8 Dec 2014 16:53:39 +0000 (16:53 +0000)] 
AMI/ARI: Update version to 2.6.0/1.6.0 respectively for new features

AMI/ARI are getting a few enhancements in the next release of Asterisk 13. Per
semantic versioning, that warrants a bump in the minor version number, as it
reflects a backwards compatible change. Hence, this commit.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429091 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix a crash that would occur when receiving a 491 response to a reinvite.
Mark Michelson [Mon, 8 Dec 2014 16:41:45 +0000 (16:41 +0000)] 
Fix a crash that would occur when receiving a 491 response to a reinvite.

The reviewboard description does a fine job of summarizing this, so here it is:

A reporter discovered that Asterisk would crash when attempting to retransmit
a reinvite that had previously received a 491 response. The crash occurred
because a pjsip_tx_data structure was being saved for reuse, but its reference
count was not being increased. The result was that the pjsip_tx_data was being
freed before we were actually done with it. When we attempted to re-use the
structure when re-sending the reinvite, Asterisk would crash.

The fix implemented here is not to try holding onto the pjsip_tx_data at all.
Instead, when we reschedule sending the reinvite, we create a brand new
pjsip_tx_data and send that instead. Because of this change, there is no need
for an ast_sip_session_delayed_request structure to have a pjsip_tx_data on
it any more. So any code referencing its use has been removed.

When this initial fix was introduced, I encountered a second crash when
processing a subsequent 200 OK on a rescheduled reinvite. The reason was
that when rescheduling the reinvite, we gave the wrong location for a
response callback. This has been fixed in this patch as well.

ASTERISK-24556 #close
Reported by Abhay Gupta

Review: https://reviewboard.asterisk.org/r/4233

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429089 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd new AMI and ARI events for connected line changes on a channel.
Mark Michelson [Mon, 8 Dec 2014 15:49:24 +0000 (15:49 +0000)] 
Add new AMI and ARI events for connected line changes on a channel.

The AMI event is called NewConnectedLine and the ARI event is called
ChannelConnectedLine.

ASTERISK-24554 #close
Reported by Matt Jordan

Review: https://reviewboard.asterisk.org/r/4231

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429064 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoStasis: Fix StasisStart/End order and missing events
Kinsey Moore [Mon, 8 Dec 2014 15:43:14 +0000 (15:43 +0000)] 
Stasis: Fix StasisStart/End order and missing events

This corrects several bugs that currently exist in the stasis
application code.

* After a masquerade, the resulting channels have channel topics that
  do not match their uniqueids
** Masquerades now swap channel topics appropriately
* StasisStart and StasisEnd messages are leaked to observer
  applications due to being published on channel topics
** StasisStart and StasisEnd publishing is now properly restricted
   to controlling apps via app topics
* Race conditions exist where StasisStart and StasisEnd messages due to
  a masquerade may be received out of order due to being published on
  different topics
** These messages are now published directly on the app topic so this
   is now a non-issue
* StasisEnds are sometimes missing when sent due to masquerades and
  bridge swaps into and out of Stasis()
** This was due to StasisEnd processing adjusting message-sent flags
   after Stasis() had already exited and Stasis() had been re-entered
** This was corrected by adjusting these flags prior to sending the
   message while the initial Stasis() application was still shutting
   down

Review: https://reviewboard.asterisk.org/r/4213/
ASTERISK-24537 #close
Reported by: Matt DiMeo
........

Merged revisions 429061 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429062 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores/res_monitor: Reset in/out sample counts on Monitor start
Matthew Jordan [Sat, 6 Dec 2014 18:16:18 +0000 (18:16 +0000)] 
res/res_monitor: Reset in/out sample counts on Monitor start

When repeatedly starting/stopping a Monitor on a channel, the accumulated
in/out sample counts are never reset to 0. This can cause inadvertent jumps
in the recordings, as the code in the channel core will determine incorrectly
that a jump in the recorded file position should occur. Setting the sample
counts to 0 simply reflects the initial state a Monitor should be in when it
is started, as this is the initial count that would be on the channels at that
time.

ASTERISK-24573 #close
Reported by: Nuno Borges
patches:
  24573.patch uploaded by Nuno Borges (License 6116)
........

Merged revisions 429031 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 429032 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429033 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoapps/app_meetme: Apply default values on initial load with no config file
Matthew Jordan [Sat, 6 Dec 2014 17:27:22 +0000 (17:27 +0000)] 
apps/app_meetme: Apply default values on initial load with no config file

When the app_meetme module is loaded without its configuration file, the
module settings aren't initialized. In particular, this impacts the use
of logging realtime members. This patch guarantees that we always set the
default module settings on initial load.

Review: https://reviewboard.asterisk.org/r/4242/

ASTERISK-24572 #close
Reported by: Nuno Borges
patches:
  24572.patch uploaded by Nuno Borges (License 6116)
........

Merged revisions 429027 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 429028 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429029 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agosorcery: Add additional observer capabilities.
George Joseph [Fri, 5 Dec 2014 17:06:42 +0000 (17:06 +0000)] 
sorcery: Add additional observer capabilities.

Add new global, instance and wizard observers.
instance_created
wizard_registered
wizard_unregistered
instance_destroying
instance_loading
instance_loaded
wizard_mapped
object_type_registered
object_type_loading
object_type_loaded
wizard_loading
wizard_loaded

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4215/
........

Merged revisions 428999 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429000 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agomain/test: Fix compilation issue on 32-bit systems
Matthew Jordan [Thu, 4 Dec 2014 17:13:34 +0000 (17:13 +0000)] 
main/test: Fix compilation issue on 32-bit systems

On a 32-bit system, a type of intmax_t will result in a compilation warning
when formatted as a 'long int'. Use the format specifier of %jd (which was
what was used originally in manager.c) to format the JSON extracted integer
on both 32-/64-bit systems.
........

Merged revisions 428972 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428973 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agomain/test: Fix race condition between AMI topic and Test Suite topic
Matthew Jordan [Thu, 4 Dec 2014 15:48:08 +0000 (15:48 +0000)] 
main/test: Fix race condition between AMI topic and Test Suite topic

This patch fixes a race condition between the raising of test AMI events (which
drive many tests in the Asterisk Test Suite) and other AMI events. Prior to
this patch, the Stasis messages published to the test topic were not forwarded
to the AMI topic. Instead, the code in manager had a dedicated handler for test
messages that was independent of the topics forwarded to the AMI topic. This
results in no synchronization between the test messages and the rest of the
Stasis messages published out over AMI. In some test with very tight timing
constraints, this can result in out of order messages and spurious test
failures. Properly forwarding the Test Suite topic to the AMI topic ensures
that the messages are synchronized properly.

This patch does that, and moves the message handling to the Stasis definition
of the Test Suite message in test.c as well.

Review: https://reviewboard.asterisk.org/r/4221/
........

Merged revisions 428945 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428946 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agotests/test_cel: Add test_cel_attended_transfer_bridges_link to racey tests
Matthew Jordan [Wed, 3 Dec 2014 20:58:41 +0000 (20:58 +0000)] 
tests/test_cel: Add test_cel_attended_transfer_bridges_link to racey tests

Despite failing less often, the ordering of the ATTENDEDTRANSFER event and the
BRIDGE_EXIT event for the Alice and David channels is not defined. This makes
the test still fail.
........

Merged revisions 428918 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428919 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agotests/test_cel: Fix CEL unit test failures caused by attended transfer changes
Matthew Jordan [Wed, 3 Dec 2014 19:49:17 +0000 (19:49 +0000)] 
tests/test_cel: Fix CEL unit test failures caused by attended transfer changes

When the publication of attended transfer messages were pushed to another
thread, some subtle race conditions were introduced with the CEL unit tests.
This patch fixes one of them, and pushes the other to ASTERISK-22367, which
already exists to fix another bouncy CEL unit test.

In particular, this patch fixes the test_cel_attended_transfer_bridges_link
test, and defers the test_cel_attended_transfer_bridges_swap test to the
aforementioned JIRA issue.

ASTERISK-22367
........

Merged revisions 428891 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428892 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoapps/app_voicemail: Fix crash with IMAP when streams are opened simultaneously
Matthew Jordan [Wed, 3 Dec 2014 16:45:08 +0000 (16:45 +0000)] 
apps/app_voicemail: Fix crash with IMAP when streams are opened simultaneously

The UW IMAP library is instrinsically not thread-safe, and relies upon higher
level applications to guarantee thread safety. For the most part, this is
provided by the vms object, which provides locking for individual streams.
Unfortunately, this is not sufficient for calls to mail_open which create the
IMAP stream. mail_open can, on some systems, call into a UW IMAP specific
function for determining the address of a system based on a hostname,
ip_nametoaddr.

In the ip6_unix implementation of this function, static variables are used
to hold parsing buffers. This can cause a crash if multiple threads attempt
to convert a hostname to an address at the same time. Locking on a single
mail stream is not sufficient to prevent simultaneous access to these static
variables.

In the IMAP library, this function can be called from the mail_open and
imap_status functions. As the imap_status function is not used by
app_voicemail, locking on access to mail_open is sufficient to prevent
any mangling of the buffers.

Review: https://reviewboard.asterisk.org/r/4188/

ASTERISK-24516 #close
Reported by: David Duncan Ross Palmer
Tested by: David Duncan Ross Palmer
patches:
  ASTERISK-24516.diff uploaded by David Duncan Ross Palmer (License 6660)
........

Merged revisions 428863 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 428864 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428865 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoCHANGES: Add item for new 'pjsip show identif(y|ies) commands
George Joseph [Tue, 2 Dec 2014 21:53:14 +0000 (21:53 +0000)] 
CHANGES: Add item for new 'pjsip show identif(y|ies) commands

Tested-by: George Joseph
........

Merged revisions 428836 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428837 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agotests/test_stasis: Resolve compilation issues from Asterisk 12 merge
Matthew Jordan [Tue, 2 Dec 2014 19:03:42 +0000 (19:03 +0000)] 
tests/test_stasis: Resolve compilation issues from Asterisk 12 merge

When merging the changes up stream in r428687, I missed the fact that the
signature for stasis_message_type_create was changed. This patch fixes
the compilation issues introduced by that merge.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428815 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agopbx/pbx_loopback: Speed up switches by avoiding unneeded lookups
Matthew Jordan [Tue, 2 Dec 2014 17:05:59 +0000 (17:05 +0000)] 
pbx/pbx_loopback: Speed up switches by avoiding unneeded lookups

This patch makes a small rearrangement to only do dialplan lookups during
loopback switches if the pattern matches. Prior to this patch, the dialplan
lookups were always performed, even when the result would be discarded.
Dialplan lookups can be very costly if remote switches - like DUNDi - are
present. In those cases extension matching is sped up considerably, making
the issue of lost digits more manageable.

As collateral damage, 6 trailing spaces were killed.

Review: https://reviewboard.asterisk.org/r/4211

ASTERISK-24577 #close
Reported by: Birger Harzenetter
patches:
  ast-loopback.patch uploaded by Birger Harzenetter (License 5870)
........

Merged revisions 428787 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 428788 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428789 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores_pjsip_refer: Fix issue where native bridge may not occur upon completion of a...
Joshua Colp [Tue, 2 Dec 2014 12:20:58 +0000 (12:20 +0000)] 
res_pjsip_refer: Fix issue where native bridge may not occur upon completion of a transfer.

There are two methods within res_pjsip_refer for keeping track of the state of a transfer.
The first is a framehook which looks at frames passing by to determine the state. The second
subscribes to know when the channel joins a bridge. In the case when the channel joins the
bridge the framehook is *NOT* removed and this prevents the native RTP bridging technology
from getting used.

This change gets the channel and if it still exists remove the framehook.

Review: https://reviewboard.asterisk.org/r/4218/
........

Merged revisions 428760 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428761 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoconfig: Create ast_variable_find_in_list()
George Joseph [Tue, 2 Dec 2014 00:38:08 +0000 (00:38 +0000)] 
config: Create ast_variable_find_in_list()

Add
const char *ast_variable_find_in_list(const struct ast_variable *list,
   const char *variable);

ast_variable_find() requires a config category to search whereas
ast_variable_find_in_list() just needs the root list element which is
useful if you don't have a category.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4217/
........

Merged revisions 428733 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428734 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores_pjsip_endpoint_identifier_ip: Add 'show identify(ies)' cli commands
George Joseph [Tue, 2 Dec 2014 00:30:12 +0000 (00:30 +0000)] 
res_pjsip_endpoint_identifier_ip: Add 'show identify(ies)' cli commands

While troubleshooting other things I realized there were no pjsip cli
commands for identify.  This patch adds them.  It also also fixes a
reference leak when a 'show endpoint' displayed identifies and properly
sets the return code if load_module can't allocate a cli formatter structure.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4212/
........

Merged revisions 428725 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428731 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agomain/stasis: Allow subscriptions to use a threadpool for message delivery
Matthew Jordan [Mon, 1 Dec 2014 17:57:12 +0000 (17:57 +0000)] 
main/stasis: Allow subscriptions to use a threadpool for message delivery

Prior to this patch, all Stasis subscriptions would receive a dedicated
thread for servicing published messages. In contrast, prior to r400178
(see review https://reviewboard.asterisk.org/r/2881/), the subscriptions
shared a thread pool. It was discovered during some initial work on Stasis
that, for a low subscription count with high message throughput, the
threadpool was not as performant as simply having a dedicated thread per
subscriber.

For situations where a subscriber receives a substantial number of messages
and is always present, the model of having a dedicated thread per subscriber
makes sense. While we still have plenty of subscriptions that would follow
this model, e.g., AMI, CDRs, CEL, etc., there are plenty that also fall into
the following two categories:
* Large number of subscriptions, specifically those tied to endpoints/peers.
* Low number of messages. Some subscriptions exist specifically to coordinate
  a single message - the subscription is created, a message is published, the
  delivery is synchronized, and the subscription is destroyed.
In both of the latter two cases, creating a dedicated thread is wasteful (and
in the case of a large number of peers/endpoints, harmful). In those cases,
having shared delivery threads is far more performant.

This patch adds the ability of a subscriber to Stasis to choose whether or not
their messages are dispatched on a dedicated thread or on a threadpool. The
threadpool is configurable through stasis.conf.

Review: https://reviewboard.asterisk.org/r/4193

ASTERISK-24533 #close
Reported by: xrobau
Tested by: xrobau
........

Merged revisions 428681 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428687 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoapp_record: Fix bug where using the 'k' option and hanging up would trim 1/4 of a...
Joshua Colp [Mon, 1 Dec 2014 13:41:08 +0000 (13:41 +0000)] 
app_record: Fix bug where using the 'k' option and hanging up would trim 1/4 of a second of the recording.

The Record dialplan function trims 1/4 of a second from the end of recordings in case
they are terminated because of DTMF. When hanging up, however, you don't want this to happen.
This change makes it so on hangup this does not occur.

ASTERISK-24530 #close
Reported by: Ben Smithurst
patches:
 app_record_v2.diff submitted by Ben Smithurst (license 6529)

Review: https://reviewboard.asterisk.org/r/4201/
........

Merged revisions 428653 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 428654 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428655 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agochannel: Extend size of buffer for codecs in "core show channeltype" CLI command.
Joshua Colp [Mon, 1 Dec 2014 13:07:35 +0000 (13:07 +0000)] 
channel: Extend size of buffer for codecs in "core show channeltype" CLI command.

The static buffer for codecs when invoking the "core show channeltype" CLI command
did not have enough room for all codecs. This has been extended so it does.

ASTERISK-24542 #close
Reported by: snuffy
patches:
 channeltype-tech.diff submitted by snuffy (license 5024)

Review: https://reviewboard.asterisk.org/r/4204/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428632 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agotest_channel_feature_hooks.c: Fix unit test for DTMF hooks.
Richard Mudgett [Mon, 24 Nov 2014 20:37:19 +0000 (20:37 +0000)] 
test_channel_feature_hooks.c: Fix unit test for DTMF hooks.

Fix the failing /channels/features/test_features_channel_dtmf unit test.

DTMF emulation does not work without a stream of packets to prod the
emulation code.

Review: https://reviewboard.asterisk.org/r/4199/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428604 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoDTMF hooks: Leaving channels need to push any collected digits into the bridge.
Richard Mudgett [Mon, 24 Nov 2014 20:31:08 +0000 (20:31 +0000)] 
DTMF hooks: Leaving channels need to push any collected digits into the bridge.

Any partially collected DTMF digits for a DTMF hook need to be pushed into
the bridge when a channel leaves the bridging system as if there were a
timeout.

Review: https://reviewboard.asterisk.org/r/4199/
........

Merged revisions 428601 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428602 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agomanager: Fix could not extend string messages.
Richard Mudgett [Fri, 21 Nov 2014 19:09:13 +0000 (19:09 +0000)] 
manager: Fix could not extend string messages.

When shutting down Asterisk that has an active AMI connection, you get
several "failed to extend from %d to %d" messages because use of the
EVENT_FLAG_SHUTDOWN attempts to add all AMI permission strings to the
event.

* Created MAX_AUTH_PERM_STRING to use when creating stack based struct
ast_str variables used with the authority_to_str() and
user_authority_to_str() functions instead of a variety of magic numbers
that could be too small.

* Added a special check for EVENT_FLAG_SHUTDOWN to authority_to_str() so
it will not attempt to add all permission level strings.

Review: https://reviewboard.asterisk.org/r/4200/
........

Merged revisions 428570 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 428571 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428572 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agosorcery: Make is_object_field_registered handle field names that are regexes.
George Joseph [Fri, 21 Nov 2014 17:45:13 +0000 (17:45 +0000)] 
sorcery: Make is_object_field_registered handle field names that are regexes.

As a result of https://reviewboard.asterisk.org/r/3305, res_sorcery_realtime
was tossing database fields that didn't have an exact match to a sorcery
registered field.  This broke the ability to use regexes as field names which
manifested itself as a failure of res_pjsip_phoneprov_provider which uses
this capability.  It also broke handling of fields that start with '@' in
realtime but I don't think anyone noticed.

This patch does the following...
* Modifies ast_sorcery_fields_register to pre-compile the name regex.
* Modifies ast_sorcery_is_object_field_registered to test the regex if it
  exists instead of doing an exact strcmp.
* Modifies res_pjsip_phoneprov_provider with a few tweaks to get it to work
  with realtime.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4185/
........

Merged revisions 428543 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428544 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agomain/bridge_basic: Fix features regressions introduced by r428165
Matthew Jordan [Fri, 21 Nov 2014 02:16:55 +0000 (02:16 +0000)] 
main/bridge_basic: Fix features regressions introduced by r428165

In r428165, two bugs were introduced:

* Prior to entering the features retry loop, the buffer that holds the
  collected digits is wiped. However, this inadvertently wipes out the
  first collected digit on the first pass through, which is obtained
  in ast_stream_and_wait. This caused all of the features tests to fail.
* If ast_app_dtget returns a hangup (-1), the loop would retry incorrectly.
  If we detect a hangup, we have to stop trying the feature.

This patch fixes both issues.

Review: https://reviewboard.asterisk.org/r/4196/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428505 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix error with mixed address family ACLs.
Mark Michelson [Thu, 20 Nov 2014 16:36:54 +0000 (16:36 +0000)] 
Fix error with mixed address family ACLs.

Prior to this commit, the address family of the first item in an ACL
was used to compare all incoming traffic. This could lead to traffic
of other IP address families bypassing ACLs.

ASTERISK-24469 #close

Reported by Matt Jordan
Patches:
ASTERISK-24469-11.diff uploaded by Matt Jordan (License #6283)

AST-2014-012
........

Merged revisions 428402 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 428417 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 428422 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428425 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAST-2014-018 - func_db: DB Dialplan function permission escalation via AMI.
Kevin Harwell [Thu, 20 Nov 2014 16:34:30 +0000 (16:34 +0000)] 
AST-2014-018 - func_db: DB Dialplan function permission escalation via AMI.

The DB dialplan function when executed from an external protocol (for instance
AMI), could result in a privilege escalation.

Asterisk now inhibits the DB function from being executed from an external
interface if the live_dangerously option is set to no.

ASTERISK-24534
Reported by: Gareth Palmer
patches: submitted by Gareth Palmer (license 5169)
........

Merged revisions 428331 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 428363 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 428409 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428413 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoPJSIP ACLs: Fix ACLs not loading on startup and apply/acl issues on contact
Jonathan Rose [Thu, 20 Nov 2014 16:13:22 +0000 (16:13 +0000)] 
PJSIP ACLs: Fix ACLs not loading on startup and apply/acl issues on contact

The biggest problem this patch fixes is that ACLs weren't previously being
loaded when the res_pjsip_acl module was loaded. Yikes. In addition, the
ACL options contact_permit and contact_acl were effectively interpreted as
contact_deny and this patch fixes that as well.

AST-1418 #close
Reported by: Thomas Thompson
Review: https://reviewboard.asterisk.org/r/4120/

ASTERISK-24531 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/4171/
........

Merged revisions 428333 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428343 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAST-2014-017 - app_confbridge: permission escalation/ class authorization.
Kevin Harwell [Thu, 20 Nov 2014 15:50:44 +0000 (15:50 +0000)] 
AST-2014-017 - app_confbridge: permission escalation/ class authorization.

Confbridge dialplan function permission escalation via AMI and inappropriate
class authorization on the ConfbridgeStartRecord action. The CONFBRIDGE dialplan
function when executed from an external protocol (for instance AMI), could
result in a privilege escalation. Also, the AMI action “ConfbridgeStartRecord”
could also be used to execute arbitrary system commands without first checking
for system access.

Asterisk now inhibits the CONFBRIDGE function from being executed from an
external interface if the live_dangerously option is set to no.  Also, the
“ConfbridgeStartRecord” AMI action is now only allowed to execute under a
user with system level access.

ASTERISK-24490
Reported by: Gareth Palmer
........

Merged revisions 428332 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 428334 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428339 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAST-2014-016: Fix crash when receiving an in-dialog INVITE with Replaces in res_pjsip...
Joshua Colp [Thu, 20 Nov 2014 14:55:45 +0000 (14:55 +0000)] 
AST-2014-016: Fix crash when receiving an in-dialog INVITE with Replaces in res_pjsip_refer.

The implementation of INVITE with Replaces in res_pjsip_refer did not expect them to
occur in-dialog. As a result it would incorrectly attempt to hang up a channel it
thought was under its control. In reality the channel would be under the control of
another thread. When the other thread accessed the channel it would be accessing freed
memory and could crash.

This change makes res_pjsip_refer not act on an in-dialog INVITE with Replaces.

ASTERISK-24528 #close
Reported by: Joshua Colp
........

Merged revisions 428304 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428305 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAST-2014-015: Fix race condition in chan_pjsip when sending responses after a CANCEL...
Joshua Colp [Thu, 20 Nov 2014 14:49:15 +0000 (14:49 +0000)] 
AST-2014-015: Fix race condition in chan_pjsip when sending responses after a CANCEL has been received.

Due to the serialized architecture of chan_pjsip there exists a race condition where a CANCEL may
be received and processed before responses (such as 180 Ringing, 183 Session Progress, and 200 OK)
are sent. Since the session is in an unexpected state PJSIP will assert when this is attempted.

This change makes it so that these responses are not sent on disconnected sessions.

ASTERISK-24471 #close
Reported by: yaron nahum
........

Merged revisions 428301 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428302 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agostringfields: Fix bug in ast_string_fields_copy.
Corey Farrell [Wed, 19 Nov 2014 19:31:13 +0000 (19:31 +0000)] 
stringfields: Fix bug in ast_string_fields_copy.

ast_string_fields_copy relies on the fact that
__ast_string_field_release_active never previously
zeroed pool->used, so keeping the existing pointer
was "ok".  Now that existing pools can be reset to
'empty', it is important to set each field to
__ast_string_field_empty after releasing the memory.

ASTERISK-24535 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4186/
........

Merged revisions 428272 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428273 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoast_str: Fix improper member access to struct ast_str members.
Richard Mudgett [Wed, 19 Nov 2014 17:13:29 +0000 (17:13 +0000)] 
ast_str: Fix improper member access to struct ast_str members.

Accessing members of struct ast_str outside of the string manipulation API
routines is invalid since struct ast_str is supposed to be treated as
opaque.

Review: https://reviewboard.asterisk.org/r/4194/
........

Merged revisions 428244 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 428245 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428246 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores_pjsip_sdp_rtp: Add support for optimistic SRTP.
Joshua Colp [Wed, 19 Nov 2014 12:40:36 +0000 (12:40 +0000)] 
res_pjsip_sdp_rtp: Add support for optimistic SRTP.

Optimistic SRTP is the ability to enable SRTP but not have it be
a fatal requirement. If SRTP can be used it will be, if not it won't be.
This gives you a better chance of using it without having your sessions
fail when it can't be.

Encrypt all the things!

Review: https://reviewboard.asterisk.org/r/3992/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428222 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores_pjsip_refer: Ensure Refer-To is NULL terminated and parse it as a URI.
Joshua Colp [Wed, 19 Nov 2014 11:50:54 +0000 (11:50 +0000)] 
res_pjsip_refer: Ensure Refer-To is NULL terminated and parse it as a URI.

There is no guarantee that when we get a Refer-To that it will be NULL terminated.
As the URI parsing function requires it to be we now NULL terminate it.

Additionally parsing the Refer-To as a 'To' header is needless and it can
simply be done as a URI. This also fixes a problem where certain Refer-To headers
would not be parsed as a 'To' header causing the REFER to fail.

ASTERISK-24508 #close
Reported by: Beppo Mazzucato

Review: https://reviewboard.asterisk.org/r/4187/
........

Merged revisions 428195 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428196 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoparking_tests.c: Add missing newline on a unit test message.
Richard Mudgett [Tue, 18 Nov 2014 18:54:56 +0000 (18:54 +0000)] 
parking_tests.c: Add missing newline on a unit test message.
........

Merged revisions 428168 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428169 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAllow for transferer to retry when dialing an invalid extension.
Mark Michelson [Mon, 17 Nov 2014 16:51:16 +0000 (16:51 +0000)] 
Allow for transferer to retry when dialing an invalid extension.

This allows for a configurable number of attempts for a transferer
to dial an extension to transfer the call to. For Asterisk 13, the
default values are such that upgrading between versions will not
cause a behaivour change. For trunk, though, the defaults will be
changed to be more user-friendly.

Review: https://reviewboard.asterisk.org/r/4167

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428145 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agochan_sip: Fix theoretical leak of p->refer.
Corey Farrell [Mon, 17 Nov 2014 16:00:54 +0000 (16:00 +0000)] 
chan_sip: Fix theoretical leak of p->refer.

If transmit_refer is called when p->refer is already allocated,
it leaks the previous allocation.  Updated code to always free
previous allocation during a new allocation.  Also instead of
checking if we have a previous allocation, always create a
clean record.

ASTERISK-15242 #close
Reported by: David Woolley
Review: https://reviewboard.asterisk.org/r/4160/
........

Merged revisions 428117 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 428118 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428119 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoapps/app_confbridge: Ensure 'normal' users hear message when last marked leaves
Matthew Jordan [Mon, 17 Nov 2014 15:27:17 +0000 (15:27 +0000)] 
apps/app_confbridge: Ensure 'normal' users hear message when last marked leaves

When r428077 was made for ASTERISK-24522, it failed to take into account users
who are neither wait_marked nor end_marked. These users are *also* supposed to
hear the 'leader has left the conference' message. Granted, this behaviour is
a bit odd; however, that is how it used to work... and behaviour changes are
not good.

This patch ensures that if there are any 'normal' users present when the last
marked user leaves the conference, the message will still be played to them.

Note that this regression was caught by the Asterisk Test Suite's
confbridge_nominal test, which has a quirky combination of users.
........

Merged revisions 428113 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 428114 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428115 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoBlocked revisions 428104
Matthew Jordan [Mon, 17 Nov 2014 15:15:49 +0000 (15:15 +0000)] 
Blocked revisions 428104

........
tests/test_cel: Fix CEL unit tests

This is a backport of the test_cel portion of r427870, which was not applied to
the 12 branch. This fixes the compilation issues with the CEL unit tests
introduced by the API changes needed to fix publication of blind transfer
messages.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428105 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoapp_confbridge: Don't play leader leaving prompt if no one will hear it
Matthew Jordan [Mon, 17 Nov 2014 03:07:07 +0000 (03:07 +0000)] 
app_confbridge: Don't play leader leaving prompt if no one will hear it

Consider the following:
- A marked user in a conference
- One or more end_marked only users in the conference

When the marked users leaves, we will be in the conf_state_multi_marked state.
This currently will traverse the users, kicking out any who have the end_marked
flags. When they are kicked, a full ast_bridge_remove is immediately called on
the channels. At this time, we also unilaterally set the need_prompt flag.

When the need_prompt flag is set, we then playback a sound to the bridge
informing everyone that the leader has left; however, no one is left in the
bridge. This causes some odd behaviour for the end_marked users - they are
stuck waiting for the bridge to be unlocked. This results in them waiting for
5 or 6 seconds of dead air before hearing that they've been kicked.

Unfortunately, we do have to keep the bridge locked while we're playing back
the 'leader-has-left' prompt. If there are any wait_marked users in the
conference, this behaviour can't be easily changed - but we do make the case
of the end_marked users better with this patch.

Review: https://reviewboard.asterisk.org/r/4184/

ASTERISK-24522 #close
Reported by: Matt Jordan
........

Merged revisions 428077 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 428078 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428079 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agochan_pjsip: Remove AOR check when dialing and one is specified.
Joshua Colp [Sun, 16 Nov 2014 21:12:27 +0000 (21:12 +0000)] 
chan_pjsip: Remove AOR check when dialing and one is specified.

The AOR value may contain the name of an AOR or a full SIP URI.
Checking if the AOR exists can't be done as a result of this.
........

Merged revisions 428051 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428052 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agochan_pjsip: Add additional log message when an AOR is specified when dialing and...
Joshua Colp [Sat, 15 Nov 2014 21:35:49 +0000 (21:35 +0000)] 
chan_pjsip: Add additional log message when an AOR is specified when dialing and it does not exist.

ASTERISK-24499 #close
Reported by: Rusty Newton
........

Merged revisions 428007 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428008 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agochan_motif / chan_pjsip: Fix incorrect "No such module" messages when reloading.
Joshua Colp [Sat, 15 Nov 2014 19:00:40 +0000 (19:00 +0000)] 
chan_motif / chan_pjsip: Fix incorrect "No such module" messages when reloading.

For chan_motif the direct return value of the underlying config options framework
was passed back. This can relay various states which the module loader would not
interpet as success. It has been changed so only on errors will it report back
an error.

For chan_pjsip the code implemented a dummy reload function which always
returned an error. This has been removed as all configuration is held within
res_pjsip instead.

ASTERISK-23651 #close
Reported by: Rusty Newton
........

Merged revisions 427981 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427982 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores_pjsip: Enforce requirements for session timer minimum expiration period and norma...
Joshua Colp [Sat, 15 Nov 2014 18:28:33 +0000 (18:28 +0000)] 
res_pjsip: Enforce requirements for session timer minimum expiration period and normal expiration period.

This change enforces the requirements in PJSIP for session timer configuration. The minimum
expiration period must be 90 seconds or higher and the normal expiration period can not
be lower than the minimum expiration period. If either of these were done the code would
assert at session setup time.

ASTERISK-24336 #close
Reported by: Leon Rowland
........

Merged revisions 427978 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427979 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agocel/cel_odbc: Provide microsecond precision in 'eventtime' column when possible
Matthew Jordan [Sat, 15 Nov 2014 16:56:57 +0000 (16:56 +0000)] 
cel/cel_odbc: Provide microsecond precision in 'eventtime' column when possible

This patch adds microsecond precision when inserting a CEL record into a table
with an "eventtime" column of type timestamp, instead of second precision. The
documentation (configs/cel_odbc.conf.sample) was already saying that the
eventtime column included microseconds precision, but that was not the case.

Also, without this patch, if you had a table with an "eventtime" column of
type varchar, you had millisecond precision. With this patch, you also get
microsecond precision in this case.

Review: https://reviewboard.asterisk.org/r/3980

ASTERISK-24283 #close
Reported by: Etienne Lessard
patches:
  cel_odbc_time_precision.patch uploaded by Etienne Lessard (License 6394)
........

Merged revisions 427952 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 427953 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427954 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agotests/test_cel: Unlock bridge on off nominal paths
Matthew Jordan [Fri, 14 Nov 2014 18:54:20 +0000 (18:54 +0000)] 
tests/test_cel: Unlock bridge on off nominal paths

If the test fails due to memory allocation errors, we may as well attempt to
unlock the bridge on the way out.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427927 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoDocumentation: Revise explanation of cdr.conf option 'Unanswered'
Jonathan Rose [Fri, 14 Nov 2014 17:45:53 +0000 (17:45 +0000)] 
Documentation: Revise explanation of cdr.conf option 'Unanswered'

ASTERISK-24279 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/4109/
........

Merged revisions 427901 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427902 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agostun: correct attribute string padding to match rfc
Scott Griepentrog [Fri, 14 Nov 2014 15:51:17 +0000 (15:51 +0000)] 
stun: correct attribute string padding to match rfc

When sending the USERNAME attribute in an RTP STUN
response, the implementation in append_attr_string
passed the actual length, instead of padding it up
to a multiple of four bytes as required by the RFC
3489.  This change adds separate variables for the
string and padded attributed lengths, and performs
padding correctly.

Reported by: Thomas Arimont
Review: https://reviewboard.asterisk.org/r/4139/
........

Merged revisions 427874 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 427875 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427876 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix race condition that could result in ARI transfer messages not being sent.
Mark Michelson [Fri, 14 Nov 2014 15:24:48 +0000 (15:24 +0000)] 
Fix race condition that could result in ARI transfer messages not being sent.

From reviewboard:

"During blind transfer testing, it was noticed that tests were failing
occasionally because the ARI blind transfer event was not being sent.
After investigating, I detected a race condition in the blind transfer
code. When blind transferring a single channel, the actual transfer
operation (i.e. removing the transferee from the bridge and directing
them to the proper dialplan location) is queued onto the transferee
bridge channel. After queuing the transfer operation, the blind transfer
Stasis message is published. At the time of publication, snapshots of
the channels and bridge involved are created. The ARI subscriber to the
blind transfer Stasis message then attempts to determine if the bridge
or any of the involved channels are subscribed to by ARI applications.
If so, then the blind transfer message is sent to the applications. The
way that the ARI blind transfer message handler works is to first see
if the transferer channel is subscribed to. If not, then iterate over
all the channel IDs in the bridge snapshot and determine if any of
those are subscribed to. In the test we were running, the lone
transferee channel was subscribed to, so an ARI event should have been
sent to our application. Occasionally, though, the bridge snapshot did
not have any channels IDs on it at all. Why?

The problem is that since the blind transfer operation is handled by a
separate thread, it is possible that the transfer will have completed and
the channels removed from the bridge before we publish the blind transfer
Stasis message. Since the blind transfer has completed, the bridge on
which the transfer occurred no longer has any channels on it, so the
resulting bridge snapshot has no channels on it. Through investigation of
the code, I found that attended transfers can have this issue too for the
case where a transferee is transferred to an application."

The fix employed here is to decouple the creation of snapshots for the transfer
messages from the publication of the transfer messages. This way, snapshots
can be created to reflect what they are at the time of the transfer operation.

Review: https://reviewboard.asterisk.org/r/4135
........

Merged revisions 427848 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427870 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoapp_confbridge: Play "leader has left" sound even when musiconhold is enabled.
Joshua Colp [Fri, 14 Nov 2014 14:56:23 +0000 (14:56 +0000)] 
app_confbridge: Play "leader has left" sound even when musiconhold is enabled.

Currently if the leader of a conference bridge leaves any participant
that has musiconhold enabled will not hear the "leader has left" sound.
This is because musiconhold is started and THEN the sound is played.

This change makes it so that the sound is played and THEN musiconhold
is started. This provides a better experience for users as they may not
have known previously why they went back to musiconhold.

Review: https://reviewboard.asterisk.org/r/4177/
........

Merged revisions 427844 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 427845 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427846 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix race condition where duplicated requests may be handled by multiple threads.
Mark Michelson [Fri, 14 Nov 2014 14:24:02 +0000 (14:24 +0000)] 
Fix race condition where duplicated requests may be handled by multiple threads.

This is the Asterisk 13 version of the patch. The main difference is in the pubsub
code since it was completely refactored between Asterisk 12 and 13.

Review: https://reviewboard.asterisk.org/r/4175

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427841 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores_pjsip_exten_state: PJSIPShowSubscriptionsInbound causes crash
Kevin Harwell [Thu, 13 Nov 2014 22:03:00 +0000 (22:03 +0000)] 
res_pjsip_exten_state: PJSIPShowSubscriptionsInbound causes crash

When using a non-default sorcery wizard (in this instance realtime) for
outbound registrations and after adding in an appropriate call to
ast_sorcery_apply_config() (since it is missing) Asterisk will crash after
a stack overflow occurs due to the code infinitely recursing.  The fix entails
removing the outbound registration state dependency from the outbound
registration sorcery object and instead keeping an in memory container that
can be used to lookup the state when needed.

ASTERISK-24514
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4164/
........

Merged revisions 427814 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427815 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoStasis: Fix StasisEnd message ordering
Kinsey Moore [Thu, 13 Nov 2014 15:44:28 +0000 (15:44 +0000)] 
Stasis: Fix StasisEnd message ordering

This change corrects message ordering in cases where a channel-related
message can be received after a Stasis/ARI application has received the
StasisEnd message. The StasisEnd message was being passed to
applications directly without waiting for the channel topic to empty.

As a result of this fix, other bugs were also identified and fixed:
* StasisStart messages were also being sent directly to apps and are
  now routed through the stasis message bus properly
* Masquerade monitor datastores were being removed at the incorrect
  time in some cases and were causing StasisEnd messages to not be sent
* General refactoring where necessary for the above
* Unsubscription on StasisEnd timing changes to prevent additional
  messages from following the StasisEnd when they shouldn't

A channel sanitization function pointer was added to reduce processing
and AO2 lookups.

Review: https://reviewboard.asterisk.org/r/4163/
ASTERISK-24501 #close
Reported by: Matt Jordan
........

Merged revisions 427788 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427789 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agomain/rtp_engine: Fix crash when processing more than one RTCP report info block
Matthew Jordan [Thu, 13 Nov 2014 00:00:40 +0000 (00:00 +0000)] 
main/rtp_engine: Fix crash when processing more than one RTCP report info block

Asterisk - in res_rtp_asterisk - only understands a single RTCP report info
block. When the RTCP information was refactored in the RTP Engine to be pushed
over the Stasis message bus, I put in the hooks into the engine to handle
multiple RTCP report info blocks, in the hope that a future RTP implementation
would be able to provide that data. Unfortunately, res_rtp_asterisk has a
tendency to "lie":
(1) It will send RTCP reports with a reception_report_count greater than 1
    (which is pulled directly from the RTCP packet itself, so that part is
    correct)
(2) It will only provide a single report block

When the rtp_engine goes to convert this to a JSON blob, hilarity ensues as it
looks for a report block that doesn't exist.

This patch updates the rtp_engine to be a bit more skeptical about what it is
presented with. While this could also be fixed in res_rtp_asterisk, this patch
prefers to fix it in the engine for two reasons:
(1) The engine is designed to work with multiple RTP implementation, and hence
    having it be more robust is a good thing (tm)
(2) res_rtp_asterisk's handling of RTCP information is "fun". It should report
    the correct reception_report_count; ideally it should also be giving us all
    of the blocks - but it is *definitely* not designed to do that. Going down
    that road is a non-trivial effort.

Review: https://reviewboard.asterisk.org/r/4158/

ASTERISK-24489 #close
Reported by: Gregory Malsack
Tested by: Gregory Malsack

ASTERISK-24498 #close
Reported by: Beppo Mazzucato
Tested by: Beppo Maazucato
........

Merged revisions 427762 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427763 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix leak in AMI Action Bridge
Corey Farrell [Wed, 12 Nov 2014 20:39:26 +0000 (20:39 +0000)] 
Fix leak in AMI Action Bridge

Add missing reference cleanup for newly created bridge.

ASTERISK-24281
Reported by: Stefan Engström
Review: https://reviewboard.asterisk.org/r/4154/
........

Merged revisions 427736 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427737 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agopbx: Fix off-nominal case where a freed extension may still be used.
Joshua Colp [Wed, 12 Nov 2014 16:12:32 +0000 (16:12 +0000)] 
pbx: Fix off-nominal case where a freed extension may still be used.

If during the operation of adding an extension a priority is added but
fails it is possible for the extension to be freed but still exist in
the PBX core. If this occurs subsequent lookups may try to access the
extension and end up in freed memory.

This change removes the extension from the PBX core when the priority
addition fails and then frees the extension.

ASTERISK-24444 #close
Reported by: Leandro Dardini

Review: https://reviewboard.asterisk.org/r/4162/
........

Merged revisions 427709 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 427710 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427711 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix compiler error when using ./configure --enable-dev-mode --enable-coverage
Corey Farrell [Wed, 12 Nov 2014 13:46:25 +0000 (13:46 +0000)] 
Fix compiler error when using ./configure --enable-dev-mode --enable-coverage

When DONT_OPTIMIZE is enabled with dev-mode, it causes a shadow compilation
to be done with output to /dev/null.  This can cause errors with coverage
when GCC attempts to write to /dev/null.gcno.  This change disables
coverage for the shadow compilation.

ASTERISK-24502 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4151/
........

Merged revisions 427682 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 427683 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427684 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agomanager: Fix HTTP connection reference leaks.
Corey Farrell [Sun, 9 Nov 2014 08:00:19 +0000 (08:00 +0000)] 
manager: Fix HTTP connection reference leaks.

Fix reference leak that happens if (session && !blastaway).

ASTERISK-24505 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4153/
........

Merged revisions 427641 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 427642 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427643 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agochannels/chan_mgcp: Fix regression which causes gateways to be skipped
Matthew Jordan [Sun, 9 Nov 2014 00:38:03 +0000 (00:38 +0000)] 
channels/chan_mgcp: Fix regression which causes gateways to be skipped

In r227276, a while loop was turned into a for loop. Unfortunately, a portion
of the while loop was left in the code such that, when a static gateway is
encountered in the list of MGCP gateways, the next gateway would be skipped.
At best, we would simply flip past a gateway; at worst, this could lead to a
crash.

ASTERISK-24500 #close
Reported by: Xavier Hienne
patches:
  chan_mgcp.patch uploaded by Xavier Hienne (License 6657)
........

Merged revisions 427613 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 427614 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427615 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoaddons/chan_mobile: Increase buffer size of UCS2 encoded SMS messages
Matthew Jordan [Sun, 9 Nov 2014 00:25:47 +0000 (00:25 +0000)] 
addons/chan_mobile: Increase buffer size of UCS2 encoded SMS messages

When UCS2 character encoding is used, one symbol in national language can be
expanded to 4 bytes. The current buffer used for receiving message in
do_monitor_phone is 256 bytes, which is not large enough for incoming messages.

For example:
* AT+CMGR phone response prefix
  '+CMGR: "REC UNREAD","+7**********",,"14/10/29,13:31:39+12"\r\n' - 60 bytes
* SMS body with UCS2 encoding (max) - 280 bytes
* AT+CMGR phone response suffix '\r\n\r\nOK\r\n' - 8 bytes
* Terminating null character - 1 byte

This results in a needed buffer size of 349 bytes. Hence, this patch opts for a
350 byte buffer.

ASTERISK-24468 #close
Reported by: Dmitriy Bubnov
patches:
  chan_mobile-1_8.diff uploaded by Dmitriy Bubnov (License 6651)
  chan_mobile-trunk.diff uploaded by Dmitry Bubnov (License 6651)
........

Merged revisions 427607 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 427610 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427611 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoapp_voicemail: Fix enhancement that allowed multiple recipients in To: header
Matthew Jordan [Sun, 9 Nov 2014 00:14:31 +0000 (00:14 +0000)] 
app_voicemail: Fix enhancement that allowed multiple recipients in To: header

An issue existed in r420577, which added multiple recipients to voicemail
emails. The patch, when looking at the intended recipients, looked ahead for
the '|' character inside a while loop which already had pulled out the
appropriate field parsing on the '|' character. This would cause it to skip
the recipients.

This patch fixes it such that it relies completely on the while loop to parse
through the e-mail fields.

Note that the original author of the patch looked at this fix and approved it.

ASTERISK-24250 #close
Reported by: abelbeck
patches:
  voicemail-420577-to-comma-fix.diff uploaded by abelbeck (License 5903)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@427585 65c4cc65-6c06-0410-ace0-fbb531ad65f3