Commit Graph

26040 Commits

Author SHA1 Message Date
Joshua Colp b5182a6795 res_pjsip_t38: Fix T.38 failure when peer reinvites immediately.
If a remote endpoint reinvites to T.38 immediately the state machine
will go into a peer reinvite state. If a T.38 capable application
(such as ReceiveFax) queries it will receive this state. Normally
the application will then indicate so that the channel driver will
queue up the T.38 offer previously received. Once it receives this
offer the application will act normally and negotiate.

The res_pjsip_t38 module incorrectly partially squashed this indication.
This would cause the application to think the request had failed when
in reality it had actually worked.

This change makes it so that no T.38 control frames (or indications)
are squashed.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-16 15:44:43 +00:00
George Joseph 39b54a21dc res_pjsip_config_wizard: Allow streamlined config of common pjsip scenarios
res_pjsip_config_wizard
------------------
 * This is a new module that adds streamlined configuration capability for
   chan_pjsip.  It's targetted at users who have lots of basic configuration
   scenarios like 'phone' or 'agent' or 'trunk'.  Additional information
   can be found in the sample configuration file at
   config/samples/pjsip_wizard.conf.sample.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-15 17:08:24 +00:00
Mark Michelson 53e5b377a0 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/trunk@429573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-15 15:48:47 +00:00
George Joseph 6472568bc6 loader: Move definition of ast_module_reload from _private.h to module.h
No functionality change.  Just move the definition of ast_module_reload
from _private.h to module.h so it can be public.

Also removed the include of _private.h from manager.c since ast_module_load
was the only reason for including it.

Tested-by: George Joseph

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-12 23:57:50 +00:00
Richard Mudgett 308c1b41dd 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-12 23:49:36 +00:00
Matthew Jordan 901221ffae 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/trunk@429520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-12 22:54:02 +00:00
Joshua Colp 8d325be503 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/trunk@429498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-12 17:01:42 +00:00
Kevin Harwell 72499dc697 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/trunk@429478 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-12 15:31:38 +00:00
David M. Lee 2e6d2b1484 Fix crash for sorcery misconfigs
res_pjsip_outbound_publish was missing the CHECK_PJSIP_MODULE_LOADED()
call in load_module, and would crash with a segfault if res_pjsip
declined to load.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-12 15:03:16 +00:00
Kinsey Moore a6cf13f2e9 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/trunk@429434 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-12 14:12:38 +00:00
Kinsey Moore b99770d4fe Sorcery: Log when old config remains in use
This adds a log message notifying the user that a stale configuration
is in place upon reload when a config object fails to load. This
situation can end up causing confusion when the object failed to load
but exists from a previous config load especially when the old config
is significantly different from the new config.

Review: https://reviewboard.asterisk.org/r/4250/
Reported by: Thomas Thompson
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-12 14:04:06 +00:00
Joshua Colp 74d43977cf 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/trunk@429410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-12 13:06:24 +00:00
Joshua Colp 8d384f3825 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/trunk@429408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-12 12:32:13 +00:00
Kevin Harwell 63d3f0af95 ARI/AMI: Include language in standard channel snapshot output
The CHANGES verbiage for the "language" addition had been put under the wrong
release. This moves it to be under 13.1 to 13.2 changes.

ASTERISK-24553
Reported by: Matt Jordan
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-11 20:32:21 +00:00
Kinsey Moore d64b9904fd 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/trunk@429353 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-11 13:53:39 +00:00
Kevin Harwell e890f9f653 ARI/AMI: Include language in standard channel snapshot output
Adding information about including "language" in the standard channel snapshot
output to the CHANGES file. Note the actual source changes have already been
previously committed.

ASTERISK-24553
Reported by: Matt Jordan
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-10 15:43:48 +00:00
Joshua Colp 03c94ef761 res_http_websocket: Fix crash due to double freeing memory when receiving a payload length of zero.
Frames with a payload length of 0 were incorrectly handled in res_http_websocket.
Provided a frame with a payload had been received prior it was possible for a double
free to occur. The realloc operation would succeed (thus freeing the payload) but be
treated as an error. When the session was then torn down the payload would be
freed again causing a crash. The read function now takes this into account.

