Commit Graph

24729 Commits

Author SHA1 Message Date
Jonathan Rose f4ebdca52a chan_pjsip: Make logger togglable without loading/unloading
This patch makes the res_pjsip_logger do a few things... First, it
will be built and installed by default now, so end users won't need
to enable it in menuselect. Second, while it is loaded, it no longer
will immediately issue log messages. Upon loading, it is in the
disabled state and must be turned on with the new CLI command. The
CLI command 'pjsip set logger <on/off/host> has been added and can be
used to do the following:
pjsip set logger on:
    Enables logger for all PJSIP traffic
pjsip set logger off:
    Disables logger for all PJSIP traffic
pjsip set logger host <host>:
    Enables logger for the specific host

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 19:11:38 +00:00
Jonathan Rose 44bd543181 chan_pjsip: Add alembic scripts for generating db tables for PJSIP
Also updates sample configurations for sorcery and extconfig to
demonstrate how to use databases created by that alembic script.

(closes issue ASTERISK-22133)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2892/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 18:13:37 +00:00
Matthew Jordan 8d7873b836 ARI: Add subscription support
This patch adds an /applications API to ARI, allowing explicit management of
Stasis applications.

 * GET /applications - list current applications
 * GET /applications/{applicationName} - get details of a specific application
 * POST /applications/{applicationName}/subscription - explicitly subscribe to
   a channel, bridge or endpoint
 * DELETE /applications/{applicationName}/subscription - explicitly unsubscribe
   from a channel, bridge or endpoint

Subscriptions work by a reference counting mechanism: if you subscript to an
event source X number of times, you must unsubscribe X number of times to stop
receiveing events for that event source.

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

(issue ASTERISK-22451)
Reported by: Matt Jordan
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 16:01:48 +00:00
Joshua Colp b52c972b17 Enclose the To URI and update its user portion if a request user has been specified.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 15:49:39 +00:00
Joshua Colp 47da03e737 Replace the connection address at the SDP level if altering the SDP with the external media address.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 14:55:22 +00:00
Jonathan Rose d35b5c9cb0 chan_sip: Don't ignore expires value in contact header if it lacks semicolon
(closes issue ASTERISK-22574)
Reported by: Filip Jenicek
Patches:
    chan_sip_expires.patch uploaded by Filip Jenicek (license 6277)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 23:20:00 +00:00
Matthew Jordan facebb3f3c Remove publication of a channel snapshot when the technology is set
This patch removes said publication for a few reasons:
(1) It is unnecessary. Association of the channel technology with a specific
channel is an implementation detail that should be assumed to "just happen",
and consumers of Stasis don't need to be informed about it.
(2) Publication of said message can now cause crashes, as the actual creation
of a channel in normal locations now stages its messages. As a result, things
that create dummy channels (such as the SIP RTP QOS unit test) and associate
them with a channel technology were now crashing, as the channel itself was
not known by Stasis.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 21:46:07 +00:00
Mark Michelson b11983d480 Fix assumption in bridge_native_rtp.c regarding number of participants in a bridge.
When a party leaves a bridge, there may be more participants in the bridge than expected.
As such, it is important not to make assumptions regarding the list of channels in a
bridge.

This change makes it so that when a party leaves a native RTP bridge, we unbridge it and
the party it was bridged with. Previously, the first and last channels in the list were
unbridged since it was assumed that these were the two channels that had been bridged. As
previously stated, a new party had been inserted into the bridge, so this logic did not
work properly.

(closes issue ASTERISK-22615)
reported by Matt Jordan

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 20:22:17 +00:00
Joshua Colp 9826923805 When serializing CDR variables (like for "core show channels") don't output an error if CDRs aren't enabled.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400443 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 19:32:46 +00:00
Kinsey Moore fe4cd68444 Fix security events for AMI invalid password
In r337595, additional security events were added for chan_sip
authentication failures. The new IEs added to the existing invalid
password event were defined as required IEs, but existing users of the
event did not set the new IEs and could not since they didn't apply to
existing uses. They are now marked as optional IEs.

(closes issue ASTERISK-22578)
Reported by: Matt Jordan
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400441 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 19:30:33 +00:00
Joshua Colp bd8cf10d60 Fix a crash caused by muting and unmuting a channel in ARI without specifying a direction.
(closes issue ASTERISK-22637)
Reported by: Scott Griepentrog

