aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-21 22:25:42 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-21 22:25:42 +0000
commit14d3053cd1d89434a827e9d115324e57fc8aa60d (patch)
tree6e31f15cb4026c62b5812d8d4048c3a944f15463 /channels/chan_sip.c
parenta0ae27b83498e2f11a6618c5111bc6cad6d91561 (diff)
Merged revisions 213716 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r213716 | dvossel | 2009-08-21 17:22:11 -0500 (Fri, 21 Aug 2009) | 10 lines Register request line contains wrong address when user domain and register host differ (closes issue #15539) Reported by: Nick_Lewis Patches: chan_sip.c-registraraddr.patch uploaded by Nick (license 657) register_domain_fix_1.6.2 uploaded by dvossel (license 671) Tested by: Nick_Lewis, dvossel ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@213727 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 68df84e9b..6219ebb77 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -9923,20 +9923,13 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
else
snprintf(to, sizeof(to), "<sip:%s@%s>", r->username, p->tohost);
}
-
- /* 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);
- }
+
+ /* 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);
+
ast_string_field_set(p, uri, addr);
p->branch ^= ast_random();