This change also fixes assumptions made by users of res_http_websocket. There is no
guarantee that a frame received from it will be NULL terminated.

ASTERISK-24472 #close
Reported by: Badalian Vyacheslav

Review: https://reviewboard.asterisk.org/r/4220/
Review: https://reviewboard.asterisk.org/r/4219/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-10 13:35:52 +00:00
Kinsey Moore 0cba439c4d 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 429246 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429247 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-10 13:16:19 +00:00
Scott Griepentrog 8fe45f0f0a core: avoid possible asterisk -r crash from long id
When connecting to the remote console, an id string
is first provided that consts of the hostname, pid,
and version.  This is parsed by the remote instance
using a buffer that may be too short, and can allow
a buffer overrun because it is not terminated. This
patch adds termination and a larger buffer.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-09 20:47:05 +00:00
Kevin Harwell d673209abc 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/trunk@429209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-09 20:20:27 +00:00
Kevin Harwell c17cef1c38 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/trunk@429197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-09 20:03:22 +00:00
Kevin Harwell 7844266e21 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/trunk@429176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-09 18:36:47 +00:00
Joshua Colp 60ab564ad2 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/trunk@429154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-09 15:45:19 +00:00
Kinsey Moore b6e18cae5c 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-09 14:01:43 +00:00
Matthew Jordan fe6cbf455a 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.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-08 16:54:43 +00:00
Mark Michelson bba1763f47 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-08 16:43:00 +00:00
Mark Michelson fe7671fee6 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-08 16:24:36 +00:00
Kinsey Moore 4bb556a847 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-08 15:45:46 +00:00
Matthew Jordan 49aa87e17c 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429034 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-06 18:16:49 +00:00
Matthew Jordan 0cdb71aae9 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-06 17:36:21 +00:00
George Joseph d04445c24a 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429001 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-05 17:08:27 +00:00
Matthew Jordan 19992844be 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-04 17:13:48 +00:00
Matthew Jordan 343a83d7d8 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-04 15:48:26 +00:00
Matthew Jordan 7cb2c446b4 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-03 20:59:01 +00:00
Matthew Jordan 7475e1c948 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-03 19:49:38 +00:00
Matthew Jordan 6d4ef7ddf4 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-03 16:45:24 +00:00
George Joseph 63cbd28999 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-02 21:54:05 +00:00
Matthew Jordan dd00e80cbe 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.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428816 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-02 19:04:02 +00:00
Matthew Jordan 08636aadec 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-02 17:10:57 +00:00
Joshua Colp 0c1aaa7da5 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-02 12:21:34 +00:00
George Joseph f128ff61ab 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-02 00:38:56 +00:00
George Joseph f418f25c44 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-02 00:31:49 +00:00
Joshua Colp 4ff6bd831f rtp_engine: Add support for transporting signed linear at 12kHz, 24kHz, 32kHz, 44kHz, 48kHz, 96kHz, and 192kHz over RTP.
This change adds mappings in the RTP engine layer for the remaining signed linear formats.

ASTERISK-24274 #close
Reported by: Frankie Chin

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428708 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-01 18:51:52 +00:00
Matthew Jordan 1106e8fd0f 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-01 17:59:21 +00:00
Joshua Colp ef9ca8bc32 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-01 13:41:43 +00:00
Joshua Colp 7db3d1642b 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/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428633 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-12-01 13:08:23 +00:00
Richard Mudgett 3e08619faf 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/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-24 20:39:01 +00:00
Richard Mudgett c38ffca9a1 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-24 20:32:29 +00:00
Richard Mudgett 3576ae47f4 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-21 19:16:55 +00:00
George Joseph 4394e0431c 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-21 17:49:39 +00:00