[asterisk-commits] dvossel: branch 1.6.0 r235136 - /branches/1.6.0/channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Dec 15 12:56:17 CST 2009
Author: dvossel
Date: Tue Dec 15 12:56:14 2009
New Revision: 235136
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=235136
Log:
reverses minor sip registration regression
reverses the changes caused by issue #15539. The
issue reported was expected behavior.
(issue #15539)
Modified:
branches/1.6.0/channels/chan_sip.c
Modified: branches/1.6.0/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.0/channels/chan_sip.c?view=diff&rev=235136&r1=235135&r2=235136
==============================================================================
--- branches/1.6.0/channels/chan_sip.c (original)
+++ branches/1.6.0/channels/chan_sip.c Tue Dec 15 12:56:14 2009
@@ -10230,13 +10230,20 @@
else
snprintf(to, sizeof(to), "<sip:%s@%s>", r->username, p->tohost);
}
-
- /* Host is what we are registered to, regardless if a domain exists in the username */
- if (r->portno && r->portno != STANDARD_SIP_PORT)
- snprintf(addr, sizeof(addr), "sip:%s:%d", r->hostname, r->portno);
- else
- snprintf(addr, sizeof(addr), "sip:%s", r->hostname);
-
+
+ /* Fromdomain is what we are registering to, regardless of actual
+ host name from SRV */
+ if (!ast_strlen_zero(p->fromdomain)) {
+ if (r->portno && r->portno != STANDARD_SIP_PORT)
+ snprintf(addr, sizeof(addr), "sip:%s:%d", p->fromdomain, r->portno);
+ else
+ snprintf(addr, sizeof(addr), "sip:%s", p->fromdomain);
+ } else {
+ if (r->portno && r->portno != STANDARD_SIP_PORT)
+ snprintf(addr, sizeof(addr), "sip:%s:%d", r->hostname, r->portno);
+ else
+ snprintf(addr, sizeof(addr), "sip:%s", r->hostname);
+ }
ast_string_field_set(p, uri, addr);
p->branch ^= ast_random();
More information about the asterisk-commits
mailing list