[asterisk-commits] dvossel: branch 1.6.1 r235135 - /branches/1.6.1/channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Dec 15 12:49:55 CST 2009
Author: dvossel
Date: Tue Dec 15 12:49:52 2009
New Revision: 235135
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=235135
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.1/channels/chan_sip.c
Modified: branches/1.6.1/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.1/channels/chan_sip.c?view=diff&rev=235135&r1=235134&r2=235135
==============================================================================
--- branches/1.6.1/channels/chan_sip.c (original)
+++ branches/1.6.1/channels/chan_sip.c Tue Dec 15 12:49:52 2009
@@ -10906,13 +10906,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