aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-14 16:59:35 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-14 16:59:35 +0000
commit5d024ddc5a916ea654b78d3dd05b26d2b5f1d9d6 (patch)
treefd469a381a810d4e031910ece50ff91c43602826 /channels
parentb9a5822dfb6ac50ab1b9c700879f6cd6dce5e349 (diff)
Merged revisions 58848 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r58848 | oej | 2007-03-13 12:49:35 +0100 (Tue, 13 Mar 2007) | 10 lines Merged revisions 58847 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r58847 | oej | 2007-03-13 12:45:52 +0100 (Tue, 13 Mar 2007) | 2 lines Issue #9229 - No port in request URI on register to non default SIP ports (neelakantan) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@58900 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index acbcfbbc0..6a2d449e8 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -7838,7 +7838,17 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
/* Fromdomain is what we are registering to, regardless of actual
host name from SRV */
- snprintf(addr, sizeof(addr), "sip:%s", S_OR(p->fromdomain, r->hostname));
+ 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();