summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
AgeCommit message (Collapse)Author
2009-06-26Ensure the TCP read buffer is fully initialized before handling each packet.Russell Bryant
(closes issue #14452) Reported by: umberto71 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26Fix the 'nat' option to actually do RFC3581 as expected and extend the ↵Joshua Colp
configurable values for finer control. (closes issue #8855) Reported by: mikma Tested by: klaus3000, file git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26Improve T.38 negotiation by exchanging session parameters between ↵Joshua Colp
application and channel. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26Merge the new Channel Event Logging (CEL) subsystem.Russell Bryant
CEL is the new system for logging channel events. This was inspired after facing many problems trying to represent what is possible to happen to a call in Asterisk using CDR records. For more information on CEL, see the built in HTML or PDF documentation generated from the files in doc/tex/. Many thanks to Steve Murphy (murf) and Brian Degenhardt (bmd) for their hard work developing this code. Also, thanks to Matt Nicholson (mnicholson) and Sean Bright (seanbright) for their assistance in the final push to get this code ready for Asterisk trunk. Review: https://reviewboard.asterisk.org/r/239/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25Merged revisions 203115 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r203115 | russell | 2009-06-25 11:02:16 -0500 (Thu, 25 Jun 2009) | 11 lines Resolve a crash related to a T.38 reinvite race condition. This change resolves a crash observed locally during some T.38 testing. A call was set up using a call file, and when the T.38 reinvite came in, the channel state was still AST_STATE_DOWN. The reason is explained by a comment in the code that previously lived in the handling of AST_STATE_RINGING. This change modifies the logic to handle the same race condition for any channel state that is not UP. (closes ABE-1895) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-24Merged revisions 202966 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r202966 | mmichelson | 2009-06-24 13:28:47 -0500 (Wed, 24 Jun 2009) | 3 lines Use the handy UNLINK macro instead of hand-coding the same thing in-line. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202967 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-24Ensure the default settings are applied for T.38 when we set it up for a peer.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-23Merged revisions 202671 via svnmerge from David Vossel
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r202671 | dvossel | 2009-06-23 11:28:46 -0500 (Tue, 23 Jun 2009) | 12 lines MWI NOTIFY contains a wrong URI if Asterisk listens to non-standard port and transport (closes issue #14659) Reported by: klaus3000 Patches: patch_chan_sip_fixMWIuri_1.4.txt uploaded by klaus3000 (license 65) mwi_port-transport_trunk.diff uploaded by dvossel (license 671) Tested by: dvossel, klaus3000 Review: https://reviewboard.asterisk.org/r/288/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-22Merged revisions 202414 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r202414 | russell | 2009-06-22 11:00:00 -0500 (Mon, 22 Jun 2009) | 2 lines Make Polycom subscription type override check more explicit. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-22Merged revisions 202341-202342 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r202341 | mmichelson | 2009-06-22 09:42:55 -0500 (Mon, 22 Jun 2009) | 26 lines Fix a situation in which Asterisk would not stop retransmitting 487s. If a CANCEL were received by Asterisk, we would send a 487 in response to the original INVITE and a 200 OK for the CANCEL. If there were a network hiccup which caused the 200 OK and the 487 to be lost, then the UA communicating with Asterisk may try to retransmit its CANCEL. Asterisk's response to this used to be to try sending another 487 to the canceled INVITE and another 200 OK to the CANCEL. The problem here is that the originally-sent 487 was sent "reliably" meaning that it will be retransmitted until it is received properly. So when we receive the second CANCEL it is likely that the first batch of 487s we sent is still going strong and reaches the UA. The result was that the second set of 487s would be retransmitted constantly until the maximum number of retries had been reached. The fix for this is that if we receive a second CANCEL for an INVITE, then we cancel the retransmission of the first set of 487s and start a second set. This causes the dialog to be terminated reasonably. (closes issue #14584) Reported by: klaus3000 Patches: 14584_v2.patch uploaded by mmichelson (license 60) Tested by: klaus3000 ........ r202342 | mmichelson | 2009-06-22 09:44:58 -0500 (Mon, 22 Jun 2009) | 3 lines Remove an extra debug line left from previous commit. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202343 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-22Merged revisions 202336 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r202336 | mmichelson | 2009-06-22 09:34:05 -0500 (Mon, 22 Jun 2009) | 25 lines Fix a possible infinite loop in SDP parsing during glare situation. There was a while loop in get_ip_and_port_from_sdp which was controlled by a call to get_sdp_iterate. The loop would exit either if what we were searching for was found or if the return was NULL. The problem is that get_sdp_iterate never returns NULL. This means that if what we were searching for was not present, the loop would run infinitely. This modification of the loop fixes the problem. (closes issue #15213) Reported by: schmidts (closes issue #15349) Reported by: samy (closes issue #14464) Reported by: pj (closes issue #15345) Reported by: aragon Patches: sip_inf_loop.patch uploaded by mmichelson (license 60) Tested by: aragon ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-19Use sched_yield() instead of usleep(1)Matthew Nicholson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-19Add support for allowing an RTP engine to decide on whether it is possible ↵Joshua Colp
for specific formats to be transcoded for an RTP instance. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-18Added deadlock protection to try_suggested_sip_codec in chan_sip.c.Matthew Nicholson
Review: https://reviewboard.asterisk.org/r/285/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-18Trunk implementation of setting an alternate RTP source.Mark Michelson
This contains the interface by which we can let an rtp instance know that it might start receiving audio from a new source. This is similar in nature to revision 197588 of Asterisk 1.4. Review: https://reviewboard.asterisk.org/r/276 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-18parsing extension correctly from sip register linesDavid Vossel
If a transport type was specified, but no extension, parsing of the extension would return whatever was after the transport rather than defaulting to 's'. (closes issue #15111) Reported by: ffs Patches: chan_sip.c_register-parser.patch uploaded by ffs (license 730) Tested by: ffs, dvossel git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-17Fix problem with no audio due to ignoring the SDP.Mark Michelson
A recent change to our SDP version comparison made audio not function on some calls. This was because of a test wherein we were trying to see if an unsigned value was less than 0. This is a dumb comparison and arguably the compiler should have warned about it. Alas, though, it slipped past. Now it's fixed by changing the variable to be a signed type. Found by several developers. Tested by mnicholson and dbrooks. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-17Merged revisions 201380 via svnmerge from David Brooks
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r201380 | dbrooks | 2009-06-17 13:45:50 -0500 (Wed, 17 Jun 2009) | 9 lines Checks for NULL sip_pvt pointer in chan_sip.c->acf_channel_read() Zombie channels could be passed, and chan_sip.c wasn't checking for it. Could crash Asterisk. Now checking for NULL pointer. (closes issue #15330) Reported by: okrief Tested by: dbrooks ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-17SIP registry ref count errorDavid Vossel
During a sip reload, the list of sip_registry objects are supposed to be traversed, unlinked, and destroyed, but destruction never takes place due to a ref counting error. This causes a memory leak when registry items are removed from sip.conf and reloaded. While the registries are removed from the global list, they are not removed from the scheduler. Because of this, SIP register attempts continue to be sent out for the item even though it may no longer be in the .conf. (closes issue #15295) Reported by: amorsen Review: https://reviewboard.asterisk.org/r/282/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-16fix issue with build_contact introduced by the "SIP trasnport type issues" ↵David Vossel
commit git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-16Enable applications to enable/disable digit and tone detection.Kevin P. Fleming
Some applications (notably app_fax) do not need digit detection nor FAX tone detection while they are running, and if Asterisk is using software DSPs to provide the detection, this consumes extra CPU cycles that could be better spent on the actual application. This patch allows applications to query and control the state of digit and tone detection on a channel, and modifies app_fax to disable them while the FAX operations are occurring (and re-enable digit detection afterwards). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-16SIP transport type issuesDavid Vossel
What this patch addresses: 1. ast_sip_ouraddrfor() by default binds to the UDP address/port reguardless if the sip->pvt is of type UDP or not. Now when no remapping is required, ast_sip_ouraddrfor() checks the sip_pvt's transport type, attempting to set the address and port to the correct TCP/TLS bindings if necessary. 2. It is not necessary to send the port number in the Contact header unless the port is non-standard for the transport type. This patch fixes this and removes the todo note. 3. In sip_alloc(), the default dialog built always uses transport type UDP. Now sip_alloc() looks at the sip_request (if present) and determines what transport type to use by default. 4. When changing the transport type of a sip_socket, the file descriptor must be set to -1 and in some cases the tcptls_session's ref count must be decremented and set to NULL. I've encountered several issues associated with this process and have created a function, set_socket_transport(), to handle the setting of the socket type. (closes issue #13865) Reported by: st Patches: dont_add_port_if_tls.patch uploaded by Kristijan (license 753) 13865.patch uploaded by mmichelson (license 60) tls_port_v5.patch uploaded by vrban (license 756) transport_issues.diff uploaded by dvossel (license 671) Tested by: mmichelson, Kristijan, vrban, jmacz, dvossel Review: https://reviewboard.asterisk.org/r/278/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15Accept T.38 re-INVITE responses with invalid SDP versions.Kevin P. Fleming
This commit changes the 'incoming SDP version' check logic a bit more; when 'ignoresdpversion' is *not* set for a peer, if we initiate a re-INVITE to switch to T.38, we'll always accept the peer's SDP response, even if they don't properly increment the SDP version number as they should. If this situation occurs, a warning message will be generated suggesting that the peer's configuration be changed to include the 'ignoresdpversion' configuration option (although ideally they'd fix their SIP implementation to be RFC compliant). AST-221 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15Convert a number of global module variables to 'static'.Kevin P. Fleming
These modules all contained variables that are module-global but not system-global, but were not marked 'static'. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15Some minor structure size improvements in sip_pvt and sip_peer.Kevin P. Fleming
Using the 'pahole' tool, it is now quite easy to see where structure fields could be organized differently to keep the compiler from having to add padding to satisfy alignment requirements. These changes reduced the sizes of sip_pvt and sip_peer by a few bytes each (on 64-bit platforms), and also fixed a spelling error in a field name. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15Merged revisions 200513 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r200513 | mmichelson | 2009-06-15 10:21:46 -0500 (Mon, 15 Jun 2009) | 5 lines Add INFO to our allowed methods so that endpoints know they may send it to us. AST-223 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200514 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-11Fix a crash due to a potentially NULL p->options.Mark Michelson
Thanks to mnicholson for pointing it out. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-10Only try to use the invite_branch on outgoing INVITEs with auth credentials.Mark Michelson
I have added a comment to the code to help ease understanding of the logic here as well. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-09CLI NOTIFY sending wrong transport type.David Vossel
SIP's cli NOTIFY command only used UDP rather than copying the transport type from the peer. (closes issue #15283) Reported by: jthurman Patches: sip-notify-tcp-svn199728.patch uploaded by jthurman (license 614) Tested by: jthurman, dvossel git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-08Fix a deadlock that could occur when setting rtp stats on SIP calls.Mark Michelson
(closes issue #15143) Reported by: cristiandimache Patches: 15143.patch uploaded by mmichelson (license 60) Tested by: cristiandimache git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-02Correct documentation for the register line, specifically where the domain ↵Joshua Colp
should be specified. (closes issue #14367) Reported by: Nick_Lewis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-01Add the ability to execute connected line interception macros.Mark Michelson
When connected line updates are received or generated in the middle of an application call, it is now possible to execute a macro to manipulate the connected line data. This way, phone numbers may be manipulated to be more presentable to users, names may be changed for...whatever reason, or whatever else needs to be done may be. Review: https://reviewboard.asterisk.org/r/256 AST-165 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-01Fix a bug where the Event and Content-Type headers were added twice to ↵Joshua Colp
outgoing SIP NOTIFY messages. (closes issue #15239) Reported by: pj git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-30When removing all packets from a dialog we also need to free the data if ↵Joshua Colp
present. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-29Fix a bug where the default setting did not perform a remote bridge when it ↵Joshua Colp
should have. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-29A few fixes to SIP with regards to connected line updates during transfers.Mark Michelson
* Set the invitestate to INV_CALLING when we send a connected line reinvite. This prevents us from potentially rapid-firing reinvites to a single peer. * Use the astdb to store a peer's allowed methods. This prevents us from sending an UPDATE during the interval between startup and the peer's first registration if the peer does not support the UPDATE method. * Handle Polycom's method of indicating allowed methods in REGISTER. Instead of using an Allow header, they place the allowed methods in a methods= parameter in the Contact header. ABE-1873 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28Treat 405 responses the same way we would a 501.Mark Michelson
This makes sure that we mark a method as being unallowed if we receive a 405 response so that we don't continue to try to send that same type of message. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28Merged revisions 197562 via svnmerge from Eliel C. Sardanons
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r197562 | eliel | 2009-05-28 11:21:32 -0400 (Thu, 28 May 2009) | 13 lines Use the address we already know when reloading a peer with nat=yes. If we already have an address for a peer, and we are reloading the sip configuration, try to use that address to contact the peer, instead of getting it from the Contact. (closes issue #15194) Reported by: ibc Patches: sip.patch uploaded by eliel (license 64) Tested by: manwe ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28Merged revisions 197466 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r197466 | file | 2009-05-28 10:44:58 -0300 (Thu, 28 May 2009) | 8 lines Fix a bug where the flag indicating the presence of rport would get overwritten by the nat setting. The presence of rport is now stored as a separate flag. Once the dialog is setup and authenticated (or it passes through unauthenticated) the proper nat flag is set. (closes issue #13823) Reported by: dimas ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197467 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-27Adding some generic handling of error codes sent to us in replys to requests.Olle Johansson
Previously they always set hangupcause 0, which is generally wrong. With this change, we're setting some generic hangup causes. For 5xx errors, which indicate some sort of problem with the remote server, we're now setting CONGESTION. EDVX002 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-26Remove some redundant or unnecessary connected line-related function calls.Mark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-26Fix a bug where the sip unregister CLI command did not completely unregister ↵Joshua Colp
the peer. (closes issue #15118) Reported by: alecdavis Patches: chan_sip_unregister.diff2.txt uploaded by alecdavis (license 585) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22SIP set outbound transport type from RegistrationDavid Vossel
In sip.conf the transport option allows for the configuration of what transport types (udp, tcp, and tls) a peer will accept, but only the first type listed was used for outbound connections. This patch changes this. Now the default transport type is only used until the peer registers. When registration takes place the transport type is parsed out of the Contact header. If the Contact header's transport type is equal to one that the peer supports, the peer's default transport type for outbound connections is set to match the Contact header's type. If the Contact header's transport type is not present, then the peer's default transport type is set to match the one the peer registered with. When a peer unregisters or the registration expires, the default transport type for that peer is reset. (closes issue #12282) Reported by: rjain Patches: reg_patch_1.diff uploaded by dvossel (license 671) Tested by: dvossel (closes issue #14727) Reported by: pj Patches: reg_patch_3.diff uploaded by dvossel (license 671) Tested by: pj, dvossel Review: https://reviewboard.asterisk.org/r/249/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22Implement a new element in AstXML for AMI actions documentation.Eliel C. Sardanons
A new xml element was created to manage the AMI actions documentation, using AstXML. To register a manager action using XML documentation it is now possible using ast_manager_register_xml(). The CLI command 'manager show command' can be used to show the parsed documentation. Example manager xml documentation: <manager name="ami action name" language="en_US"> <synopsis> AMI action synopsis. </synopsis> <syntax> <xi:include xpointer="xpointer(...)" /> <-- for ActionID <parameter name="header1" required="true"> <para>Description</para> </parameter> ... </syntax> <description> <para>AMI action description</para> </description> <see-also> ... </see-also> </manager> git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22s/it's/its/Mark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21Const-ify the world (or at least a good part of it)Kevin P. Fleming
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes: - CLI command handlers - CLI command handler arguments - AGI command handlers - AGI command handler arguments - Dialplan application handler arguments - Speech engine API function arguments In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing. Review: https://reviewboard.asterisk.org/r/251/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-20Get rid of some duplicated code and correct a connected line error.Mark Michelson
When receiving a 200 OK response to an INVITE, it was possible to transmit two connected line updates instead of a single one. Furthermore, the second did not have the proper information present. Now the two have been combined into a single update and the correct information is presented. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-19Add basic support for handling connected line-related UPDATE requests.Mark Michelson
SIP purists may want to look the other way... When COLP/CONP support for SIP was committed, there was a condition under which Asterisk may transmit a SIP UPDATE in order to communicate the change in connected line information. The issue here is that while we could send a SIP UPDATE message, we were not prepared to receive such an UPDATE and would always responde with a 501 when we received an UPDATE. The situation was a bit rough. We really want to be able to receive UPDATEs having to do with connected line changes, but the amount of effort involved in properly supporting RFC 3311 was staggering. This commit represents a compromise. First, it was decided that it is important to only send a SIP UPDATE to an endpoint that is able to handle one. So, now we have added parsing of the Allow header into SIP. We store the allowed methods on SIP peers so that when we communicate with them, we already will know what we can and cannot send to them. We will parse the peer's allowed methods when he registers with us. If the peer is not the type to register with us, but the qualify option is enabled, then we will use the response to the OPTIONS request we send the peer to determine the peer's allowed methods. When the peer's registration expires, or when qualify deems the peer to be unreachable, we clear the allowed methods from the peer. For an actual call, we will copy the peer's allowed methods to the sip_pvt representing the call leg. If we are communicating with an endpoint which is not a peer, then we will just parse the Allow header from the first message we receive during the call and store the information in the sip_pvt. If, during communication with a peer, we receive a 501 response, then we will make sure to save the fact that we cannot use that method when communicating with that peer. Now, with all that infrastructure in place, the only actual place we use this information currently is when attempting to send a connected line change using an UPDATE request. If we cannot send the change immediately using an UPDATE, we will set the SIP_NEEDREINVITE flag so that we can send a REINVITE as soon as it is allowed. The second part of the changes here is for Asterisk to accept UPDATE requests that have connected line changes. Since we are not fully supporting RFC 3311, Asterisk will NOT place the UPDATE method in Allow headers it sends. Instead, if you are communicating with what you know to be another Asterisk box, you may set the rpid_update parameter in sip.conf so that we will send UPDATEs to that Asterisk box. When we send a connected line update, we set a custom header called "X-Asterisk-rpid-update." On the receiving end, if Asterisk receives an UPDATE that does not have the "X-Asterisk-rpid-update" header present, then Asterisk will respond with a 501 since media-changing UPDATEs are not supported. We should never get such UPDATEs, since as was stated earlier, Asterisk does not put UPDATE in its Allow header. If the custom header is present in the received UPDATE, though, then we will check the incoming request for connected line updates and queue the update on the channel where the change occurred. ABE-1840 ABE-1822 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-19Merged revisions 195448 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r195448 | file | 2009-05-19 11:41:45 -0300 (Tue, 19 May 2009) | 7 lines Fix a bug where direct RTP setup would partially occur even when disabled if the calling channel was answered. (issue #13545) Reported by: davidw (issue #14244) Reported by: mbnwa ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18Fix a bug where specifying an empty outboundproxy would cause packets to get ↵Joshua Colp
sent to ourself. (closes issue #15106) Reported by: timeshell git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195089 65c4cc65-6c06-0410-ace0-fbb531ad65f3