Index: channels/chan_sip.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v retrieving revision 1.784 diff -u -r1.784 chan_sip.c --- channels/chan_sip.c 20 Jul 2005 17:05:18 -0000 1.784 +++ channels/chan_sip.c 23 Jul 2005 17:00:59 -0000 @@ -4237,7 +4237,7 @@ char iabuf[INET_ADDRSTRLEN]; /* Construct Contact: header */ - if (ourport != DEFAULT_SIP_PORT) + if (ourport != 5060) /* Needs to be 5060, according to the RFC */ snprintf(p->our_contact, sizeof(p->our_contact), "", 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), "", p->exten, ast_strlen_zero(p->exten) ? "" : "@", ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip)); @@ -4307,7 +4307,7 @@ else /* Save for any further attempts */ ast_copy_string(p->fromname, n, sizeof(p->fromname)); - if ((ourport != DEFAULT_SIP_PORT) && ast_strlen_zero(p->fromdomain)) + if ((ourport != 5060) && ast_strlen_zero(p->fromdomain)) /* Needs to be 5060 */ snprintf(from, sizeof(from), "\"%s\" ;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\" ;tag=as%08x", n, l, ast_strlen_zero(p->fromdomain) ? ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip) : p->fromdomain, p->tag); @@ -4318,12 +4318,12 @@ ast_copy_string(invite, p->fullcontact, sizeof(invite)); /* Otherwise, use the username while waiting for registration */ } else if (!ast_strlen_zero(p->username)) { - if (ntohs(p->sa.sin_port) != DEFAULT_SIP_PORT) { + if (ntohs(p->sa.sin_port) != 5060) { /* Needs to be 5060 */ snprintf(invite, sizeof(invite), "sip:%s@%s:%d%s",p->username, p->tohost, ntohs(p->sa.sin_port), urioptions); } else { snprintf(invite, sizeof(invite), "sip:%s@%s%s",p->username, p->tohost, urioptions); } - } else if (ntohs(p->sa.sin_port) != DEFAULT_SIP_PORT) { + } else if (ntohs(p->sa.sin_port) != 5060) { /* Needs to be 5060 */ snprintf(invite, sizeof(invite), "sip:%s:%d%s", p->tohost, ntohs(p->sa.sin_port), urioptions); } else { snprintf(invite, sizeof(invite), "sip:%s%s", p->tohost, urioptions);