Commit Graph

24689 Commits

Author SHA1 Message Date
Michael L. Young
74320e6955 app_queue: Fix Queuelog EXITWITHKEY only logging two of four fields
Commit r62462 added two extra fields for logging "the original position the
caller entered the queue at, and the amount of time the caller was waiting in
the queue."  But when r75969 was merged from 1.4 into trunk (r75977), these two
fields disappeared. Those two extra fields were not logged in 1.4 and when the
patch was merged, those fields went away.

Therefore, this is a regression and was caught by the reporter because he was
reading the awesome "Asterisk: The Definitive Guide" book.

(closes issue ASTERISK-22197)
Reported by: Dalius M.
Tested by: Dalius M.
Patches:
    asterisk-22197-q-log-exitwithkey.diff
				     uploaded by Michael L. Young (license 5026)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-06 17:11:24 +00:00
Richard Mudgett
e848dbab4f chan_iax2: Fix compile error.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-05 00:41:32 +00:00
Michael L. Young
130fd15c24 Add IPv6 Support To chan_iax2
This patch adds IPv6 support to chan_iax2.  Yay!

(closes issue ASTERISK-22025)
Patches:
  iax2-ipv6-v5-reviewboard.diff by Michael L. Young (license 5026)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 21:40:33 +00:00
David M. Lee
cd2ddccaf2 Added missing file from r400522
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 19:31:35 +00:00
Jonathan Rose
c794605ea5 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/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 18:42:06 +00:00
Jonathan Rose
66137de7e8 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 17:10:27 +00:00
Matthew Jordan
7fc567bd76 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




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 15:54:57 +00:00
Joshua Colp
c1e76f6ccb Enclose the To URI and update its user portion if a request user has been specified.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 15:48:34 +00:00
Joshua Colp
bc81a9000f Replace the connection address at the SDP level if altering the SDP with the external media address.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 14:54:32 +00:00
David M. Lee
096ce6c5b7 Corrected response class for stopPlayback
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 04:54:51 +00:00
Jonathan Rose
624dbb74a5 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 23:11:24 +00:00
Matthew Jordan
19df630819 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.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400460 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 21:40:20 +00:00
Joshua Colp
7cfd95ac44 When serializing CDR variables (like for "core show channels") don't output an error if CDRs aren't enabled.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 19:31:43 +00:00
Kinsey Moore
1f9ac47811 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400440 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 19:29:49 +00:00
Mark Michelson
3422314cb2 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

(closes issue ASTERISK-22532)
reported by Matt Jordan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 19:11:22 +00:00
Joshua Colp
3735f13434 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 19:05:36 +00:00
Richard Mudgett
0dd84b2f51 cel: Some whitespace cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400398 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 18:44:10 +00:00
Kinsey Moore
e59675b597 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400395 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 18:28:57 +00:00
Kinsey Moore
315ec8d7f9 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)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 17:57:49 +00:00
Matthew Jordan
60423755e5 Update Alembic database scripts for external scripting and PostgreSQL, Oracle
This patch does the following:
1) The env scripts have been updated to be tolerant of a NULL configuration
   file. This occurs when configuration is provided by an external script,
   such that the actual config.ini file is not used.
2) Enum types have all been given names. This is needed for PostgreSQL script
   generation.
3) The identifier meetme_confno_starttime_endtime is greater than 30
   characters, and hence invalid for Oracle databases. This has been truncated
   down to meetme_confno_start_end.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 17:55:50 +00:00
Richard Mudgett
72fbce14f4 chan_vpb: Make compile again.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 16:22:45 +00:00
Mark Michelson
3c2d7934b1 Get rid of uses of stasis_topic_wait()
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 14:56:30 +00:00
Joshua Colp
024f9bf283 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-03 14:51:41 +00:00
Mark Michelson
23cea9e44b 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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 22:34:05 +00:00
Mark Michelson
e8dd0da34b Remove svn:mergeinfo property.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 22:10:54 +00:00
Mark Michelson
a38ba34d3d 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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 22:08:49 +00:00
Michael L. Young
f7416ca0af 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 21:32:53 +00:00
Matthew Jordan
1d5b70a564 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 21:25:50 +00:00
Richard Mudgett
d361cd262a 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400303 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 20:30:07 +00:00
Kinsey Moore
1dc2ea65f7 Correct allowable values for ARI general information filter
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400291 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 19:19:25 +00:00
Matthew Jordan
3ccb6a9ea5 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 18:57:15 +00:00
Joshua Colp
94a673a878 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 18:42:41 +00:00
Tzafrir Cohen
de4ce10095 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400281 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 18:25:16 +00:00
Richard Mudgett
1a7783c7f8 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 17:11:42 +00:00
Richard Mudgett
c114871a68 sig_ss7: Fix compiler warnings.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 17:05:13 +00:00
Joshua Colp
1dd63fbdfa 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 16:20:25 +00:00
Joshua Colp
1e22b90efe 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


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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 15:22:54 +00:00
Joshua Colp
48132c1d8c Retrieve and store the hostname only once so multiple threads do not potentially initialize it at the same time.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 14:13:08 +00:00
Richard Mudgett
dfc077bdf6 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400236 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-01 21:17:56 +00:00
Richard Mudgett
d3f1f5369f Features: Rearm the parking config options have moved warning for each reload.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-01 16:34:51 +00:00
Matthew Jordan
2efa0948dc 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-01 15:48:42 +00:00
Jonathan Rose
7b9d250ffa 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400205 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 21:31:54 +00:00
Matthew Jordan
dafa9e4e72 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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 19:57:36 +00:00
Matthew Jordan
fa0d221bd3 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 19:44:54 +00:00
David M. Lee
516dbe86a0 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400181 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 18:48:57 +00:00
David M. Lee
9d21631aee 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 18:39:34 +00:00
David M. Lee
e88afe2022 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400178 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 18:26:27 +00:00
Kinsey Moore
52d73f05f4 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400141 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 15:55:26 +00:00
David M. Lee
48d90d947d 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 15:24:00 +00:00