summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
AgeCommit message (Collapse)Author
2008-11-09In order to move away from nested function use, some changes to the recently ↵Sean Bright
introduced ast_channel_search_locked need to be made. Specifically, the caller needs to be able to pass arbitrary data which in turn is passed to the callback. This patch addresses all of the nested functions currently in asterisk trunk. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155590 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-08 - Check for failure when putting the packet in the ast_strRussell Bryant
- fix a spelling error in a header file git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155516 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-08Remove some code that is basically a no-op. Code above this already ensures ↵Russell Bryant
that the buffer is terminated. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-07Set the invite state to INV_CANCELLED in a place thatMark Michelson
makes more sense. Where it was set before, it was impossible to actually delay sending a CANCEL if we had not yet received a provisional response to an INVITE. (closes issue #13626) Reported by: atis Patches: 13626.patch uploaded by putnopvut (license 60) Tested by: atis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155467 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-07Add ability to pass arbitrary data to the ao2_callback_fn (called fromSean Bright
ao2_callback and ao2_find). Currently, passing OBJ_POINTER to either of these mandates that the passed 'arg' is a hashable object, making searching for an ao2 object based on outside criteria difficult. Reviewed by Russell and Mark M. via ReviewBoard: http://reviewboard.digium.com/r/36/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-07Merged revisions 155398 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r155398 | tilghman | 2008-11-07 16:27:32 -0600 (Fri, 07 Nov 2008) | 7 lines Clarify error message. (closes issue #13809) Reported by: denke Patches: 20081104__bug13809.diff.txt uploaded by Corydon76 (license 14) Tested by: denke ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155399 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-07stringfields conversion for struct sip_peer, as requested :-)Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-07Remove a bogus ast_free() that Kevin noticed. This was probably just left over Russell Bryant
from pre-astobj2ified chan_sip. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-07Fix some code in chan_sip that was intended to unlink multiple objects from aRussell Bryant
container. The OBJ_MULTIPLE flag must be provided here. Otherwise, this would only remove a single object. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-04Introduce a new API call ast_channel_search_locked, which iterates through theSean Bright
channel list calling a caller-defined callback. The callback returns non-zero if a match is found. This should speed up some of the code that I committed earlier today in chan_sip (which is also updated by this commit). Reviewed by russellb and kpfleming via ReviewBoard: http://reviewboard.digium.com/r/28/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-04Allow devices that accept dialog-info+xml (like snoms) to get the Caller ID ofSean Bright
the calling party when subscribed to the state of an extension that is ringing. This has some limitations which are documented in sip.conf.sample. (closes issue #13827) Reported by: seanbright Patches: issue13827.patch uploaded by seanbright (license 71) Reviewed by: russellb git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-03Adding a separation of remote authentication and our authentication.Olle Johansson
remotesecret => our password for a remote service secret => our authentication when someone calls us Secret => still has both functions if remotesecret is not used. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-03Add XML documentation for:Eliel C. Sardanons
Applications - SIPDtmfMode() - SIPAddHeader() Functions - SIP_HEADER() - SIPPEER() - SIPCHANINFO() - CHECKSIPDOMAIN() git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 ↵Kevin P. Fleming
branch, and add the ones needed for all the new code here too git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-01Don't ignore the result of find_peer() when looking for a peer by IP in ↵Russell Bryant
check_peer_ok(). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-01Ensure that the sip_pvt properly has its refcount incremented when the ↵Russell Bryant
scheduler holds a reference to it for session timer processing. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-31Merged revisions 153114 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r153114 | tilghman | 2008-10-31 11:30:32 -0500 (Fri, 31 Oct 2008) | 3 lines Turn off qualify on uncached realtime peers. (Closes issue #13383) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30Fix the sip_peer reference count with respect to scheduler entries forRussell Bryant
scheduling peer pokes, and scheduling peer poke expirations. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30Fix the sip_peer reference count with respect to scheduler entries forRussell Bryant
registration expirations. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30I just noticed this construct and thought it wasMark Michelson
silly to have a bunch of case statements with duplicated code in each case. Instead, just use the built-in fallthrough capability of case statements and reduce the code to a single instance git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30Modify the documentation of the sip_registry structRussell Bryant
- Remove a comment that says that the monitor thread is the only one that ever touches these objects. This is no longer the case with TCP. Also, I would eventually like to get the scheduler in its own thread, so this is just a poor assumption to make. - Note that reference counting of these objects with respect to scheduler entries is not complete. There are some leaked references when deleting scheduler entries. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29Merged revisions 152539 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r152539 | russell | 2008-10-29 00:23:51 -0500 (Wed, 29 Oct 2008) | 7 lines Fix an incorrect usage of sizeof() (closes issue #13795) Reported by: andrew53 Patches: chan_sip_sizeof.patch uploaded by andrew53 (license 519) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-26Trying to fix the user/peer matching correctly. This will need some testing ↵Olle Johansson
before getting merged into 1.6.1 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-26Moving more variables to the sip_cfg structure, as I have some future ideas ↵Olle Johansson
for the usage of that structure. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-26Doxygen changes and some formatting.Olle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-23Adding a small new feature. Olle Johansson
Setting _SIPFROMDOMAIN in a channel will set the domain we use for the URI in the outbound call leg. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151739 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-22 revert the changes in issue #13705 - it's being re-opened as while the ↵BJ Weschke
results fixed the complaint in the issue, it introduced other more undesirable issues than what was already reported git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151642 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-22Print out the right var in the log messageRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-22Fix this check to use the proper variable (the result from get_in_brackets)Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-22The logic of a strncasecmp call was reversed.Mark Michelson
(closes issue #13706) Reported by: andrew53 Patches: sip_notify_from_rfc3265.patch uploaded by andrew53 (license 519) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-21Make the sip_standard_port function more granular by allowing separateMark Michelson
type and port arguments. This is necessary because when building our From and Contact headers, we need to be absolutely sure that we are placing our source port there and not the peer's source port. (closes issue #12761) Reported by: asbestoshead Patches: patch-chan-sip-contact-port.txt uploaded by asbestoshead (license 455) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-21Get this compiling in dev-modeMark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-21If a peer uses any transport other than UDP, then MWI willMark Michelson
fail for that peer since sip_alloc will allocate a sip_pvt with a default transport of UDP. This change resets the socket type immediately after allocating the sip_pvt in sip_send_mwi_from_peer, so that the proceeding call to create_addr_from_peer does not fail right away. The socket data from the peer is properly copied to the sip_pvt in create_addr_from_peer. (closes issue #13710) Reported by: andrew53 Patches: sip_notify_use_tcp.patch uploaded by andrew53 (license 519) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151428 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-21When attempting to resolve hostnames, we need to be sureMark Michelson
to remove any parameters from the string so that name resolution succeeds. (closes issue #13727) Reported by: fnordian Patches: resolvewithouturiparameter.patch uploaded by fnordian (license 110) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151420 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-21 Fix configuration parsing so type=friend still identifies "friend" as a ↵BJ Weschke
peer even though it is now a legacy configuration verb. (closes issue #13705) reported by: blitzrage patched by: bweschke git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-19cleaup of the TCP/TLS socket API:Kevin P. Fleming
1) rename 'struct server_args' to 'struct ast_tcptls_session_args', to follow coding guidelines 2) make ast_make_file_from_fd() static and rename it to something that indicates what it really is for (again coding guidelines) 3) rename address variables inside 'struct ast_tcptls_session_args' to be more descriptive (dare i say it... coding guidelines) 4) change ast_tcptls_client_start() to use the new 'remote_address' field of the session args for the destination of the connection, and use the 'local_address' field to bind() the socket to the proper source address, if one is supplied 5) in chan_sip, ensure that we pass in the PP address we are bound to when creating outbound (client) connections, so that our connections will appear from the correct address git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-19Adding changes from train and flight back home from SIPit23 in Lannion, France.Olle Johansson
- Additional comments on TCP/TLS implementation - Some additions for new drafts/rfcs (no new functionality really, mostly documentation) - Other random small fixes git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-17Adding some additional thoughts on configuration changes to TCP/TLSOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@150510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-17After a long discussion on #asterisk-bugs, it seems kind ofMark Michelson
odd that a channel would be named after the originating port. For endpoints that always include ":5060" as part of the From: header, it will mean that you have a ton of channels with names like "SIP/5060-3ea38a8b." I am boldly moving forward with this change in trunk, but I'm not touching other branches with this one since this definitely would qualify as a behavior change. If there is a problem with this commit, and I haven't seen the obvious reason why you'd want to name the channel after the port from which the call originated, then please feel free to revert this git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@150307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16INVITES with proxy auth were sent with a different branchMark Michelson
than what was in the invite_branch of a sip_pvt, meaning that if a CANCEL were sent later, the branch in the CANCEL would not match the branch in the latest INVITE sent out, leading to some endpoints responding to the CANCEL with a 481. (closes issue #13714) Reported by: fnordian Patches: invite_branch.patch uploaded by fnordian (license 110) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@150207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16ensure that type=peer entries are only matched on IP/port, not on name ↵Kevin P. Fleming
(after oej audits all the calls to find_peer() to make sure that forcenamematch is set correctly in each case) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@150052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16Doxygen additionOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@150051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16Add some notes on problems with the TCP/TLS implementationOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@150008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16return this logic to where it used to be, *after* the dialog->needdestroy ↵Kevin P. Fleming
flag has been determined to be set; otherwise, we generate these debug messages every time we inspect every active dialog git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149981 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16some additional debugging tools added at SIPit23:Kevin P. Fleming
- move all setting of 'needdestroy' on dialog structures into the history - report all tags involved when a pedantic check fails on a REFER git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-15Make the sip_proxy struct reference counted. This isMark Michelson
necessary to allow for a sip_pvt to maintain a reference to a sip_peer's outboundproxy even after the peer has been freed. (closes issue #13700) Reported by: fnordian Patches: 13700.patch uploaded by putnopvut (license 60) Tested by: fnordian git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-15Adding a note about a missing part of "kill-the-user" - I got lost in the ↵Olle Johansson
Ao2 world... We're going to try to get time to fix this and kpfleming believes that there's code in ao2 so that we can solve it... git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-15Merged revisions 149452 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r149452 | kpfleming | 2008-10-15 12:30:40 +0200 (Wed, 15 Oct 2008) | 3 lines fix some problems when parsing SIP messages that have the maximum number of headers or body lines that we support ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-15Fixing sytax errors ;-)Olle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14Merged revisions 149266 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r149266 | mmichelson | 2008-10-14 18:43:58 -0500 (Tue, 14 Oct 2008) | 4 lines Change this warning to an error message. Suggestion comes from Sean Bright. Thanks Sean! ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149271 65c4cc65-6c06-0410-ace0-fbb531ad65f3