Patch by Matt Jordan, whose office I have taken over in the name of Canada.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400402 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 19:06:48 +00:00
Richard Mudgett 7e698f1f42 cel: Some whitespace cleanups
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400399 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 18:51:33 +00:00
Kinsey Moore c3b1d8f8c1 res_rtp_multicast: Ensure SSRC is set properly
This fixes a bug where the SSRC field on multicast RTP can be stuck at
0 which can cause problems for endpoints trying to make sense of
incoming streams.

(closes issue ASTERISK-22567)
Reported by: Simone Camporeale
Patches:
    22567_res_mulitcast_ssrc.patch uploaded by Simone Camporeale (License 6536)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 18:32:59 +00:00
Kinsey Moore 3578bc30fd Detect and use xsltCleanupGlobals when available
This introduces usage of an additional libxslt cleanup function,
xsltCleanupGlobals, when the configure script detects that it is
available. Early versions of the library did not include this function.

(closes issue ASTERISK-22570)
Reported by: Corey Farrell
Patches:
    xsltCleanupGlobals.patch uploaded by Corey Farrell (License 5909)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 18:00:15 +00:00
Richard Mudgett e3d69a5628 chan_vpb: Make compile again.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 16:28:35 +00:00
Mark Michelson f945c6a207 Get rid of uses of stasis_topic_wait()
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 14:59:29 +00:00
Mark Michelson ee21eee7e0 Cache string values of formats on ast_format_cap() to save processing.
Channel snapshots have string representations of the channel's native formats.
Prior to this change, the format strings were re-created on ever channel snapshot
creation. Since channel native formats rarely change, this was very wasteful.
Now, string representations of formats may optionally be stored on the ast_format_cap
for cases where string representations may be requested frequently. When formats
are altered, the string cache is marked as invalid. When strings are requested, the
cache validity is checked. If the cache is valid, then the cached strings are copied.
If the cache is invalid, then the string cache is rebuilt and copied, and the cache
is marked as being valid again.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 14:58:16 +00:00
Joshua Colp c977f73e13 Fix crashes in res_pjsip_sdp_rtp and res_pjsip_t38 when a stream is rejected and external_media_address is set.
The callback function for changing the media address in streams wrongly assumes that a connection line
will always be present. This is false as no line is present if a stream has been rejected.

(closes issue ASTERISK-22645)
Reported by: Rusty Newton
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 14:52:24 +00:00
Mark Michelson addbf276f5 Multiple revisions 400318-400319
........
  r400318 | mmichelson | 2013-10-02 17:08:49 -0500 (Wed, 02 Oct 2013) | 12 lines
  
  Remove unnecessary waits from stasis.
  
  Since caches are updated on publisher threads, there is no need
  to wait for the cache updates to occur after a stasis message
  is published.
  
  In the case of chan_pjsip device state changes, this set of
  changes caused an improvement to performance.
  
  Review: https://reviewboard.asterisk.org/r/2890
........
  r400319 | mmichelson | 2013-10-02 17:10:54 -0500 (Wed, 02 Oct 2013) | 3 lines
  
  Remove svn:mergeinfo property.
........

Merged revisions 400318-400319 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 22:22:17 +00:00
Michael L. Young e4ed9886e6 Cast Integer Argument To Unsigned Char
The member reg in the peercnt structure is an unsigned char and peercnt_modify()
is expecting an unsigned char argument which gets assigned to peercnt->reg.

This patch fixes that by casting the integer argument being passed to
peercnt_modify to unsigned char.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 21:33:42 +00:00
Matthew Jordan 6e2b1a54ab Only create Stasis subscriptions when enabled
Subscribing to Stasis isn't free.

As such, this patch makes AMI, CDR, and CEL - the "big 3" - only subscribe
when enabled. Toggling their availability via a .conf file will
unsubscribe/subscribe as appropriate.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400313 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 21:26:34 +00:00
Richard Mudgett be62f83d54 Originate: Make setting caller id on outgoing call use either name or number.
Previous code was requiring both name and number to be available.

