Fix port :0 added to SIP INVITE URI when outboundproxy used

(closes issue #14233)
Reported by: chris-mac
Patches: 
      asterisk-bug14233.diff.txt uploaded by jamesgolovich (license 176)
Tested by: jamesgolovich, chris-mac, otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Terry Wilson
2009-01-17 00:03:39 +00:00
parent a2ac43cb8a
commit 6b32f4600d

View File

@@ -4806,12 +4806,11 @@ static int create_addr(struct sip_pvt *dialog, const char *opeer, struct sockadd
/* Get the outbound proxy information */
ref_proxy(dialog, obproxy_get(dialog, NULL));
/* If we have an outbound proxy, don't bother with DNS resolution at all */
if (dialog->outboundproxy)
return 0;
/* This address should be updated using dnsmgr */
if (sin) {
if (dialog->outboundproxy) {
/* If we have an outbound proxy, don't bother with DNS resolution at all, but set the port */
portno = port ? atoi(port) : (dialog->socket.type & SIP_TRANSPORT_TLS) ? STANDARD_TLS_PORT : STANDARD_SIP_PORT;
} else if (sin) {
/* This address should be updated using dnsmgr */
memcpy(&dialog->sa.sin_addr, &sin->sin_addr, sizeof(dialog->sa.sin_addr));
if (!sin->sin_port) {
if (ast_strlen_zero(port) || sscanf(port, "%u", &portno) != 1) {