aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-29 23:08:12 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-29 23:08:12 +0000
commitd9d6759f37dfee5e0eeff67416954ade8c6846ba (patch)
tree4dcec0f5c9c0cdf230ca0681f44a5d31a2b9aebe
parent66767ad185a2de9744e77be83fb3e814cb586eb8 (diff)
use DEFAULT_SIP_PORT (bug #4408)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5782 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xchannels/chan_sip.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 36433f3b4..da9d5cf04 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -3444,14 +3444,14 @@ static void set_destination(struct sip_pvt *p, char *uri)
ast_copy_string(hostname, h, hn);
h += hn - 1;
- /* Is "port" present? if not default to 5060 */
+ /* Is "port" present? if not default to DEFAULT_SIP_PORT */
if (*h == ':') {
/* Parse port */
++h;
port = strtol(h, &h, 10);
}
else
- port = 5060;
+ port = DEFAULT_SIP_PORT;
/* Got the hostname:port - but maybe there's a "maddr=" to override address? */
maddr = strstr(h, "maddr=");
@@ -4108,7 +4108,7 @@ static void build_contact(struct sip_pvt *p)
char iabuf[INET_ADDRSTRLEN];
/* Construct Contact: header */
- if (ourport != 5060)
+ if (ourport != DEFAULT_SIP_PORT)
snprintf(p->our_contact, sizeof(p->our_contact), "<sip:%s%s%s:%d>", p->exten, ast_strlen_zero(p->exten) ? "" : "@", ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip), ourport);
else
snprintf(p->our_contact, sizeof(p->our_contact), "<sip:%s%s%s>", p->exten, ast_strlen_zero(p->exten) ? "" : "@", ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip));
@@ -4179,7 +4179,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
else /* Save for any further attempts */
ast_copy_string(p->fromname, n, sizeof(p->fromname));
- if ((ourport != 5060) && ast_strlen_zero(p->fromdomain))
+ if ((ourport != DEFAULT_SIP_PORT) && ast_strlen_zero(p->fromdomain))
snprintf(from, sizeof(from), "\"%s\" <sip:%s@%s:%d>;tag=as%08x", n, l, ast_strlen_zero(p->fromdomain) ? ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip) : p->fromdomain, ourport, p->tag);
else
snprintf(from, sizeof(from), "\"%s\" <sip:%s@%s>;tag=as%08x", n, l, ast_strlen_zero(p->fromdomain) ? ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip) : p->fromdomain, p->tag);