Also restored a comment block on why caller id is also set on an outgoing
call leg in addition to connected line from earlier versions of Asterisk.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 20:31:02 +00:00
Kinsey Moore 8195eeac45 Correct allowable values for ARI general information filter
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 19:20:27 +00:00
Matthew Jordan 9283987418 Fix the CDR CLI command 'cdr show active {channel}'
When the switch from channel names to channel unique IDs happened, the poor
CLI command got left in the dust. This fixes the command so that users can
once again see how Asterisk is messing up your billing information.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 19:17:15 +00:00
Joshua Colp 51a9b93a14 Fix a crash in res_pjsip_t38 caused by the wrong assumption that a session will always have a channel.
When starting up or shutting down this assumption is false.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 18:44:48 +00:00
Tzafrir Cohen e2204a1e61 man pages for astdb2bdb and astdb2sqlite3
Review: https://reviewboard.asterisk.org/r/2898/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 18:28:03 +00:00
Richard Mudgett 97fcd6366d MALLOC_DEBUG: Fix some misuses of free() when MALLOC_DEBUG is enabled.
* There were several places in ARI where an external library was mallocing
memory that must always be released with free().  When MALLOC_DEBUG is
enabled, free() is redirected to the MALLOC_DEBUG version.  Since the
external library call still uses the normal malloc(), MALLOC_DEBUG
complains that the freed memory block is not registered and will not free
it.  These cases must use ast_std_free().

* Changed calls to asprintf() and vasprintf() to the equivalent
ast_asprintf() and ast_vasprintf() versions respectively.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 17:12:49 +00:00
Richard Mudgett d14869bcad sig_ss7: Fix compiler warnings.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 17:10:39 +00:00
Joshua Colp c1235f2639 Reduce channel snapshot creation and publishing by up to 50%.
This change introduces the ability to stage channel snapshot
creation and publishing by suppressing the implicit creation
and publishing that some functions have. Once all operations
are executed the staging is marked as done and a single snapshot
is created and published.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 16:23:34 +00:00
Joshua Colp 424c0f2eb7 Fix a random one way audio issue in PJSIP.
Due to the asynchronous design of the PJMEDIA SDP negotiator it was possible for
the SDP to be negotiated *after* a channel was created and after it was being wait
on by an application. It is only after negotiation occurs that the file descriptors
for RTP are placed on the channel. Since the channel was already being waited on
these file descriptors were not monitored, causing incoming media to never be read.

This change wakes up any application waiting on the channel so that added file
descriptors end up being monitored.

(closes issue AST-1227)
Reported by: John Bigelow
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 15:33:56 +00:00
Joshua Colp 83d55f85ec Allow specifying a channel to dial an extension and context in an ARI dial operation.
(issue ASTERISK-22625)
Reported by: Scott Griepentrog
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 15:24:16 +00:00
Joshua Colp c33aac75e4 Retrieve and store the hostname only once so multiple threads do not potentially initialize it at the same time.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 14:13:55 +00:00
Richard Mudgett 7d17d5fb04 chan_dahdi: Fix analog parking using flash-hook.
Transferring an analog call using a flash-hook to parking would fail to
park the call and result in an invalid ao2 object unref.

* Park the correct bridged channel.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-01 21:19:13 +00:00
Richard Mudgett a0db5275ed Features: Rearm the parking config options have moved warning for each reload.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400228 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-01 16:44:22 +00:00
Matthew Jordan d196d73256 Filter out internal channels for bridge leave messages and parked call messages
Granted, if you manage to park a Conference announcer channel, something has
gone horrifically wrong.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-01 15:54:05 +00:00
Jonathan Rose 8fbe62f5df configuration samples: Pull all parking related stuff out of features.conf
This patch also adds documentation for parking from features.conf to
res_parking.conf
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 21:40:36 +00:00
Matthew Jordan de07050d0f Parse arguments passed to the CDR_PROP function correctly
I can only blame this on a bad merge, because this in no way worked properly
the way it was written. Mea culpa. The function should now parse its arguments
correctly and function properly. (Note that the API used by the CDR_PROP
function has working unit tests... this was merely bad coding of the actual
registered function)

