summaryrefslogtreecommitdiff
path: root/channels
AgeCommit message (Collapse)Author
2013-10-03chan_sip: Don't ignore expires value in contact header if it lacks semicolonJonathan Rose
(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-03chan_vpb: Make compile again.Richard Mudgett
........ 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-03Cache string values of formats on ast_format_cap() to save processing.Mark Michelson
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-02Multiple revisions 400318-400319Mark Michelson
........ 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-02Cast Integer Argument To Unsigned CharMichael L. Young
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-02sig_ss7: Fix compiler warnings.Richard Mudgett
........ 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-02Reduce channel snapshot creation and publishing by up to 50%.Joshua Colp
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-01chan_dahdi: Fix analog parking using flash-hook.Richard Mudgett
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-09-30Multiple revisions 399887,400138,400178,400180-400181David M. Lee
........ 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-30chan_sip: Allow Asterisk to retry after 403 on registerKinsey Moore
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-27chan_sip: Increase some scratch buffer sizes dealing with caller id.Richard Mudgett
* 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-27chan_sip: Reject calls on 200 OKs if no SDP has been receivedJonathan Rose
When Asterisk receives a 200 OK in response to an invite, that peer should have sent an SDP at some point by then. If the channel has never received an SDP, media won't have been set and the remote address won't be known. Endpoints in general should not be doing this. This patch makes it so that Asterisk will simply hang up a call if it sends a 200 OK at this point. So far this odd behavior for endpoints has only been observed in tests which involved manually created SIP transactions in SIPp. (closes issue ASTERISK-22424) Reported by: Jonathan Rose Review: https://reviewboard.asterisk.org/r/2827/ ........ Merged revisions 399939 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399962 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 399976 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-25chan_dahdi: CLI "core stop gracefully" has needless delay for PRI and SS7.Richard Mudgett
The PRI and SS7 link control threads are not stopped correctly when the chan_dahdi.so module is unloaded. The link control threads pri_dchannel() and ss7_linkset() are not awakened from a poll() to cancel the thread. * Added a SIGURG signal after requesting the thread cancel to break the link control thread poll() immediately. For SS7 it was slightly worse, the link poll() timeout would always be whatever was the last libss7 scheduled event time used. If no libss7 scheduled event was pending, the thread could run more often than necessary. * Set nextms to 60 seconds for the ss7_linkset() poll() if there is no other libss7 scheduled event. ........ Merged revisions 399818 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399834 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 399842 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-25chan_sip: Fix Realtime Peer Update Problem When Un-registering And Expires ↵Michael L. Young
Header In 200ok 1st Issue When a realtime peer sends an un-REGISTER request, Asterisk un-registers the peer but the database table record still has regseconds and fullcontact for the peer. This results in calls attempting to be routed to the peer which is no longer registered. The expected behavior is to get busy/congested when attempting to call an un-registered peer through the dialplan. What was discovered is that we are clearing out the peer's registration in the database in parse_register_contact() when calling expire_register() but then upon returning from parse_register_contact(), update_peer() is run which stores back in the database table regseconds and fullcontact. 2nd Issue The reporter pointed out that the 200 ok being returned by Asterisk after un-registering a peer contains a Contact header with ;expires= and the Expires header is not set to 0. This is actually a regression. Tests were created for this second issue (ASTERISK-22548). The tests have been reviewed and a Ship It! was received on those tests. This patch does the following: * Do not ignore the Expires header value even when it is set to 0. The patch sets the pvt->expiry earlier on in the function so that it is set properly and used. * If pvt->expiry is 0, do not call update_peer since that means the peer has already been un-registered and there is no need to update the database record again since nothing has changed. (closes issue ASTERISK-22428) Reported by: Ben Smithurst Tested by: Ben Smithurst, Michael L. Young Patches: asterisk-22428-rt-peer-update-and-expires-header.diff by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2869/ ........ Merged revisions 399794 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399795 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 399796 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399797 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-24chan_iax2: Prevent some needless breaking of the native IAX2 bridge.Richard Mudgett
* Clean up some twisted code in the iax2_bridge() loop. * Add AST_CONTROL_VIDUPDATE and AST_CONTROL_SRCCHANGE to a list of frames to prevent the native bridge loop from breaking. * Passing the AST_CONTROL_T38_PARAMETERS frame should also allow FAX over a native IAX2 bridge. (issue ABE-2912) Review: https://reviewboard.asterisk.org/r/2870/ ........ Merged revisions 399697 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399708 from http://svn.asterisk.org/svn/asterisk/branches/11 For v12 and above this is really just documentation until IAX2 native bridging is restored. ........ Merged revisions 399736 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-20Add a missing session supplement unregistration in chan_pjsip for ACKs.Joshua Colp
(closes issue ASTERISK-22453) Reported by: Corey Farrell Patches: chan_pjsip_session_unregister_supplement.patch uploaded by Corey Farrell (license 5909) ........ Merged revisions 399531 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-19chan_sip: Make direct media reinvites for T38 put Asterisk in the media pathJonathan Rose
Prior to this patch, Asterisk would incorrectly use the previous endpoint addresses in SDP in spite of providing its own port. T38 is never meant to be done through directmedia and Asterisk should always be in the media path for these streams. (closes issue ASTERISK-17273) Reported by: Kevin Stewart (closes issue ASTERISK-18706) Reported by: Jeremy Kister Review: https://reviewboard.asterisk.org/r/2853/ ........ Merged revisions 399456 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399457 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 399458 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399459 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-16chan_iax2: Fix saving the wrong expiry time in astdb.Richard Mudgett
When a new IAX2 client registers, the astdb database is updated with the value of minregexpire defined in iax.conf instead of using the expiry time that is provided by the client. The provided expiry time of the client is updated after inserting the astdb entry. As a consequence, restarting or reloading asterisk creates clients whose registration may expire before they reregister. The clients are therefore unavailable after minregexpire seconds until they reregister. * Move updating of the expiry time to before inserting into the astdb. (closes issue ASTERISK-22504) Reported by: Stefan Wachtler Patches: chan_iax2.c.patch (license #6533) patch uploaded by Stefan Wachtler ........ Merged revisions 399158 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399159 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 399160 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-13Restore Dial, Queue, and FollowMe 'I' option support.Richard Mudgett
The Dial, Queue, and FollowMe applications need to inhibit the bridging initial connected line exchange in order to support the 'I' option. * Replaced the pass_reference flag on ast_bridge_join() with a flags parameter to pass other flags defined by enum ast_bridge_join_flags. * Replaced the independent flag on ast_bridge_impart() with a flags parameter to pass other flags defined by enum ast_bridge_impart_flags. * Since the Dial, Queue, and FollowMe applications are now the only callers of ast_bridge_call() and ast_bridge_call_with_flags(), changed the calling contract to require the initial COLP exchange to already have been done by the caller. * Made all callers of ast_bridge_impart() check the return value. It is important. As a precaution, I also made the compiler complain now if it is not checked. * Did some cleanup in parking_tests.c as a result of checking the ast_bridge_impart() return value. An independent, but associated change is: * Reduce stack usage in ast_indicate_data() and add a dropping redundant connected line verbose message. (closes issue ASTERISK-22072) Reported by: Joshua Colp Review: https://reviewboard.asterisk.org/r/2845/ ........ Merged revisions 399136 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-12chan_sip: Revert r398835 due to failing tests involving originateJonathan Rose
(issue ASTERISK-22424) Reported by: Jonathan Rose ........ Merged revisions 398977 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398986 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398991 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-11chan_sip: Reject calls without prior SDP on 200 OKJonathan Rose
If we receive a 200 OK without SDP, we will now check to see if the remote address has been established for that channel's RTP session and if the to tag for that channel has changed from the most recent to tag in a response less than 200. If either a change has been made since the last to-tag was received or the remote address is unset, then we will drop the call. (closes issue ASTERISK-22424) Reported by: Jonathan Rose Review: https://reviewboard.asterisk.org/r/2827/diff/#index_header ........ Merged revisions 398835 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398836 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398837 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-11pjsip: reinvite for connected line updates occurs when it should notKevin Harwell
Connected line updates are now only sent out if an actual update needs to occur. This happens under the following conditions: 1. The endpoint we are sending to is trusted. 2. Either a P-Asserted-Identity or Remote Party-ID header needs to be added/sent. 3. The connected id's number and name are valid. Also added an SDP when an update is sent out. (closes issue AST-1212) Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/2831/ ........ Merged revisions 398806 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-06Fix chan_h323 compilationKinsey Moore
This fixes the things in chan_h323 that were missed or ignored in the great channel opaquification and gets chan_h323 back into a compiling state. (closes issue ASTERISK-22365) Reported by: Dmitry Melekhov Patches: chan_h323.patch uploaded by Dmitry Melekhov ........ Merged revisions 398510 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398511 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-05chan_iax2: Reduce indentation in __attempt_transmit().Richard Mudgett
* Reduce indentation in __attempt_transmit(). * Don't update the static last error time variable every time in __schedule_action() and socket_read(). ........ Merged revisions 398456 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398457 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398458 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-05chan_iax2: Fix stray reference to worker thread idle_list.Richard Mudgett
* Fix stray reference to idle_list in cleanup_thread_list(). This may be the reason for the note in iax2_process_thread() about threads not being removed from the task lists. * Move cleanup_thread_list(&idle_list) to after the other lists are cleaned up. ........ Merged revisions 398416 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398417 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398418 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-05chan_iax2: Fix bridgecallno deadlock avoidance.Richard Mudgett
* Fix bridgecallno deadlock avoidance. When doing deadlock avoidance, you need to retest the status of values for each loop to see if you still need the lock for bridgecallno. * As a safety check, after acquiring the bridgecallno lock you should check if iaxs[bridgecallno] is NULL just like the current callno checks. * Move setting thread->iostate to IAX_IOSTATE_IDLE to after processing any deferred frames to ensure that the iostate is IDLE when it is placed back into the idle list. defer_full_frame() tries to ensure iax2_process_thread() wakes up to process the frame. ........ Merged revisions 398379 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398380 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398381 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-04chan_iax2: Add missing control frame names to debug frame decode output.Richard Mudgett
........ Merged revisions 398301 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398302 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398303 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-04chan_misdn: Fix misdn debug output printed with arbitrary verbose levels.Richard Mudgett
Fix the misdn debug output to remote consoles. chan_misdn uses ast_console_puts() which doesn't know about verbose levels. Better to use ast_verbose() instead. Without this patch the misdn debug messages are appended to the verbose level which ever was set by the message sent to the console before, i.e. any undefined level. (closes issue AST-1218) Reported by: Guenther Kelleter Patches: misdnlog.patch (license #6372) patch uploaded by Guenther Kelleter ........ Merged revisions 398235 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398236 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398237 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398238 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30Fix various memory leaksKevin Harwell
main/config.c - cleanup cache fie includes res/res_security_log.c - unregister logger level channesl/chan_sip.c - cleanup io context and notify_types main/translator.c - cleanup at shutdown main/named_acl.c - cleanup cli commands main/indications.c - ast_get_indication_tone() unref default_tone_zone if used (closes issues ASTERISK-22378) Reported by: Corey Farrell Patches: config_shutdown.patch uploaded by coreyfarrell (license 5909) res_security_log.patch uploaded by coreyfarrell (license 5909) chan_sip-11.patch uploaded by coreyfarrell (license 5909) indications_refleak.patch uploaded by coreyfarrell (license 5909) named_acl-cli_unreg-trunk.patch uploaded by coreyfarrell (license 5909) translate_shutdown.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 398102 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398103 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 398116 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30optional_api: Fix linking problems between modules that export global symbolsDavid M. Lee
With the new work in Asterisk 12, there are some uses of the optional_api that are prone to failure. The details are rather involved, and captured on [the wiki][1]. This patch addresses the issue by removing almost all of the magic from the optional API implementation. Instead of relying on weak symbol resolution, a new optional_api.c module was added to Asterisk core. For modules providing an optional API, the pointer to the implementation function is registered with the core. For modules that use an optional API, a pointer to a stub function, along with a optional_ref function pointer are registered with the core. The optional_ref function pointers is set to the implementation function when it's provided, or the stub function when it's now. Since the implementation no longer relies on magic, it is now supported on all platforms. In the spirit of choice, an OPTIONAL_API flag was added, so we can disable the optional_api if needed (maybe it's buggy on some bizarre platform I haven't tested on) The AST_OPTIONAL_API*() macros themselves remained unchanged, so existing code could remain unchanged. But to help with debugging the optional_api, the patch limits the #include of optional API's to just the modules using the API. This also reduces resource waste maintaining optional_ref pointers that aren't used. Other changes made as a part of this patch: * The stubs for http_websocket that wrap system calls set errno to ENOSYS. * res_http_websocket now properly increments module use count. * In loader.c, the while() wrappers around dlclose() were removed. The while(!dlclose()) is actually an anti-pattern, which can lead to infinite loops if the module you're attempting to unload exports a symbol that was directly linked to. * The special handling of nonoptreq on systems without weak symbol support was removed, since we no longer rely on weak symbols for optional_api. [1]: https://wiki.asterisk.org/wiki/x/wACUAQ (closes issue ASTERISK-22296) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2797/ ........ Merged revisions 397989 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-29Verbose logging discrepanciesKevin Harwell
Refactored cases where a combination of ast_verbose/options_verbose were present. Also in general tried to eliminate, in as many places as possible, where the options_verbose global variable was being used. Refactored the way local and remote consoles handle verbose message logging in an attempt to solve the various discrepancies that sometimes would show between the two. (closes issue AST-1193) Reported by: Guenther Kelleter Review: https://reviewboard.asterisk.org/r/2798/ ........ Merged revisions 397948 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 397958 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-27AST-2013-005: Fix crash caused by invalid SDPMatthew Jordan
If the SIP channel driver processes an invalid SDP that defines media descriptions before connection information, it may attempt to reference the socket address information even though that information has not yet been set. This will cause a crash. This patch adds checks when handling the various media descriptions that ensures the media descriptions are handled only if we have connection information suitable for that media. Thanks to Walter Doekes, OSSO B.V., for reporting, testing, and providing the solution to this problem. (closes issue ASTERISK-22007) Reported by: wdoekes Tested by: wdoekes patches: issueA22007_sdp_without_c_death.patch uploaded by wdoekes (License 5674) ........ Merged revisions 397756 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397757 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 397758 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 397759 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-27AST-2013-004: Fix crash when handling ACK on dialog that has no channelMatthew Jordan
A remote exploitable crash vulnerability exists in the SIP channel driver if an ACK with SDP is received after the channel has been terminated. The handling code incorrectly assumed that the channel would always be present. This patch adds a check such that the SDP will only be parsed and applied if Asterisk has a channel present that is associated with the dialog. Note that the patch being applied was modified only slightly from the patch provided by Walter Doekes of OSSO B.V. (closes issue ASTERISK-21064) Reported by: Colin Cuthbertson Tested by: wdoekes, Colin Cutherbertson patches: issueA21064_fix.patch uploaded by wdoekes (License 5674) ........ Merged revisions 397710 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397711 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 397712 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 397713 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397753 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-27Fix uninitialized value in struct ast_control_pvt_cause_code usage.Richard Mudgett
........ Merged revisions 397744 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 397745 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-26chan_dahdi: Add some missing build cleanup.Richard Mudgett
........ Merged revisions 397643 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23Fix memory corruption when trying to get "core show locks".Richard Mudgett
Review https://reviewboard.asterisk.org/r/2580/ tried to fix the mismatch in memory pools but had a math error determining the buffer size and didn't address other similar memory pool mismatches. * Effectively reverted the previous patch to go in the same direction as trunk for the returned memory pool of ast_bt_get_symbols(). * Fixed memory leak in ast_bt_get_symbols() when BETTER_BACKTRACES is defined. * Fixed some formatting in ast_bt_get_symbols(). * Fixed sig_pri.c freeing memory allocated by libpri when MALLOC_DEBUG is enabled. * Fixed __dump_backtrace() freeing memory from ast_bt_get_symbols() when MALLOC_DEBUG is enabled. * Moved __dump_backtrace() because of compile issues with the utils directory. (closes issue ASTERISK-22221) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2778/ ........ Merged revisions 397525 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397528 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23Add pass through support for Opus and VP8; Opus format attribute negotiationMatthew Jordan
This patch adds pass through support for Opus and VP8. That includes: * Format attribute negotiation for Opus. Note that unlike some other codecs, the draft RFC specifies having spaces delimiting the attributes in addition to ';', so you have "attra=X; attrb=Y". This broke the attribute parsing in chan_sip, so a small tweak was also included in this patch for that. * A format attribute negotiation module for Opus, res_format_attr_opus * Fast picture update for VP8. Since VP8 uses a different RTCP packet number than FIR, this really is specific to VP8 at this time. Note that the format attribute negotiation in res_pjsip_sdp_rtp was written by mjordan. The rest of this patch was written completely by Lorenzo Miniero. Review: https://reviewboard.asterisk.org/r/2723/ (closes issue ASTERISK-21981) Reported by: Tzafrir Cohen patches: asterisk_opus+vp8_passthrough_20130718.patch uploaded by lminiero (License 6518) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23Fix crash when answering after a transport error occurs.Joshua Colp
If a response to an initial incoming INVITE results in a transport error the INVITE transaction is removed from the INVITE session. Any attempts to answer the INVITE session after this results in a crash as it requires the INVITE transaction to exist. This change explicitly locks the dialog and checks to ensure that the INVITE transaction exists before answering. (closes issue AST-1203) Reported by: John Bigelow git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-21Prevent a crash on outbound SIP MESSAGE requests.Mark Michelson
If a From header on an outbound out-of-call SIP MESSAGE were malformed, the result could crash Asterisk. In addition, if a From header on an incoming out-of-call SIP MESSAGE request were malformed, the message was happily accepted rather than being rejected up front. The incoming message path would not result in a crash, but the behavior was bad nonetheless. (closes issue ASTERISK-22185) reported by Zhang Lei ........ Merged revisions 397254 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-21Allow the SIP_CODEC family of variables to specify more than one codecMatthew Jordan
The SIP_CODEC family of variables let you set the preferred codec to be offered on an outbound INVITE request. However, for video calls, you need to be able to set both the audio and video codecs to be offered. This patch lets the SIP_CODEC variables accept a comma delineated list of codecs. The first codec in the list is set as the preferred codec; additional codecs are still offered however. This lets a dialplan writer set both audio and video codecs, e.g., Set(SIP_CODEC=ulaw,h264) Note that this feature was written by both Dennis Guse and Frank Haase Review: https://reviewboard.asterisk.org/r/2728 (closes issue ASTERISK-21976) Reported by: Denis Guse Tested by: mjordan, sysreq patches: patch-channels-chan__sip.c-393919 uploaded by dennis.guse (license 6513) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397243 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-21Fix Not Storing Current Incoming Recv AddressMichael L. Young
In 1.8, r384779 introduced a regression by retrieving an old dialog and keeping the old recv address since recv was already set. This has caused a problem when a proxy is involved since responses to incoming requests from the proxy server, after an outbound call is established, are never sent to the correct recv address. In 11, r382322 introduced this regression. The fix is to revert that change and always store the recv address on incoming requests. Thank you Walter Doekes for helping to point out this error and Mark Michelson for your input/review of the fix. (closes issue ASTERISK-22071) Reported by: Alex Zarubin Tested by: Alex Zarubin, Karsten Wemheuer Patches: asterisk-22071-store-recvd-address.diff by Michael L. Young (license 5026) ........ Merged revisions 397204 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397205 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-20Remove REF_DEBUG definition.Mark Michelson
........ Merged revisions 397156 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397157 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-20Fix refcounting of sip_pvt in test_sip_rtpqos test and unlink it from the ↵Mark Michelson
list of pvts. (closes issue ASTERISK-22248) reported by Corey Farrell patches: test_sip_rtpqos.patch uploaded by Corey Farrell (license #5909) ........ Merged revisions 397112 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397133 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-19Whitespace cleanupMatthew Jordan
Remove some extraneous blobs git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-18Update chan_mgcp to the modified parking APIKinsey Moore
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-17Allow res_parking to be unloadableKinsey Moore
This change protects accesses of res_parking such that it can unload safely once transient uses of its registered functions are complete. The parking API has been restructured such that its consumers do not have access to the vtable exposed by the parking provider, but instead route through stubs to prevent consumers from holding on to function pointers. This adds calls to all the parking unload functions and moves application loading and unloading into functions in parking_applications.c similar to the rest of the parts of res_parking. Review: https://reviewboard.asterisk.org/r/2763/ (closes issue ASTERISK-22142) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-17Strip down the old event systemKinsey Moore
This removes unused code, event types, IE pltypes, and event IE types where possible and makes several functions private that were once public. This includes a renumbering of the remaining event and IE types which breaks binary compatibility with previous versions. The last remaining consumers of the old event system (or parts thereof) are main/security_events.c, res/res_security_log.c, tests/test_cel.c, tests/test_event.c, main/cel.c, and the CEL backends. Review: https://reviewboard.asterisk.org/r/2703/ (closes issue ASTERISK-22139) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-16Doxygen comment tweaks.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-15Remove some dead code dealing with: AST_BRIDGE_REC_CHANNEL_0, ↵Richard Mudgett
AST_BRIDGE_REC_CHANNEL_1, and AST_BRIDGE_IGNORE_SIGS. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-15Fix deadlocks in chan_sip in REFER and BYE handlingKinsey Moore
This resolves several deadlocks in chan_sip relating to usage of ast_channel_bridge_peer and improves accessibility of lock debugging function calls. Review: https://reviewboard.asterisk.org/r/2756/ (closes issue ASTERISK-22215) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396723 65c4cc65-6c06-0410-ace0-fbb531ad65f3