diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-12-15 18:56:14 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-12-15 18:56:14 +0000 |
commit | d89dcaa732ccf73567729b58ab567b92dc2b2866 (patch) | |
tree | 7016603de9a94946ae1e55d76e5f131de4776c2f /channels/chan_sip.c | |
parent | 0cb9fc2dfb5b20b2baa135b2d7a6eb0d54c83217 (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.0@235136 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index c9b6ab39e..1968609a0 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -10230,13 +10230,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(); |