(closes issue ASTERISK-22613)
Reported by: Private Name
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 19:58:19 +00:00
Matthew Jordan 9ede397005 Remove spurious event raised when CDRs are reloaded
The Reload event is now raised by the module loading core. As such, the Reload
event in the CDR engine was a duplicate and not needed.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 19:53:50 +00:00
David M. Lee 2de42c2a25 Multiple revisions 399887,400138,400178,400180-400181
........
  r399887 | dlee | 2013-09-26 10:41:47 -0500 (Thu, 26 Sep 2013) | 1 line
  
  Minor performance bump by not allocate manager variable struct if we don't need it
........
  r400138 | dlee | 2013-09-30 10:24:00 -0500 (Mon, 30 Sep 2013) | 23 lines
  
  Stasis performance improvements
  
  This patch addresses several performance problems that were found in
  the initial performance testing of Asterisk 12.
  
  The Stasis dispatch object was allocated as an AO2 object, even though
  it has a very confined lifecycle. This was replaced with a straight
  ast_malloc().
  
  The Stasis message router was spending an inordinate amount of time
  searching hash tables. In this case, most of our routers had 6 or
  fewer routes in them to begin with. This was replaced with an array
  that's searched linearly for the route.
  
  We more heavily rely on AO2 objects in Asterisk 12, and the memset()
  in ao2_ref() actually became noticeable on the profile. This was
  #ifdef'ed to only run when AO2_DEBUG was enabled.
  
  After being misled by an erroneous comment in taskprocessor.c during
  profiling, the wrong comment was removed.
  
  Review: https://reviewboard.asterisk.org/r/2873/
........
  r400178 | dlee | 2013-09-30 13:26:27 -0500 (Mon, 30 Sep 2013) | 24 lines
  
  Taskprocessor optimization; switch Stasis to use taskprocessors
  
  This patch optimizes taskprocessor to use a semaphore for signaling,
  which the OS can do a better job at managing contention and waiting
  that we can with a mutex and condition.
  
  The taskprocessor execution was also slightly optimized to reduce the
  number of locks taken.
  
  The only observable difference in the taskprocessor implementation is
  that when the final reference to the taskprocessor goes away, it will
  execute all tasks to completion instead of discarding the unexecuted
  tasks.
  
  For systems where unnamed semaphores are not supported, a really
  simple semaphore implementation is provided. (Which gives identical
  performance as the original taskprocessor implementation).
  
  The way we ended up implementing Stasis caused the threadpool to be a
  burden instead of a boost to performance. This was switched to just
  use taskprocessors directly for subscriptions.
  
  Review: https://reviewboard.asterisk.org/r/2881/
........
  r400180 | dlee | 2013-09-30 13:39:34 -0500 (Mon, 30 Sep 2013) | 28 lines
  
  Optimize how Stasis forwards are dispatched
  
  This patch optimizes how forwards are dispatched in Stasis.
  
  Originally, forwards were dispatched as subscriptions that are invoked
  on the publishing thread. This did not account for the vast number of
  forwards we would end up having in the system, and the amount of work it
  would take to walk though the forward subscriptions.
  
  This patch modifies Stasis so that rather than walking the tree of
  forwards on every dispatch, when forwards and subscriptions are changed,
  the subscriber list for every topic in the tree is changed.
  
  This has a couple of benefits. First, this reduces the workload of
  dispatching messages. It also reduces contention when dispatching to
  different topics that happen to forward to the same aggregation topic
  (as happens with all of the channel, bridge and endpoint topics).
  
  Since forwards are no longer subscriptions, the bulk of this patch is
  simply changing stasis_subscription objects to stasis_forward objects
  (which, admittedly, I should have done in the first place.)
  
  Since this required me to yet again put in a growing array, I finally
  abstracted that out into a set of ast_vector macros in
  asterisk/vector.h.
  
  Review: https://reviewboard.asterisk.org/r/2883/
