aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
AgeCommit message (Collapse)AuthorFilesLines
2010-08-17Merged revisions 282577 via svnmerge from dvossel1-0/+3
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r282577 | dvossel | 2010-08-17 16:36:57 -0500 (Tue, 17 Aug 2010) | 16 lines Merged revisions 282576 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r282576 | dvossel | 2010-08-17 16:35:17 -0500 (Tue, 17 Aug 2010) | 9 lines fixes no default transport for temp peer creation in chan_sip (closes issue #17829) Reported by: falves11 Patches: issue_17829.rev1.txt uploaded by russell (license 2) issue_17829.diff uploaded by dvossel (license 671) Tested by: falves11 ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@282578 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-13Merged revisions 282302 via svnmerge from dvossel1-42/+6
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r282302 | dvossel | 2010-08-13 17:23:38 -0500 (Fri, 13 Aug 2010) | 10 lines remove current STUN support from chan_sip.c This patch removes the current broken/useless stun support from chan_sip. (closes issue #17622) Reported by: philipp2 Review: https://reviewboard.asterisk.org/r/855/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@282304 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-13Merged revisions 282269 via svnmerge from dvossel1-0/+55
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r282269 | dvossel | 2010-08-13 15:03:56 -0500 (Fri, 13 Aug 2010) | 4 lines res_stun_monitor for monitoring network changes behind a NAT device Review: https://reviewboard.asterisk.org/r/854 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@282270 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-13Merged revisions 282236 via svnmerge from dvossel1-15/+18
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r282236 | dvossel | 2010-08-13 13:58:10 -0500 (Fri, 13 Aug 2010) | 23 lines Merged revisions 282235 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r282235 | dvossel | 2010-08-13 13:54:53 -0500 (Fri, 13 Aug 2010) | 16 lines only do magic pickup when notifycid is enabled A new way of doing BLF pickup was introduced into 1.6.2. This feature adds a call-id value into the XML of a SIP_NOTIFY message sent to alert a subscriber that a device is ringing. This option should only be enabled when the new 'notifycid' option is set... but this was not the case. Instead the call-id value was included for every RINGING Notify message, which caused a regression for people who used other methods for call pickup. (closes issue #17633) Reported by: urosh Patches: chan_sip.txt uploaded by urosh (license ) blf_cid_issue.diff uploaded by dvossel (license 671) Tested by: dvossel, urosh, okrief, alecdavis ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@282237 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-11Merged revisions 281874 via svnmerge from mnicholson1-34/+21
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r281874 | mnicholson | 2010-08-11 16:11:54 -0500 (Wed, 11 Aug 2010) | 10 lines handle all possible responses to REFER requests (closes issue #17486) Reported by: davidw Patches: Issue17486-counterbid.diff.txt uploaded by davidw (license 780) Tested by: davidw Review: https://reviewboard.asterisk.org/r/837/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@281876 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-11Merged revisions 281760 via svnmerge from mnicholson1-0/+8
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r281760 | mnicholson | 2010-08-11 12:27:59 -0500 (Wed, 11 Aug 2010) | 4 lines Avoid a deadlock in add_header_max_forwards(). Related to r276951 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@281761 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-10Merged revisions 281532 via svnmerge from russell1-3/+10
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r281532 | russell | 2010-08-10 11:54:20 -0500 (Tue, 10 Aug 2010) | 8 lines Ensure that the proper external address is used for the RTP destination. (closes issue #17044) Reported by: ebroad Tested by: ebroad Review: https://reviewboard.asterisk.org/r/566/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@281533 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-09Merged revisions 281432 via svnmerge from dvossel1-1/+4
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r281432 | dvossel | 2010-08-09 15:47:53 -0500 (Mon, 09 Aug 2010) | 20 lines Merged revisions 281430 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r281430 | dvossel | 2010-08-09 15:46:50 -0500 (Mon, 09 Aug 2010) | 13 lines fixes SIP peers memory leak We zeroed out the peer's addr before it was removed from the peers_by_ip container. This made it impossible to be removed from the container as the addr is the key used by the container to find the peer. (closes issue #17774) Reported by: kkm Patches: 017774-sip-peer-leak-1.6.2.10.diff uploaded by kkm (license 888) 017774-sip-peer-leak-1.8.diff uploaded by kkm (license 888) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@281433 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-03Merged revisions 280778 via svnmerge from simon.perreault1-12/+34
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r280778 | simon.perreault | 2010-08-03 15:54:03 -0400 (Tue, 03 Aug 2010) | 9 lines Fixed IPv6-related SIP parsing bugs. (closes issue #17663) Reported by: oej Patches: diff uploaded by sperreault (license 252) diff2 uploaded by sperreault (license 252) get_domain.diff uploaded by sperreault (license 252) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@280780 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-03Reverted r280706 and r280707. Will commit in branch 1.8 and merge to trunk ↵simon.perreault1-34/+12
properly. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@280745 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-03Fixed IPv6-related SIP parsing bugs.simon.perreault1-12/+34
(closes issue #17663) Reported by: oej Patches: diff uploaded by sperreault (license 252) diff2 uploaded by sperreault (license 252) get_domain.diff uploaded by sperreault (license 252) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@280707 f38db490-d61c-443f-a65b-d21fe96a405b
2010-08-02if totag is not present for an ACK request, do not send an error responsedvossel1-1/+3
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@280627 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-29Merged revisions 280552 via svnmerge from dvossel1-4/+33
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r280552 | dvossel | 2010-07-29 15:43:47 -0500 (Thu, 29 Jul 2010) | 17 lines Merged revisions 280551 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r280551 | dvossel | 2010-07-29 15:42:29 -0500 (Thu, 29 Jul 2010) | 11 lines fixes wrong SRV query for TLS connection (closes issue #17612) Reported by: marcelloceschia Patches: chan-sip_srvQuery.patch uploaded by marcelloceschia (license 1079) chan-sip_Trunk_srvQuery.patch uploaded by st (license 907) chan-sip_asterisk18b1_srvQuery.patch uploaded by marcelloceschia (license 1079) Tested by: marcelloceschia, st, pabelanger ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@280553 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-29respond with 481 when request requiring totag has no totag to match againstdvossel1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@280518 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-28Formatting changesoej1-41/+70
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@280093 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-27Merged revisions 279887 via svnmerge from mmichelson1-21/+16
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r279887 | mmichelson | 2010-07-27 13:54:07 -0500 (Tue, 27 Jul 2010) | 16 lines Fix parsing error in sip_sipredirect(). The code was written in a way that did a bad job of parsing the port out of a URI. Specifically, it would do badly when dealing with an IPv6 address. In this particular scenario, there was no value from parsing the port out, so I just removed that logic. And while I was messing around in the function, I changed some variable names to be more descriptive. (closes issue #17661) Reported by: oej Patches: 17661.diff uploaded by mmichelson (license 60) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@279888 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-27Merged revisions 279817 via svnmerge from dvossel1-3/+2
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r279817 | dvossel | 2010-07-27 11:09:15 -0500 (Tue, 27 Jul 2010) | 2 lines fix sip transaction match with authentication, fix confusing log message when using getaddrinfo ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@279818 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-27Merged revisions 279785 via svnmerge from mmichelson1-8/+9
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r279785 | mmichelson | 2010-07-27 10:15:22 -0500 (Tue, 27 Jul 2010) | 20 lines Merged revisions 279784 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r279784 | mmichelson | 2010-07-27 10:13:24 -0500 (Tue, 27 Jul 2010) | 14 lines Fix bad behavior of dynamic_exclude_static option in sip.conf. We were attempting to create a contactdeny rule based on the peer's IP address before the peer's IP address had been set. By moving the processing further down in the function, we can ensure stuff works as we expect for it to. (closes issue #17717) Reported by: mmichelson Patches: 17717.patch uploaded by mmichelson (license 60) Tested by: DennisD ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@279786 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-26Merged revisions 279568 via svnmerge from dvossel1-42/+232
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r279568 | dvossel | 2010-07-26 14:59:03 -0500 (Mon, 26 Jul 2010) | 21 lines transaction matching using top most Via header This patch modifies the way chan_sip.c does transaction to dialog matching. Asterisk now stores information in the top most Via header of the initial incoming request and compares that against other Requests that have the same call-id. This results in Asterisk being able to detect a forked call in which it has received multiple legs of the fork. I completely stripped out the previous matching code and made the comparisons a little more explicit and easier to understand. My comments in the code should offer all the details involving this patch. This patch also fixes a bug with the usage of the OBJ-MULTIPLE flag to find multiple dialogs with the same call-id. Since the callback function was returning (CMP_MATCH | CMP_STOP) only the first item found was being returned. I fixed this by making a new callback function for finding multiple dialogs that only returns (CMP_MATCH) on a match allowing for multiple items to be returned. Review: https://reviewboard.asterisk.org/r/776/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@279569 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-23SIP URI comparison fixes.mmichelson1-286/+8
This initially was created to work around the issue of using a string comparison instead of a binary comparison for IP addresses. It evolved a bit when test cases were created and it was discovered that comparison of URI parameters was not working exactly as it should. sip_uri_cmp() and its helpers have been moved to reqresp_parser.c and a new test has been added. (closes issue #17662) Reported by: oej Review: https://reviewboard.asterisk.org/r/792 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278980 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-23... just kidding. Enable SIP by default. :-)russell1-1/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278945 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-23Disable SIP support by default for Asterisk 1.8.russell1-1/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278944 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-23Allow IPv6 addresses for UDPTL streams.mmichelson1-47/+26
Review: https://reviewboard.asterisk.org/r/795 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278908 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-22update sip subscription debug message to a warning messagedvossel1-2/+4
If the Expire header of a SUBSCRIBE is less that our expiremin, a log warning will be displayed. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278619 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-21send "423 Interval too small" Response to Subscribe with Expires less that ↵dvossel1-2/+19
min allowed [RFC3265]3.1.6.1.... The notifier MAY also check that the duration in the "Expires" header is not too small. If and only if the expiration interval is greater than zero AND smaller than one hour AND less than a notifier- configured minimum, the notifier MAY return a "423 Interval too small" error which contains a "Min-Expires" header field. The "Min- Expires" header field is described in SIP [1]. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278536 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-21Properly set the port number for UDPTL media sessions.mnicholson1-2/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278461 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-20fixes sip CANCEL race conditiondvossel1-10/+11
If Asterisk sends a 4xx error and the other side sends a CANCEl before receiving the 4xx and responding with the ACK, Asterisk will process the CANCEL and send a 487 Request Terminated as a new final response to the INVITE. Since we are issuing a new final response to the INVITE, the old one must be pretend_acked else it will keep retransmitting. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278234 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-20Add load priority order, such that preload becomes unnecessary in most casestilghman1-1/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278132 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-19Fix port setting of external address in SIP.mmichelson1-41/+43
There are two changes here: 1. Since the externip setting can now have a port attached to it, calling it "externip" is misleading. The option is now documented and parsed as "externaddr." This also extends to the "matchexterniplocally" setting. It is now documented and parsed as "matchexternaddrlocally." The old names for the options may still be used, but they are no longer used in the sip.conf.sample file. 2. If no port is set for the externaddr, and UDP is the transport to be used, then we will set the port of the externaddr to that of the udpbindaddr. This was how things worked prior to the IPv6 merge, so this is a regression fix. (closes issue #17665) Reported by: mmichelson Patches: 17665.diff#2 uploaded by pprindeville (license 347) Tested by: pprindeville git-svn-id: http://svn.digium.com/svn/asterisk/trunk@277873 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-19Make ACLs IPv6-capable.mmichelson1-50/+25
ACLs can now be configured to match IPv6 networks. This is only relevant for ACLs in chan_sip for now since other channel drivers do not support IPv6 addressing. However, once those channel drivers are outfitted to support IPv6 addressing, the ACLs will already be ready for IPv6 support. https://reviewboard.asterisk.org/r/791 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@277814 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-16Merged revisions 277497 via svnmerge from mnicholson1-0/+4
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r277497 | mnicholson | 2010-07-16 16:18:38 -0500 (Fri, 16 Jul 2010) | 4 lines Default to no udptl error correction so that error correction will be disabled in the event that the remote end indicates that they do not support the error correction mode we requested. FAX-128 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@277530 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-16Formatting fixesoej1-168/+306
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@277065 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-16Formatting changes (guideline corrections)oej1-35/+69
Found a unused bag of curly brackets under my table. I always wondered where they had gone. They where indeed needed in chan_sip.c git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276989 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-16Add ability to configure the Max-Forwards header in the dialplan, as well as inoej1-3/+45
sip.conf configuration for the channel and for devices. The Max-Forwards header is used to prevent loops in a SIP network. Each intermediary, like SIP proxys and SBCs, decrement this counter and detects when it reaches zero, at which point the SIP request is nicely killed in a SIP-friendly way. Review: https://reviewboard.asterisk.org/r/778/ Thanks to dvossel for the review and good advice. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276951 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-16Fix reversed logic of if statement.mmichelson1-1/+1
Found based on message from Philip Prindeville on the Asterisk Developers mailing list. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276909 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-15Correct not setting the bindport before attempting to open the socket.jpeeler1-64/+62
Related to changes from 276571, I was accidentally testing with a port set in my configuration causing me to miss this. Also moved the TCP handling as well to occur before build_peer is called. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276788 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-14Fix MWI notification transmission problems over SIP.jpeeler1-51/+52
MWI updates were not being sent if no messages were found in the event cache. This was corrected since a phone may need to clear its MWI status configured previously from another mailbox. Upon module or sip reload, MWI updates could not be sent due to the sipsock socket not being set early enough in reload_config. The code handling the descriptor assignment and such has simply been moved before the call to build_peer. Issuing a sip reload cleared the IP address of the peer, but skipped checking the database for registration information. The database is now checked both for sip reload and actually reloading the module. If a transmission occurs before the do_monitor thread has started, do not attempt to send a signal to it. (closes issue #17398) Reported by: ip-rob git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276571 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-14Fix errors where incorrect address information was printed.mmichelson1-9/+9
ast_sockaddr_stringiy_fmt (which is call by all ast_sockaddr_stringify* functions) uses thread-local storage for storing the string that it creates. In cases where ast_sockaddr_stringify_fmt was being called twice within the same statement, the result of one call would be overwritten by the result of the other call. This usually was happening in printf-like statements and was resulting in the same stringified addressed being printed twice instead of two separate addresses. I have fixed this by using ast_strdupa on the result of stringify functions if they are used twice within the same statement. As far as I could tell, there were no instances where a pointer to the result of such a call were saved anywhere, so this is the only situation I could see where this error could occur. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276570 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-14handle special case were "200 Ok" to pending INVITE never receives ACKdvossel1-1/+19
Unlike most responses, the 200 Ok to a pending INVITE Request is acknowledged by an ACK Request. If the ACK Request for this Response is not received the previous behavior was to immediately destroy the dialog and hangup the channel. Now in an effort to be more RFC compliant, instead of immediately destroying the dialog during this special case, termination is done with a BYE Request as the dialog is technically confirmed when the 200 Ok is sent even if the ACK is never received. The behavior of immediately hanging up the channel remains. This only affects how dialog termination proceeds for this one special case. RFC 3261 section 13.3.1.4 "If the server retransmits the 2xx response for 64*T1 seconds without receiving an ACK, the dialog is confirmed, but the session SHOULD be terminated. This is accomplished with a BYE, as described in Section 15." git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276439 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-14Expand the caller ANI field to an ast_party_idrmudgett1-1/+4
Expand the ani field in ast_party_caller and ast_party_connected_line to an ast_party_id. This is an extension to the ast_callerid restructuring patch in review: https://reviewboard.asterisk.org/r/702/ Review: https://reviewboard.asterisk.org/r/744/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276393 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-14collapse debug code in retrans_pkt into separate linesdvossel1-3/+14
I've been working in this function a bunch lately, and these huge debug strings are getting annoying. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276392 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-14Do not skip sending MWI for a peer if an address is defined. Really just a ↵jpeeler1-1/+1
merge mistake from IPv6 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276389 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-14ast_callerid restructuringrmudgett1-101/+199
The purpose of this patch is to eliminate struct ast_callerid since it has turned into a miscellaneous collection of various party information. Eliminate struct ast_callerid and replace it with the following struct organization: struct ast_party_name { char *str; int char_set; int presentation; unsigned char valid; }; struct ast_party_number { char *str; int plan; int presentation; unsigned char valid; }; struct ast_party_subaddress { char *str; int type; unsigned char odd_even_indicator; unsigned char valid; }; struct ast_party_id { struct ast_party_name name; struct ast_party_number number; struct ast_party_subaddress subaddress; char *tag; }; struct ast_party_dialed { struct { char *str; int plan; } number; struct ast_party_subaddress subaddress; int transit_network_select; }; struct ast_party_caller { struct ast_party_id id; char *ani; int ani2; }; The new organization adds some new information as well. * The party name and number now have their own presentation value that can be manipulated independently. ISDN supplies the presentation value for the name and number at different times with the possibility that they could be different. * The party name and number now have a valid flag. Before this change the name or number string could be empty if the presentation were restricted. Most channel drivers assume that the name or number is then simply not available instead of indicating that the name or number was restricted. * The party name now has a character set value. SIP and Q.SIG have the ability to indicate what character set a name string is using so it could be presented properly. * The dialed party now has a numbering plan value that could be useful to have available. The various channel drivers will need to be updated to support the new core features as needed. They have simply been converted to supply current functionality at this time. The following items of note were either corrected or enhanced: * The CONNECTEDLINE() and REDIRECTING() dialplan functions were consolidated into func_callerid.c to share party id handling code. * CALLERPRES() is now deprecated because the name and number have their own presentation values. * Fixed app_alarmreceiver.c write_metadata(). The workstring[] could contain garbage. It also can only contain the caller id number so using ast_callerid_parse() on it is silly. There was also a typo in the CALLERNAME if test. * Fixed app_rpt.c using ast_callerid_parse() on the channel's caller id number string. ast_callerid_parse() alters the given buffer which in this case is the channel's caller id number string. Then using ast_shrink_phone_number() could alter it even more. * Fixed caller ID name and number memory leak in chan_usbradio.c. * Fixed uninitialized char arrays cid_num[] and cid_name[] in sig_analog.c. * Protected access to a caller channel with lock in chan_sip.c. * Clarified intent of code in app_meetme.c sla_ring_station() and dial_trunk(). Also made save all caller ID data instead of just the name and number strings. * Simplified cdr.c set_one_cid(). It hand coded the ast_callerid_merge() function. * Corrected some weirdness with app_privacy.c's use of caller presentation. Review: https://reviewboard.asterisk.org/r/702/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276347 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-13chan_sip: RFC compliant retransmission timeoutdvossel1-11/+37
Retransmission of packets should not be based on how many packets were sent, but instead on a timeout period. Depending on whether or not the packet is for a INVITE or NON-INVITE transaction, the number of packets sent during the retransmission timeout period will be different, so timing out based on the number of packets sent is not accurate. This patch fixes this by removing the retransmit limit and only stopping retransmission after a timeout period is reached. By default this timeout period is 64*(Timer T1) for both INVITE and non-INVITE transactions. For more information on sip timer values refer to RFC3261 Appendix A. Review: https://reviewboard.asterisk.org/r/749/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276219 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-13Revert early destruction of RTP sessionstwilson1-22/+9
Some code improperly assumes that the sessions are still there, so revert the change until I can find all of them and fix them. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@276206 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-13Destroy RTP fds when we schedule final dialog destructiontwilson1-9/+22
Since we are only keeping the dialog around for retransmissions at this point and there is no possibility that we are still handling RTP, go ahead and destroy the RTP sessions. Keeping them alive for 32 past when they are used is unnecessary and can lead to problems with having too many open file descriptors, etc. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@275998 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-12Don't try to ref authpeer when it isn't settwilson1-1/+3
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@275816 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-09Fix error in parsing SIP registry strings from ASTdb.mmichelson1-18/+22
It was essentially an off-by-one error. The easiest way to fix this was to use the handy-dandy AST_NONSTANDARD_RAW_ARGS macro to parse the pieces of the registration string out. Tested and it works wonderfully. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@275385 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-09Fix port parsing in check_via.mmichelson1-5/+7
If a Via header contained an IPv6 address, we would not properly parse the port. We would instead get the information after the first colon in the address. (closes issue #17614) Reported by: oej Patches: diff uploaded by sperreault (license 252) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@275308 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-09Fix an issue where the port for p->ourip was being set to 0.mmichelson1-0/+3
This should fix all the CDR tests that were not passing. When they would originate a call, all fields in the INVITE that contained the source port would have the port set to 0. Most troubling of these was the Contact header. Tests are passing locally now and should also pass on the bamboo build agents. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@275294 f38db490-d61c-443f-a65b-d21fe96a405b