aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-15 18:49:52 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-15 18:49:52 +0000
commit4af3aa0b081b44fecaed79b766219dbc023477a7 (patch)
tree0b86bb82955da4d0c4837c44b0e89b48d4f9fd5a /channels
parentb2b6244c7d74ebb797be1b781209217238c1e6c9 (diff)
reverses minor sip registration regression
reverses the changes caused by issue #15539. The issue reported was expected behavior. (issue #15539) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@235135 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 06417a83e..fce524ec1 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -10906,13 +10906,20 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
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();