........
  r400181 | dlee | 2013-09-30 13:48:57 -0500 (Mon, 30 Sep 2013) | 28 lines
  
  Remove dispatch object allocation from Stasis publishing
  
  While looking for areas for performance improvement, I realized that an
  unused feature in Stasis was negatively impacting performance.
  
  When a message is sent to a subscriber, a dispatch object is allocated
  for the dispatch, containing the topic the message was published to, the
  subscriber the message is being sent to, and the message itself.
  
  The topic is actually unused by any subscriber in Asterisk today. And
  the subscriber is associated with the taskprocessor the message is being
  dispatched to.
  
  First, this patch removes the unused topic parameter from Stasis
  subscription callbacks.
  
  Second, this patch introduces the concept of taskprocessor local data,
  data that may be set on a taskprocessor and provided along with the data
  pointer when a task is pushed using the ast_taskprocessor_push_local()
  call. This allows the task to have both data specific to that
  taskprocessor, in addition to data specific to that invocation.
  
  With those two changes, the dispatch object can be removed completely,
  and the message is simply refcounted and sent directly to the
  taskprocessor.
  
  Review: https://reviewboard.asterisk.org/r/2884/
........

Merged revisions 399887,400138,400178,400180-400181 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 18:55:27 +00:00
David M. Lee db7c8691a0 Blocked revisions 399306
........
Blocked revisions 399305

........
Fix Segfault When Syntax Of A Line Under [applicationmap] Is Invalid

When processing the lines under the [applicationmap] context in features.conf, a
segfault occurs from attempting to process a line with an invalid syntax
(basically missing most of the arguments).

Example:
[applicationmap]
automon=*6

* This patch moves the checking for empty arguments to before they are accessed.

* Also, checked the "todo" comment and removed it.  Some applications do not
  require arguments.

(closes issue ASTERISK-22416)
Reported by: CGI.NET
Tested by: CGI.NET
Patches:
    asterisk-22416-check-syntax-first_v2.diff by Michael L. Young (license 5026)

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 18:52:44 +00:00
Kinsey Moore b44ce141e5 chan_sip: Allow Asterisk to retry after 403 on register
This adds a global option in chan_sip to allow it to continue
attempting registration if a 403 is received, clearing the cached nonce
and treating it as a non-fatal response. Normally, this would cause
registration attempts to that endpoint to stop.

This also adds a similar per-outbound-registration option to chan_pjsip
which allows the retry interval to be altered for 403 responses to
REGISTER requests.

(closes issue ASTERISK-17138)
Review: https://reviewboard.asterisk.org/r/2874/
Reported by: Rudi
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 15:57:11 +00:00
Matthew Jordan a1d56da32a res_pjsip_notify: Add documentation
We forgot to add documentation for res_pjsip_notify, which would prevent it
from being loaded. Whoops.

This patch also updates res_pjsip_notify to use pjsip_notify.conf, which now
has its own sample file in the configs directory as well.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-28 22:57:17 +00:00
Matthew Jordan c4b5c549fd res_rtp_asterisk: Correct erroneous lost packet information in RTCP reports
RTCP's calculation of the number of lost packets in an RTP stream is based on
that stream's sequence number count, the number of received packets, and how
many packets we expect to receive. When the SSRC for an RTP stream changes,
there can - and almost always will be - a large jump in the next packet's
timestamp and sequence number. If we don't reset the number of received
packets, sequence number count, and other metrics used by RTCP, the next RR/SR
report will use the previous SSRC's values to calculate the lost packet count
for the new SSRC - resulting in a very large number of lost packets.

This patch modifies res_rtp_asterisk such that, if it detects a SSRC change, it
will reset the various values used by the RTCP calculations. From the
perspective of RTCP, this appears as a new media stream - which is what it is.

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

(closes issue AST-1174)
Reported by: Thomas Arimont
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-28 22:32:18 +00:00
Matthew Jordan 8ddd829b8b Add check for openSUSE when detecting bfd library
In ASTERISK-17842, some additional library checks were added to the configure
script so that the bfd library could be found on CentOS and Fedora systems.

As it turns out, openSUSE requires an additional library. This patch adds
another check to the configure script for openSUSE that will add that library.

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

(closes issue AST-1169)
Reported by: Guenther Kelleter
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-28 22:13:57 +00:00
Matthew Jordan 34f18cc7f1 CDR: Improve handling of parking; resolve assertion when originating into park
This patch covers two problems:

