summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
AgeCommit message (Collapse)Author
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-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-23Add missing initialization of update_redirecting in chan_sip.cRichard Mudgett
........ Merged revisions 360262 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 360263 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-21Ensure Asterisk sends a BYE when pending on the final response to a re-INVITEMatthew Jordan
When Asterisk detects a hangup and cannot send a BYE due to a pending INVITE, it sets the pendingbye flag and waits for the final response to that INVITE. When the response is received, it transmits the BYE. If, however, that INVITE request is a pending re-INVITE, it needs to first send a CANCEL request to terminate the pending re-INVITE. In that circumstance, Asterisk was, in some scenarios, clearing the pendingbye flag after processing the CANCEL request and not checking for a pending BYE when receiving the final 487 response to the INVITE. This patch ensures that if the pendingbye flag is set, it is honored regardless of the nature of the INVITE request currently in flight. (closes issue ASTERISK-19365) Reported by: Thomas Arimont Tested by: Thomas Arimont Patches: bugASTERISK-19365_2012_03_08.patch uploaded by mjordan (license 6283) Review: https://reviewboard.asterisk.org/r/1807 ........ Merged revisions 360086 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 360088 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-15Remove unused variable ‘srch’Paul Belanger
Missed on the previous commit git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-15Remove some dead code found in _sip_show_peers()Paul Belanger
Review: https://reviewboard.asterisk.org/r/1696/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359607 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13Make hints for invalid SIP devices return Unavail, not idleTerry Wilson
This patch drastically simplifies the device state aggegation code. The old method was not only overly complex, but also made it impossible to return AST_DEVICE_INVALID from the aggregation code. The unit test update is as a result of fixing that bug. The SIP change stems from a bug introduced by removing a DNS lookup for hostname-based SIP channels. (closes issue ASTERISK-16702) Review: https://reviewboard.asterisk.org/r/1808/ ........ Merged revisions 358943 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 358944 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13Finalize ast_channel opaquificationTerry Wilson
Review: https://reviewboard.asterisk.org/r/1786/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-08Make transfer not ignore port information with SIP.Jonathan Rose
Attempting to transfer with SIP to an address like 1XXXXX@ip.ad.re.ss:5061 would fail because port would be cut from the host string and ignored. This simply keeps chan_sip from cutting off the port number during these kinds of transfers. (closes issue ASTERISK-19321) Reported by: Federico Alves Review: https://reviewboard.asterisk.org/r/1790/diff/#index_header ........ Merged revisions 358643 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 358644 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358645 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-05Defer sending the connected line reinvite if a reinvite is already in progress.Joshua Colp
(issue ASTERISK-19355) Reported by: tomaso (closes issue AST-825) ........ Merged revisions 358162 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 358163 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-05Ensure Asterisk acknowledges ACKs to 4xx on Replaces errorsKinsey Moore
Asterisk was not setting pendinginvite in the upper half of handle_request_invite such that the 4xx was retransmitted repeatedly even though an ack was received for every retransmission. (closes issue ASTERISK-19303) Reported by: Jon Tsiros Patches: fix-19303.patch uploaded by Jeremiah Gowdy (license 6358) ........ Merged revisions 358115 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 358116 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-01Opaquify ast_channel typedefs, fd arrays, and softhangup flagTerry Wilson
Review: https://reviewboard.asterisk.org/r/1784/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29Opaquify ast_channel structs and listsTerry Wilson
Review: https://reviewboard.asterisk.org/r/1773/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28Convert struct ast_tcptls_session_instance to finally use the ao2 object lock.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28Changes transport option in sip.conf so that using multiple instances ↵Jonathan Rose
doesn't stack. Prior to this patch, Using "transport=" multiple times would cause them to add to one another like allow/deny. This patch changes that behavior to simply use the transport option specified last. Also, if no transport option is applied now, the default will automatically be UDP. (closes ASTERISK-19352) Reported by: jamicque Patches: asterisk-19352-transport-warning-message-v1.patch uploaded by Michael L. Young (license 5026) issueA19352_no_transport_is_udp.patch uploaded by Walter Doekes (license 5674) Review: https://reviewboard.asterisk.org/r/1745/diff/#index_header ........ Merged revisions 357266 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 357271 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27Adds an option to sip.conf that prevents diversion headers from being added.Jonathan Rose
send_diversion=no will prevent Diversion headers from being added to SIP requests. This doesn't prevent Diversion from being added with dialplan such as with SIPAddHeader. (closes issue ASTERISK-16862) Reported by: rsw686 Review: https://reviewboard.asterisk.org/r/1769/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24Fix worker thread resource leak in SIP TCP/TLS.Richard Mudgett
The SIP TCP/TLS worker threads were created joinable but noone could join them if they died on their own. * Fix the SIP TCP/TLS worker threads to not be created joinable. * _sip_tcp_helper_thread() only needs one parameter since the pvt parameter is only passed in as NULL and never used. (closes issue ASTERISK-19203) Reported by: Steve Davies Review: https://reviewboard.asterisk.org/r/1714/ ........ Merged revisions 356677 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 356690 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24Opaquification for ast_format structs in struct ast_channelTerry Wilson
Review: https://reviewboard.asterisk.org/r/1770/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-23Fix blind transfer parking issues if the dialed extension is not recognized ↵Richard Mudgett
as a parking extension. Custom parking extensions may not be coded such that the first and only extension priority is the Park application. These custom parking extensions will not be recognized as parking extensions. When a call is blind transferred to an extension that is not recognized as a parking extension, the normal blind transfer code causes the transferred channel to start executing dialplan. Calls that get parked in this manner do not know the original channel name that parked the call so the original parker could never be called back if the parked call is not retrieved before the timeout time. The parking space is also announced to the call being parked as a side effect of not knowing the original parking channel. * Fix handling of BLINDTRANSFER channel variable for call parking. * Fixed SIP blind transfer using the wrong dialplan context variable to check for the parking extension. (closes issue ASTERISK-19322) Reported by: aragon Tested by: rmudgett, jparker Review: https://reviewboard.asterisk.org/r/1730/ JIRA AST-766 ........ Merged revisions 356521 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 356522 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-23Fix ACK routing for non-2xx responses.Mark Michelson
When we send an ACK for a 2xx response to an INVITE, we are supposed to use the learned route set. However, when we receive a non-2xx final response to an INVITE, we are supposed to send the ACK to the same place we initially sent the INVITE. We had been doing this up until the changes went in that would build a route set from provisional responses. That introduced a regression where we would use the learned route set under all circumstances. With this change, we now will set the destination of our ACK based on the invitestate. If it is INV_COMPLETED then that means that we have received a non-2xx final response (INV_TERMINATED indicates a 2xx response was received). If it is INV_CANCELLED, then that means the call is being canceled, which means that we should be ACKing a 487 response. The other change introduced here is setting the invitestate to INV_CONFIRMED when we send an ACK *after* the reqprep instead of before. This way, we can tell in reqprep more easily what the invitestate is prior to sending the ACK. (closes issue ASTERISK-19389) reported by Karsten Wemheuer patches: ASTERISK-19389v2.patch uploaded by Mark Michelson (license #5049) (with some slight modifications prior to commit) ........ Merged revisions 356475 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 356476 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-22Merged revisions 356215 via svnmerge from Matthew Jordan
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r356215 | mjordan | 2012-02-22 08:53:53 -0600 (Wed, 22 Feb 2012) | 32 lines Merged revisions 356214 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r356214 | mjordan | 2012-02-22 08:50:20 -0600 (Wed, 22 Feb 2012) | 27 lines Fix potential buffer overrun and memory leak when executing "sip show peers" The "sip show peers" command uses a fix sized array to sort the current peers in the peers ao2_container. The size of the array is based on the current number of peers in the container. However, once the size of the array is determined, the number of peers in the container can change, as the peers container is not locked. This could cause a buffer overrun when populating the array, if peers were added to the container after the array was created. Additionally, a memory leak of the allocated array would occur if a user caused the _show_peers method to return CLI_SHOWUSAGE. We now create a snapshot of the current peers using an ao2_callback with the OBJ_MULTIPLE flag. This size of the array is set to the number of peers that the iterator will iterate over; hence, if peers are added or removed from the peers container it will not affect the execution of the "sip show peers" command. Review: https://reviewboard.asterisk.org/r/1738/ (closes issue ASTERISK-19231) (closes issue ASTERISK-19361) Reported by: Thomas Arimont, Jamuel Starkey Tested by: Thomas Arimont, Jamuel Starkey Patches: sip_show_peers_2012_02_16.diff uploaded by mjordan (license 6283) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20ast_channel opaquification of pointers and integral typesTerry Wilson
Review: https://reviewboard.asterisk.org/r/1753/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-17Fix regressions with regards to route-set creation on early dialogs.Mark Michelson
This fixes two main issues: 1. Asterisk would send a CANCEL to the route created by the provisional response instead of using the same destination it did in the initial INVITE. 2. If a new route set arrives in a 200 OK than was in the 1XX response (perfectly possible if our outbound INVITE gets forked), then the route set in the 200 OK needs to overwrite the route set in the 1XX response. (closes issue ASTERISK-19358) Reported by: Karsten Wemheuer Tested by: Karsten Wemheuer patches: ASTERISK-19358.patch uploaded by Mark Michelson (license 5049) ASTERISK-19358.patch uploaded by Stefan Schmidt (license 6034) Review: https://reviewboard.asterisk.org/r/1749 ........ Merged revisions 355732 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 355733 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14Properly invert the return of a strncmp call.Mark Michelson
This was causing identification that should have been made private to be public. (closes issue AST-814) reported by Patrick Anderson Patches: chan_sip.c.diff uploaded by Patrick Anderson (license 5430) ........ Merged revisions 355268 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 355271 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13Opaquify char * and char[] in ast_channelTerry Wilson
Review: https://reviewboard.asterisk.org/r/1733/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-09Fix parsing of SIP headers where compact and non-compact headers are mixedKinsey Moore
Change parsing of SIP headers so that compactness of the header no longer influences which header will be chosen. Previously, a non-compact header would be chosen instead of a preceeding compact-form header. (closes issue ASTERISK-17192) Review: https://reviewboard.asterisk.org/r/1728/ ........ Merged revisions 354702 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 354703 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354704 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-09Add auto_force_rport and auto_comedia NAT optionsTerry Wilson
This patch adds the auto_force_rport and auto_comedia NAT options. It also converts the nat= setting to a list of comma-separated combinable options: no, force_rport, comedia, auto_force_rport, and auto_comedia. nat=yes remains as an undocumented option equal to "force_rport,comedia". The first instance of 'yes' or 'no' in the list stops parsing and overrides any previously set options. If an auto_* option is specified with its non-auto_ counterpart, the auto setting takes precedence. This patch builds upon the patch posted to ASTERISK-17860 by JIRA user pedro-garcia. (closes issue ASTERISK-17860) Review: https://reviewboard.asterisk.org/r/1698/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-09Clean-up of minor formatting issues in r354542/3/4Matthew Jordan
rmudgett pointed out some formatting issues in the check-in for ASTERISK-19290. This cleans those up. Review: https://reviewboards.asterisk.org/r/1722/ ........ Merged revisions 354547 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 354548 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354549 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-09Fix SIP INFO DTMF handling for non-numeric codesMatthew Jordan
In ASTERISK-18924, SIP INFO DTMF handlingw as changed to account for both lowercase alphatbetic DTMF events, as well as uppercase alphabetic DTMF events. When this occurred, the comparison of the character buffer containing the event code was changed such that the buffer was first compared again '0' and '9' to determine if it was numeric. Unfortunately, since the first character in the buffer will typically be '1' in the case of non-numeric event codes (10-16), this caused those codes to be converted to a DTMF event of '1'. This patch fixes that, and cleans up handling of both application/dtmf-relay and application/dtmf content types. Review: https://reviewboard.asterisk.org/r/1722/ (closes issue ASTERISK-19290) Reported by: Ira Emus Tested by: mjordan ........ Merged revisions 354542 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 354543 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354544 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-08Add callbackextension matching & realtime callbackextensionsTerry Wilson
This patch is based on the one by David Vossel, developer extrodinaire, at https://reviewboard.asterisk.org/r/344/. If multiple peers are defined with the same host/port, but differing callbackextensions, it chooses the peer with the matching callbackextension. Since callbackextension creates an outbound registration with the callbackextension as the Contact address, matching an incoming request by that (in addition to the host/port) makes a lot of sense. This patch also adds support for callbackextension to realtime by querying all peers with callbackextensions on reload and adding registrations for them. (closes issue ASTERISK-13456) Review: https://reviewboard.asterisk.org/r/344/ Review: https://reviewboard.asterisk.org/r/1717/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-07Fix multiple SIP realtime issuesTerry Wilson
1. Set lastms to 0 when clearing instead of "" 2. Don't set ipaddr or port to the string "(null)" when they are empty 3. Add missing required fields, set default for lastms to 0, and modify the length of the ipaddr field to 45 in the Postgresql realtime.sql file. (closes issue ASTERISK-19172) Review: https://reviewboard.asterisk.org/r/1703/ ........ Merged revisions 354348 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 354349 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-02Ensure entering T.38 passthrough does not cause an infinite loopKinsey Moore
After R340970 Asterisk was still polling the RTCP file descriptor after RTCP is shut down and removed. If the descriptor happened to have data ready when the removal occured then Asterisk would go into an infinite loop trying to read data that it can never actually access. This change disables the audio RTCP file descriptor for the duration of the T.38 transaction. (closes issue ASTERISK-18951) Reported-by: Kristijan Vrban ........ Merged revisions 353915 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 353916 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-02Fix sip show peers port output, align columns, and fix ami port output.Jonathan Rose
A previous patch I committed from ASTERISK-16930 unexpectedly changed some output for the AMI action "sippeers" which this patch changes back. Also, this aligns the output for the cli command "sip show peers" and fixes another issue that patch introduced by using ast_sockaddr_stringify calls multiple times without immediately using the pointer. I also went ahead and did a little janitorial work to clean up whitespace in _sip_show_peers. (issue ASTERISK-16930) (closes issue ASTERISK-19281) Reported by: Patrick El Youssef Patches: ASTERISK-19281.diff uploaded by Walter Doekes (license 5674) ........ Merged revisions 353769 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 353771 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01Use ast_sockaddr_stringify_fmt wrappers for various functions in chan_sipJonathan Rose
There are a number of cleaner looking wrappers for ast_sockaddr_stringify_fmt available which are slightly more readable than using a direct call to ast_sockaddr_stringify_fmt. This patch switches a number of those calls in chan_sip to use those wrappers and is generally harmless. (Closes issue ASTERISK-16930) Reported by: Michael L. Young Patches: chan_sip-broken-registration-1.8.diff uploaded by Michael L. Young (license 5026) ........ Merged revisions 353720 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 353721 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353725 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01Constify some more channel driver technology callback parameters.Richard Mudgett
Review: https://reviewboard.asterisk.org/r/1707/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30Re-link peers by IP when dnsmgr changes the IPTerry Wilson
Asterisk's dnsmgr currently takes a pointer to an ast_sockaddr and updates it anytime an address resolves to something different. There are a couple of issues with this. First, the ast_sockaddr is usually the address of an ast_sockaddr inside a refcounted struct and we never bump the refcount of those structs when using dnsmgr. This makes it possible that a refresh could happen after the destructor for that object is called (despite ast_dnsmgr_release being called in that destructor). Second, the module using dnsmgr cannot be aware of an address changing without polling for it in the code. If an action needs to be taken on address update (like re-linking a SIP peer in the peers_by_ip table), then polling for this change negates many of the benefits of having dnsmgr in the first place. This patch adds a function to the dnsmgr API that calls an update callback instead of blindly updating the address itself. It also moves calls to ast_dnsmgr_release outside of the destructor functions and into cleanup functions that are called when we no longer need the objects and increments the refcount of the objects using dnsmgr since those objects are stored on the ast_dnsmgr_entry struct. A helper function for returning the proper default SIP port (non-tls vs tls) is also added and used. This patch also incorporates changes from a patch posted by Timo Teräs to ASTERISK-19106 for related dnsmgr issues. (closes issue ASTERISK-19106) Review: https://reviewboard.asterisk.org/r/1691/ ........ Merged revisions 353371 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 353397 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30Merged revisions 353369 via svnmerge from Alec L Davis
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r353369 | alecdavis | 2012-01-31 11:42:28 +1300 (Tue, 31 Jan 2012) | 9 lines Merged revisions 353368 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r353368 | alecdavis | 2012-01-31 11:40:40 +1300 (Tue, 31 Jan 2012) | 2 lines prevent debug messsges displaying -ve Cseq numbers. Missed in R353320 ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30Merged revisions 353321 via svnmerge from Alec L Davis
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r353321 | alecdavis | 2012-01-31 11:16:22 +1300 (Tue, 31 Jan 2012) | 25 lines Merged revisions 353320 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r353320 | alecdavis | 2012-01-31 10:57:49 +1300 (Tue, 31 Jan 2012) | 18 lines RFC3261 Section 8.1.1.5. The sequence number value MUST be expressible as a 32-bit unsigned integer * fix: use %u instead of %d when dealing with CSeq numbers - to remove possibility of -ve numbers. * fix: change all uses of seqno and friends (ocseq icseq) from 'int' or 'unsigned int' to uint32_t. Summary of CSeq numbers. An initial CSeq number must be less than 2^31 A CSeq number can increase in value up to 2^32-1 An incrementing CSeq number must not wrap around to 0. Tested with Asterisk 1.8.8.2 with Grandstream phones. alecdavis (license 585) Tested by: alecdavis Review: https://reviewboard.asterisk.org/r/1699/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30Clarify log WARNING message when port-zero SDP 'm' lines received.Kevin P. Fleming
Previously, if an m-line in an SDP offer or answer had a port number of zero, that line was skipped, and resulted in an 'Unsupported SDP media type...' warning message. This was misleading, as the media type was not unsupported, but was ignored because the m-line indicated that the media stream had been rejected (in an answer) or was not going to be used (in an offer). ........ Merged revisions 353260 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 353261 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-27Audit of ao2_iterator_init() usage for v1.8.Richard Mudgett
Fixes numerous reference leaks and missing ao2_iterator_destroy() calls as a result. Review: https://reviewboard.asterisk.org/r/1697/ ........ Merged revisions 352955 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 352956 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-27Merged revisions 352863 via svnmerge from Alec L Davis
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r352863 | alecdavis | 2012-01-27 13:08:03 +1300 (Fri, 27 Jan 2012) | 19 lines Merged revisions 352862 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r352862 | alecdavis | 2012-01-27 13:05:30 +1300 (Fri, 27 Jan 2012) | 12 lines rfc4235 - Section 4.1: Versions MUST be representable using a non-negative 32 bit integer. If a BLF subscription exists for long enough, using %d may print negative version numbers. Unlikely, as 2^32 at 1 update per second is ~137 years, or half that before the versions number started going negative. Tested with Asterisk 1.8.8.2 with Grandstream phones. alecdavis (license 585) Tested by: alecdavis Review: https://reviewboard.asterisk.org/r/1694/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-26Copy amaflags to sip_pvt from peer during create_addr_from_peerJonathan Rose
For whatever reason, we don't have a single function for copying data like this from SIP peers to the SIP pvt. This patch adds the copying of amaflags to the sip_pvt, but it would probably be worth discussing this function along with the others that essentially just copy some amount of data from a peer to a private. (Closes issue ASTERISK-19029) Reported by: Matt Lehner ........ Merged revisions 352755 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 352756 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-26Merged revisions 352705 via svnmerge from Alec L Davis
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r352705 | alecdavis | 2012-01-26 19:33:11 +1300 (Thu, 26 Jan 2012) | 27 lines Merged revisions 352704 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r352704 | alecdavis | 2012-01-26 19:27:07 +1300 (Thu, 26 Jan 2012) | 20 lines Cleanup dialog-info+xml Notify dialog Make similar to other Notify messages. sample output: <?xml version="1.0"?> <dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="715" state="full" entity="sip:8523@192.168.x.xx"> <dialog id="8523"> <state>terminated</state> </dialog> </dialog-info> Tested with Asterisk 1.8.8.2 with Grandstream phones. alecdavis (license 585) Tested by: alecdavis Review: https://reviewboard.asterisk.org/r/1693/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-25Remove some extraneous debugging from registry memleak fixTerry Wilson
........ Merged revisions 352551 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 352556 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-25Fixes for sending SIP MESSAGE outside of calls.Richard Mudgett
* Fix authenticate MESSAGE losing custom headers added by the MESSAGE_DATA function in the authorization attempt. * Pass up better From header contents for SIP to use. Now is in the "display-name" <URI> format expected by MessageSend. (Note that this is a behavior change that could concievably affect some people.) * Block user from adding standard headers that are added automatically. (To, From,...) * Allow the user to override the Content-Type header contents sent by MessageSend. * Decrement Max-Forwards header if the user transferred it from an incoming message. * Expand SIP short header names so the dialplan and other code only has to deal with the full names. * Documents what SIP expects in the MessageSend(from) parameter. (closes issue ASTERISK-18992) Reported by: Yuri (closes issue ASTERISK-18917) Reported by: Shaun Clark Review: https://reviewboard.asterisk.org/r/1683/ ........ Merged revisions 352520 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-25Clean up some SIP registry-related memory leaksTerry Wilson
1) Be sure and free at unload the epa_backend we allocate at startup 2) Do the same sip_registry cleanup at unload we do at reload Review: https://reviewboard.asterisk.org/r/1689/ ........ Merged revisions 352514 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 352515 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24Don't do a DNS lookup on an outbound REGISTER host if there is an outbound ↵Mark Michelson
proxy configured. (closes issue ASTERISK-16550) reported by: Olle Johansson ........ Merged revisions 352424 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 352430 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24Opaquify channel stringfieldsTerry Wilson
Continue channel opaque-ification by wrapping all of the stringfields. Eventually, we will restrict what can actually set these variables, but the purpose for now is to hide the implementation and keep people from adding code that directly accesses the channel structure. Semantic changes will follow afterward. Review: https://reviewboard.asterisk.org/r/1661/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-23Fix sip_cfg.notifycid to be set with the defined enum values.Richard Mudgett
The invalid value used when notifycid was enabled was benign. As far as the code was concerned -1 and 1 are equivalent. (closes issue ASTERISK-19232) Reported by: Eike Kuiper ........ Merged revisions 352090 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 352091 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352092 65c4cc65-6c06-0410-ace0-fbb531ad65f3