summaryrefslogtreecommitdiff
path: root/channels
AgeCommit message (Collapse)Author
2012-05-17logger: Adds additional support for call id logging and chan_sip specific stuffJonathan Rose
This patch improves the handling of call id logging significantly with regard to transfers and adding APIs to better handle specific aspects of logging. Also, changes have been made to chan_sip in order to better handle the creation of callids and to enable the monitor thread to bind itself to a particular call id when a dialog is determined to be related to a callid. It then unbinds itself before returning to normal monitoring. review: https://reviewboard.asterisk.org/r/1886/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-17Fix checking bounds of array index after using it; improper sizeofMatthew Jordan
This patch fixes two problems pointed out by a static analysis tool. * In chan_dahdi, when an event is handled the index of the sub channel is first obtained. In very off nominal cases, the method that determines the index can return a negative value. In the event handling code, whether or not the index returned is valid was being checked after that value was used to index into an array. This patch makes it so the value is checked before any indexing is done. * In res_calendar_ews, sizeof was being passed a pointer instead of the struct to determine the amount of memory to allocate. (issue ASTERISK-19651) Reported by: Matt Jordan (closes issue ASTERISK-19671) Reported by: Matt Jordan ........ Merged revisions 366740 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366741 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-15Correct misuse of ast_strip_quoted() when getting a Diversion header's ↵Mark Michelson
reason parameter. The use here was assuming that the pointer would be updated, but the updated string is actually returned by ast_strip_quoted() instead. ........ Merged revisions 366597 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366598 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-15The predial routine must be run on the local;1 channel.Richard Mudgett
When ast_call() operates on a local channel, it copies a lot of things from the local;1 channel to the local;2 channel. This includes among other things, channel variables and party id information. Other reasons it was a bad idea to run predial on the local;2 channel: 1) The channel has not been completely setup. The ast_call() completes the setup. 2) The local;2 caller and connected line party information is opposite to any other channels predial runs on. (And it hasn't been setup yet.) * Partially back out -r366183 by removing the chan_local implementation of the struct ast_channel_tech.pre_call callback. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-14Make chan_local use the API call instead of inlining its own version.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-14Commit framework for HANGUPCAUSE (replacement for SIP_CAUSE)Kinsey Moore
This is the starting point for the Asterisk 11: Who Hung Up work and provides a framework which will allow channel drivers to report the types of hangup cause information available in SIP_CAUSE without incurring the overhead of the MASTER_CHANNEL dialplan function. The initial implementation only includes cause generation for chan_sip and does not include cause code translation utilities. This change deprecates SIP_CAUSE and replaces its method of reporting cause codes with the new framework. This change also deprecates the 'storesipcause' option in sip.conf. Review: https://reviewboard.asterisk.org/r/1822/ (Closes issue SWP-4221) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-14Fix broken reinvite glare scenario.Mark Michelson
To make a long story short, reinvite glares were broken because Asterisk would invert the To and From headers when ACKing a 491 response. The reason was because the initreq of the dialog was being changed to the incoming glared reinvite instead of being set to the outgoing glared reinvite. This change has three parts * In handle_incoming, we never will reject an ACK because it has a to-tag present, even if we think the request may be out of dialog. * In handle_request_invite, we do not change the initreq when receiving a reinvite to which we will respond with a 491. * In handle_request_invite, several superflous settings up pendinginvite have been removed since this is dones automatically by transmit_response_reliable Review: https://reviewboard.asterisk.org/r/1911 ........ Merged revisions 366389 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366390 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10Run predial routine on local;2 channel where you would expect.Richard Mudgett
Before this patch, the predial routine executes on the ;1 channel of a local channel pair. Executing predial on the ;1 channel of a local channel pair is of limited utility. Any channel variables set by the predial routine executing on the ;1 channel will not be available when the local channel executes dialplan on the ;2 channel. * Create ast_pre_call() and an associated pre_call() technology callback to handle running the predial routine. If a channel technology does not provide the callback, the predial routine is simply run on the channel. Review: https://reviewboard.asterisk.org/r/1903/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10Resolve FORWARD_NULL static analysis warningsKinsey Moore
This resolves core findings from ASTERISK-19650 numbers 0-2, 6, 7, 9-11, 14-20, 22-24, 28, 30-32, 34-36, 42-56, 82-84, 87, 89-90, 93-102, 104, 105, 109-111, and 115. Finding numbers 26, 33, and 29 were already resolved. Those skipped were either extended/deprecated or in areas of code that shouldn't be disturbed. (Closes issue ASTERISK-19650) ........ Merged revisions 366167 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366168 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10Coverity Report: Fix issues for error type CHECKED_RETURN for coreJonathan Rose
(issue ASTERISK-19658) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1905/ ........ Merged revisions 366094 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366106 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10Close the proper tcptls_session when session creation fails.Mark Michelson
(issue AST-998) Reported by: Thomas Arimont Tested by: Thomas Arimont ........ Merged revisions 366052 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366053 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366062 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-09Prevent sip_pvt refleak when an ast_channel outlasts its corresponding sip_pvt.Mark Michelson
chan_sip was coded under the assumption that a SIP dialog with an owner channel will always be destroyed after the owner channel has been hung up. However, there are situations where the SIP dialog can time out and auto destruct before the corresponding channel has hung up. A typical example of this would be if the 'h' extension in the dialplan takes a long time to complete. In such cases, __sip_autodestruct() would complain about the dialog being auto destroyed with an owner channel still in place. The problem is that even once the owner channel was hung up, the sip_pvt would still be linked in its ao2_container because nothing would ever unlink it. The fix for this is that if __sip_autodestruct() is called for a sip_pvt that still has an owner channel in place, the destruction is rescheduled for 10 seconds in the future. This will continue until the owner channel is finally hung up. (closes issue ASTERISK-19425) reported by David Cunningham Patches: ASTERISK-19425.patch uploaded by Mark Michelson (License #5049) (closes issue ASTERISK-19455) reported by Dean Vesvuio Tested by Dean Vesvuio ........ Merged revisions 365896 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 365898 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-08Send more accurate identification information in dialog-info SIP NOTIFYs.Mark Michelson
This uses the calling channel's caller ID and connected line information to populate the remote and local identities in the dialog-info NOTIFY when an extension is ringing. There is a bit of an oddity here, and that is that we seed the remote target with the To header of the outbound call rather than the from header. This is because it was reported that seeding with the from header caused hints to be broken with certain SNOM devices. A comment has been added to the code to explain this. (closes issue ASTERISK-16735) reported by Maciej Krajewski patches: local_remote_hint2.diff uploaded by Mark Michelson (license #5049) 16735_tweak1.diff uploaded by Mark Michelson (license #5049) Tested by Niccolo Belli ........ Merged revisions 365574 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 365575 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-04Fix many issues from the NULL_RETURNS Coverity reportKinsey Moore
Most of the changes here are trivial NULL checks. There are a couple optimizations to remove the need to check for NULL and outboundproxy parsing in chan_sip.c was rewritten to avoid use of strtok. Additionally, a bug was found and fixed with the parsing of outboundproxy when "outboundproxy=," was set. (Closes issue ASTERISK-19654) ........ Merged revisions 365398 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 365399 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-04Fix local channel chains optimizing themselves out of a call.Richard Mudgett
* Made chan_local.c:check_bridge() check the return value of ast_channel_masquerade(). In long chains of local channels, the masquerade occasionally fails to get setup because there is another masquerade already setup on an adjacent local channel in the chain. * Made the outgoing local channel (the ;2 channel) flush one voice or video frame per optimization attempt. * Made sure that the outgoing local channel also does not have any frames in its queue before the masquerade. * Made do the masquerade immediately to minimize the chance that the outgoing channel queue does not get any new frames added and thus unconditionally flushed. * Made block indication -1 (Stop tones) event when the local channel is going to optimize itself out. When the call is answered, a chain of local channels pass down a -1 indication for each bridge. This blizzard of -1 events really slows down the optimization process. (closes issue ASTERISK-16711) Reported by: Alec Davis Tested by: rmudgett, Alec Davis Review: https://reviewboard.asterisk.org/r/1894/ ........ Merged revisions 365313 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 365320 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-02Multiple revisions 365006,365068Terry Wilson
........ r365006 | twilson | 2012-05-02 10:49:03 -0500 (Wed, 02 May 2012) | 12 lines Fix a CEL LINKEDID_END race and local channel linkedids This patch has the ;2 channel inherit the linkedid of the ;1 channel and fixes the race condition by no longer scanning the channel list for "other" channels with the same linkedid. Instead, cel.c has an ao2 container of linkedid strings and uses the refcount of the string as a counter of how many channels with the linkedid exist. Not only does this eliminate the race condition, but it also allows us to look up the linkedid by the hashed key instead of traversing the entire channel list. Review: https://reviewboard.asterisk.org/r/1895/ ........ r365068 | twilson | 2012-05-02 12:02:39 -0500 (Wed, 02 May 2012) | 11 lines Don't leak a ref if out of memory and can't link the linkedid If the ao2_link fails, we are most likely out of memory and bad things are going to happen. Before those bad things happen, make sure to clean up the linkedid references. This patch also adds a comment explaining why linkedid can't be passed to both local channel allocations and combines two ao2_ref calls into 1. Review: https://reviewboard.asterisk.org/r/1895/ ........ Merged revisions 365006,365068 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 365083 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-02Save the address on which a MESSAGE was received, so it can be used in MESSAGE()Jason Parker
This is useful in cases where chan_sip may be listening on multiple addresses. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-01Remove a function that has been marked unused since Asterisk 1.6.0.Mark Michelson
The reason I'm removing this is that Coverity reported a STRAY_SEMICOLON issue here. Since the function has been unused for so long, I just elected to remove it altogether. (closes issue ASTERISK-19660) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-01* Fix error path resouce leak in local_request().Richard Mudgett
* Restructure local_request() to reduce indentation. ........ Merged revisions 364840 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 364845 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-30Revert revision 360862.Mark Michelson
Revision 360862 was intended to improve identities sent in dialog-info NOTIFY requests. Some users reported that hint became broken once this was done. It's not clear exactly what part of the patch has caused this regression, but broken hints are bad. For now, this revision is being reverted so that the next releases of Asterisk do not have bad behavior in them. The original reported issue will have to be fixed differently in the next version of Asterisk. (issue ASTERISK-16735) ........ Merged revisions 364706 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 364707 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364708 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-28Add support for lightweight NAT keepalive.Joshua Colp
If enabled using the keepalive option in sip.conf a small packet will be sent at a regular interval to keep the NAT mapping open. This is lightweight as the remote side does not need to parse and handle a SIP message. (closes issue AST-783) Review: https://reviewboard.asterisk.org/r/1756/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-27Don't attempt to make use of the dynamic_exclude_static ACL if DNS lookup fails.Mark Michelson
(closes issue ASTERISK-18321) Reported by Dan Lukes Patches: ASTERISK-18321.patch by Mark Michelson (license #5049) ........ Merged revisions 364341 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 364342 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364343 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-27Allow SIP pvts involved in Replaces transfers to fall out of reference soonerKinsey Moore
Unref the SIP pvt stored in the refer structure as soon as it is no longer needed so that the pvt and associated file descriptors can be freed sooner. This change makes a reference decrement unnecessary in code that handles SIP BYE/Also transfers which should not touch the reference anyway. (Closes issue ASTERISK-19579) Reported by: Maciej Krajewski Tested by: Maciej Krajewski ........ Merged revisions 364258 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 364259 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-27Allow for reloading SRTP crypto keys within the same SIP dialogMatthew Jordan
As a continuation of the patch in r356604, which allowed for the reloading of SRTP keys in re-INVITE transfer scenarios, this patch addresses the more common case where a new key is requested within the context of a current SIP dialog. This can occur, for example, when certain phones request a SIP hold. Previously, once a dialog was associated with an SRTP object, any subsequent attempt to process crypto keys in any SDP offer - either the current one or a new offer in a new SIP request - were ignored. This patch changes this behavior to only ignore subsequent crypto keys within the current SDP offer, but allows future SDP offers to change the keys. (issue ASTERISK-19253) Reported by: Thomas Arimont Tested by: Thomas Arimont Review: https://reviewboard.asteriskorg/r/1885/ ........ Merged revisions 364203 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 364204 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364205 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-26Fix reference leaks involving SIP Replaces transfersKinsey Moore
The reference held for SIP blind transfers using the Replaces header in an INVITE was never freed on success and also failed to be freed in some error conditions. This caused a file descriptor leak since the RTP structures in use at the time of the transfer were never freed. This reference leak and another relating to subscriptions in the same code path have now been corrected. (closes issue ASTERISK-19579) ........ Merged revisions 363986 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 363987 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-26chan_sip: [general] maxforwards, not checked for a value greater than 255Alec L Davis
The peer maxforwards is checked for both '< 1' and '> 255', but the default 'maxforwards' in the [general] section is only checked for '< 1' alecdavis (license 585) Reported by: alecdavis Tested by: alecdavis Review: https://reviewboard.asterisk.org/r/1888/ ........ Merged revisions 363934 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 363935 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-25Make DAHDISendCallreroutingFacility wait 5 seconds for a reply before ↵Richard Mudgett
disconnecting the call. Some switches may not handle the call-deflection/call-rerouting message if the call is disconnected too soon after being sent. Asteisk was not waiting for any reply before disconnecting the call. * Added a 5 second delay before disconnecting the call to wait for a potential response if the peer does not disconnect first. (closes issue ASTERISK-19708) Reported by: mehdi Shirazi Patches: jira_asterisk_19708_v1.8.patch (license #5621) patch uploaded by rmudgett Tested by: rmudgett ........ Merged revisions 363730 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 363734 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-25Clear ISDN channel resetting state if the peer continues to use it.Richard Mudgett
Some ISDN switches occasionally fail to send a RESTART ACKNOWLEDGE in response to a RESTART request. * Made the second SETUP received after sending a RESTART request clear the channel resetting state as if the peer had sent the expected RESTART ACKNOWLEDGE before continuing to process the SETUP. The peer may not be sending the expected RESTART ACKNOWLEDGE. (issue ASTERISK-19608) (issue AST-844) (issue AST-815) Patches: jira_ast_815_v1.8.patch (license #5621) patch uploaded by rmudgett (modified) ........ Merged revisions 363687 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 363688 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-23AST-2012-006: Fix crash in UPDATE handling when no channel owner existsMatthew Jordan
If Asterisk receives a SIP UPDATE request after a call has been terminated and the channel has been destroyed but before the SIP dialog has been destroyed, a condition exists where a connected line update would be attempted on a non-existing channel. This would cause Asterisk to crash. The patch resolves this by first ensuring that the SIP dialog has an owning channel before attempting a connected line update. If an UPDATE request is received and no channel is associated with the dialog, a 481 response is sent. (closes issue ASTERISK-19770) Reported by: Thomas Arimont Tested by: Matt Jordan Patches: ASTERISK-19278-2012-04-16.diff uploaded by Matt Jordan (license 6283) ........ Merged revisions 363106 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 363107 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-23AST-2012-005: Fix remotely exploitable heap overflow in keypad button handlingMatthew Jordan
When handling a keypad button message event, the received digit is placed into a fixed length buffer that acts as a queue. When a new message event is received, the length of that buffer is not checked before placing the new digit on the end of the queue. The situation exists where sufficient keypad button message events would occur that would cause the buffer to be overrun. This patch explicitly checks that there is sufficient room in the buffer before appending a new digit. (closes issue ASTERISK-19592) Reported by: Russell Bryant ........ Merged revisions 363100 from http://svn.asterisk.org/svn/asterisk/branches/1.6.2 ........ Merged revisions 363102 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 363103 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-20Use ast_channel_lock_both() where it was inlined before.Richard Mudgett
The CHANNEL_DEADLOCK_AVOIDANCE() feature of preserving where the channel lock was originally obtained is overkill where ast_channel_lock_both() was inlined. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-20Add original party id and reason support.Richard Mudgett
ISDN ETSI PTP and Q.SIG (And SS7 in future) have support for reporting who was the original redirecting party of a call. * Added support for the original redirecting party and reason to the REDIRECTING function and the system core as well as to the stubbed locations in sig_pri.c. Review: https://reviewboard.asterisk.org/r/1829/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-19Convert some strncpys to ast_copy_stringTerry Wilson
Review: https://reviewboard.asterisk.org/r/1732/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-19Fix a variety of potential buffer overflowsMatthew Jordan
* chan_mobile: Fixed an overrun where the cind_state buffer (an integer array of size 16) would be overrun due to improper bounds checking. At worst, the buffer can be overrun by a total of 48 bytes (assuming 4-byte integers), which would still leave it within the allocated memory of struct hfp. This would corrupt other elements in that struct but not necessarily cause any further issues. * app_sms: The array imsg is of size 250, while the array (ud) that the data is copied into is of size 160. If the size of the inbound message is greater then 160, up to 90 bytes could be overrun in ud. This would corrupt the user data header (array udh) adjacent to ud. * chan_unistim: A number of invalid memmoves are corrected. These would move data (which may or may not be valid) into the ends of these buffers. * asterisk: ast_console_toggle_loglevel does not check that the console log level being set is less then or equal to the allowed log levels of 32. * format_pref: In ast_codec_pref_prepend, if any occurrence of the specified codec is not found, the value used to index into the array pref->order would be one greater then the maximum size of the array. * jitterbuf: If the element being placed into the jitter buffer lands in the last available slot in the jitter history buffer, the insertion sort attempts to move the last entry in the buffer into one slot past the maximum length of the buffer. Note that this occurred for both the min and max jitter history buffers. * tdd: If a read from fsk_serial returns a character that is greater then 32, an attempt to read past one of the statically defined arrays containing the values that character maps to would occur. * localtime: struct ast_time and tm are not the same size - ast_time is larger, although it contains the elements of tm within it in the same layout. Hence, when using memcpy to copy the contents of tm into ast_time, the size of tm should be used, as opposed to the size of ast_time. * extconf: this treats ast_timing's minmask array as if it had a length of 48, when it has defined the size of the array as 24. pbx.h defines minmask as having a size of 48. (issue ASTERISK-19668) Reported by: Matt Jordan ........ Merged revisions 362485 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 362496 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-18Add ability to ignore layer 1 alarms for BRI PTMP lines.Richard Mudgett
Several telcos bring the BRI PTMP layer 1 down when the line is idle. When layer 1 goes down, Asterisk cannot make outgoing calls. Incoming calls could fail as well because the alarm processing is handled by a different code path than the Q.931 messages. * Add the layer1_presence configuration option to ignore layer 1 alarms when the telco brings layer 1 down. This option can be configured by span while the similar DAHDI driver teignorered=1 option is system wide. This option unlike layer2_persistence does not require libpri v1.4.13 or newer. Related to JIRA AST-598 JIRA ABE-2845 ........ Merged revisions 362428 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 362429 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-17Avoid cppcheck warnings; removing unused vars and a bit of cleanup.Walter Doekes
Patch by: junky Review: https://reviewboard.asterisk.org/r/1743/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-17Turn off warning message when bind address is set to any.Michael L. Young
When a bind address is set to an ANY address (udpbindport=::), a warning message is displayed stating that "Address remapping activated in sip.conf but we're using IPv6, which doesn't need it. Please remove 'localnet' and/or 'externaddr' settings." But if one is running dual stack, we shouldn't be told to turn those settings off. This patch checks if the bind address is an ANY address or not. The warning message will now only be displayed if the bind address is NOT an ANY address and IPv6 is being used. Also, updated the copyright year. (closes issue ASTERISK-19456) Reported by: Michael L. Young Tested by: Michael L. Young Patches: chan_sip_ipv6_message.diff uploaded by Michael L. Young (license 5026) ........ Merged revisions 362253 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 362264 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-16Fix negative return handling in channel driversMatthew Jordan
In chan_agent, while handling a channel indicate, the agent channel driver must obtain a lock on both the agent channel, as well as the channel the agent channel is using. To do so, it attempts to lock the other channel first, then unlock the agent channel which is locked prior to entry into the indicate handler. If this unlock fails with a negative return value, which can occur if the object passed to agent_indicate is an invalid ao2 object or is NULL, the return value is passed directly to strerror, which can only accept positive integer values. In chan_dahdi, the return value of dahdi_get_index is used to directly index into the sub-channel array. If dahd_get_index returns a negative value, it would use that value to index into the array, which could cause an invalid memory access. If dahdi_get_index returns a negative number, we now default to SUB_REAL. (issue ASTERISK-19655) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1863/ ........ Merged revisions 362204 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 362205 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-16Add IPv6 address support to security events framework.Michael L. Young
The current Security Events Framework API only supports IPv4 when it comes to generating security events. This patch does the following: * Changes the Security Events Framework API to support IPV6 and updates the components that use this API. * Eliminates an error message that was being generated since the current implementation was treating an IPv6 socket address as if it was IPv4. * Some copyright dates were updated on files touched by this patch. (closes issue ASTERISK-19447) Reported by: Michael L. Young Tested by: Michael L. Young Patches: security_events_ipv6v3.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/1777/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-12Make trunkfreq take effect when setKinsey Moore
Previously, setting trunkfreq had no effect on initial load or on reload and only ever used the default value. This causes trunkfreq to be used appropriately on initial load and reload. (closes issue ASTERISK-19521) Patch-by: Jaco Kroon ........ Merged revisions 361972 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 361981 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-10Prevent invalid access of free'd memory if DAHDI channel during an MWI eventRichard Mudgett
In the MWI processing loop, when a valid event occurs the temporary caller ID information is deallocated. If a new DAHDI channel is successfully created, the event is passed up to the analog_ss_thread without error and the loop exits. If, however, the DAHDI channel is not created, then the caller ID struct has been free'd, and the gains reset to their previous level. This will almost certainly cause an invalid access to the free'd memory, either in subsequent calls to callerid_free or calls to callerid_feed. * Rework the -r361705 patch to better manage the cs and mtd allocated resources. * Fixed use of mwimonitoractive flag to be correct if the mwi_thread() fails to start. ........ Merged revisions 361854 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 361855 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-09Prevent invalid access of free'd memory if DAHDI channel during an MWI eventMatthew Jordan
In the MWI processing loop, when a valid event occurs the temporary caller ID information is deallocated. If a new DAHDI channel is successfully created, the event is passed up to the analog_ss_thread without error and the loop exits. If, however, the DAHDI channel is not created, then the caller ID struct has been free'd, and the gains reset to their previous level. This will almost certainly cause an invalid access to the free'd memory, either in subsequent calls to callerid_free or calls to callerid_feed. This patch makes it so that we only free the caller ID structure if a DAHDI channel is successfully created, and we bump the gains back up if we fail to make a DAHDI channel. ........ Merged revisions 361705 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 361706 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06Add missing newlines to CLI loggingKinsey Moore
........ Merged revisions 361471 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 361472 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06Fix a typo in the warning messages for an ignored media streamMatthew Jordan
Added a '\n' to the warning messages when we ignore a media stream due to the port number being '0'. (closes issue ASTERISK-19646) Reported by: Badalian Vyacheslav ........ Merged revisions 361332 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 361333 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361334 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-04Replace GNU old-style field designator extensions to fix clang warningsJonathan Rose
(issue ASTERISK-19540) Reported by: Makoto Dei Patches: clang-gnu-designator.patch uploaded by Makoto Dei (license 5027) ........ Also add from the patch the portion in res_fax_spandsp that didn't apply to 1.8 Merged revisions 361142 from http://svn.asterisk.org/svn/asterisk/branches/1.8 (closes issue ASTERISK-19540) ........ Merged revisions 361143 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-02Stop sending out RTCP if RTP is inactiveKinsey Moore
This change prevents Asterisk from sending RTCP receiver reports during a remote bridge since it is no longer receiving media and should not be reporting anything. (related to ASTERISK-19366) ........ Merged revisions 360987 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 360993 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29Improve accuracy of identifying information sent in dialog-info SIP NOTIFY ↵Mark Michelson
requests. This change makes use of connected party information in addition to caller ID in order to populate local and remote XML elements in the dialog-info NOTIFYs. (closes issue ASTERISK-16735) Reported by: Maciej Krajewski Tested by: Maciej Krajewski Patches: local_remote_hint2.diff uploaded by Mark Michelson (license 5049) ........ Merged revisions 360862 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 360863 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-28Fix setting CDR variables in the hangup extensionTerry Wilson
A previous CDR fix for setting CDR variables during a bridge via custom dialplan features broke setting CDR variables in the hangup extension. This patch fixes the issue. Review: https://reviewboard.asterisk.org/r/1794/ ........ Merged revisions 358978 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 358989 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-27Make a debug message regarding subscription changes more accurate.Mark Michelson
I was getting confused during some testing why Asterisk was saying that a subscription was being added when it was clearly being removed. This fixes that confusion. ........ Merged revisions 360625 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 360672 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360673 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-24chan_iax2: Use OBJ_NODATA to be a bit more explicit.Russell Bryant
This is just a minor code cleanup change. These uses of ao2_callback() would never return anything since the callbacks always returned 0. However, be more explicit that no returned results are wanted by specifying OBJ_NODATA. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360369 65c4cc65-6c06-0410-ace0-fbb531ad65f3