1) Currently, when a call is transferred into a parking lot from a bridge
   (using either the blind transfer or one touch parking mechanisms), the
   application fails to be set to "Park" in the resulting CDR record for
   the parked channel. This is due to the ParkedCall message arriving before
   the BridgeEnter for the channel entering the parking bridge. The ParkedCall
   message isn't handled as the CDR for the channel has already been finalized
   (due to the channel having left its two party bridge), and the BridgeEnter -
   which creates the new CDR - doesn't have the parking information. This patch
   modifies the behavior so that reception of a ParkedCall message will - if
   not handled by a CDR chain - cause a new CDR to be created and put into the
   Parking state.

2) It fixes a FRACK that occurred when a channel is originated into a parking
   space. The DialedPending state - which occurs for both Dialed and Originated
   channels - assumed that it couldn't handle the parking transitions due to it
   having a Party B; however, Originated channels don't have a Party B. As such,
   the existing CDR needs to transition into the parking state - this patch does
   that.

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

(closes issue ASTERISK-22482)
Reported by: Richard Mudgett
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-28 20:55:48 +00:00
Matthew Jordan ccab0f27bc app_queue: Make manager events tolerant of Local channel shenanigans
app_queue currently attempts to handle Local channel optimizations in an effort
to provide accurate information in Stasis messages (and their corresponding
AMI events) as well as the Queue log. Sometimes, however, things don't go as
planned.

Consider the following scenario:
 SIP/foo <-> L;1 <-> L;2 <-> SIP/agent

SIP/agent answers, triggering a Local channel optimization. app_queue will
normally do the following:
 * Listen for the Local optimization events and update our agent accordingly
   to SIP/agent in the queue log and messages
 * When we get a hangup, publish the AgentComplete event based on our
   information (SIP/foo and SIP/agent)

However, as with all things that depend on sanity from something as capricious
as Local channels, things can go wrong:
 (1) SIP/agent immediately hangs up upon answering. This triggers a race
     condition between termination messages coming from SIP/agent and the
     ongoing Local channel optimization messages. (Note that this can also
     occur with SIP/foo)
 (2) In a race condition, Asterisk can (rarely) deliver the hangup messages
     prior to the Local channel optimization.

In that case, the messages *may* arrive to app_queue in the following order:
 * Hangup SIP/Agent
 * Hangup SIP/foo
 * Optimize L;1/L;2
 * Hangup L;2
 * Hangup L;1

When app_queue receives the hangup of the agent or the caller, it will attempt
to publish the AgentComplete event. However, it now has a problem - it thinks
its agent is the ;1 side of the Local channel, as it never received the
optimization event. At the same time, that channel is already gone. This
results in getting NULL from the Stasis cache. What's more, we can't really
wait for the optimization message, as we are currently handling the hangup
of the channel that the optimization event would tell us to use.

This patch modifies the behavior in app_queue such that, since we still have a
lot of pertinent queue information (interface, queue name, etc.), we now raise
the event with what information we know. The channels involved now may or may
not be present. Users will still at least get the "AgentComplete" event, which
"completes" the known Agent information.

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

(closes issue ASTERISK-22507)
Reported by: Richard Mudgett
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-28 20:39:10 +00:00
Matthew Jordan 2ef63eaf34 manager: Fix crash when appending a manager channel variable
In r399887, a minor performance improvement was introduced by not allocating
the manager variable struct if it wasn't used. Unfortunately, when directly
accessing an ast_channel struct, manager assumed that the struct was always
allocated. Since this was no longer the case, things got a bit crashy.

This fixes that problem by simply bypassing appending variables if the manager
channel variable struct isn't there.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-28 20:27:23 +00:00
Richard Mudgett 2b32732aa8 app_cdr and res_parking: Fix some resource leaks.
* app_cdr left the ResetCDR application registered.

* res_parking leaked a ref to config global.

(closes issue ASTERISK-22566)
Reported by: Corey Farrell
Patches:
      ASTERISK-22566-r2.patch (license #5909) patch uploaded by Corey Farrell
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-27 21:58:05 +00:00
Richard Mudgett 9f19d096e3 chan_sip: Increase some scratch buffer sizes dealing with caller id.
* Eliminated an unnecessary initialization in check_user_full().

(closes issue ASTERISK-22477)
Reported by: Michael Shepelev
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400016 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-27 21:44:42 +00:00
Sean Bright 89b8ff5d78 Remove some trailing whitespace and steal revision 400000.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-27 19:18:55 +00:00