[asterisk-commits] mmichelson: branch 1.6.0 r144026 - in /branches/1.6.0: ./ channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Sep 23 10:38:07 CDT 2008
Author: mmichelson
Date: Tue Sep 23 10:38:06 2008
New Revision: 144026
URL: http://svn.digium.com/view/asterisk?view=rev&rev=144026
Log:
Merged revisions 144025 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r144025 | mmichelson | 2008-09-23 10:37:00 -0500 (Tue, 23 Sep 2008) | 16 lines
When a promiscuous redirect contained both a user and
host portion in the Contact URI and specifies a
transport, the parsing done in parse_moved_contact
resulted in a malformed URI.
This commit fixes the parsing so that a proper
Dial string may be formed when the forwarded
call is placed.
(closes issue #13523)
Reported by: mattdarnell
Patches:
13523v2.patch uploaded by putnopvut (license 60)
Tested by: mattdarnell
........
Modified:
branches/1.6.0/ (props changed)
branches/1.6.0/channels/chan_sip.c
Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.0/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_sip.c?view=diff&rev=144026&r1=144025&r2=144026
==============================================================================
--- branches/1.6.0/channels/chan_sip.c (original)
+++ branches/1.6.0/channels/chan_sip.c Tue Sep 23 10:38:06 2008
@@ -14595,6 +14595,7 @@
p->socket.type = transport;
if (ast_test_flag(&p->flags[0], SIP_PROMISCREDIR)) {
+ char *host = NULL;
if (!strncasecmp(s, "sip:", 4))
s += 4;
else if (!strncasecmp(s, "sips:", 5))
@@ -14602,9 +14603,16 @@
e = strchr(s, '/');
if (e)
*e = '\0';
- ast_debug(2, "Found promiscuous redirection to 'SIP/::::%s@%s'\n", get_transport(transport), s);
- if (p->owner)
- ast_string_field_build(p->owner, call_forward, "SIP/::::%s@%s", get_transport(transport), s);
+ if ((host = strchr(s, '@'))) {
+ *host++ = '\0';
+ ast_debug(2, "Found promiscuous redirection to 'SIP/%s::::%s@%s'\n", s, get_transport(transport), host);
+ if (p->owner)
+ ast_string_field_build(p->owner, call_forward, "SIP/%s::::%s@%s", s, get_transport(transport), host);
+ } else {
+ ast_debug(2, "Found promiscuous redirection to 'SIP/::::%s@%s'\n", get_transport(transport), s);
+ if (p->owner)
+ ast_string_field_build(p->owner, call_forward, "SIP/::::%s@%s", get_transport(transport), s);
+ }
} else {
e = strchr(tmp, '@');
if (e) {
More information about the asterisk-commits
mailing list