Skip to content
Snippets Groups Projects
Commit 75dba8ca authored by Joshua Colp's avatar Joshua Colp
Browse files

Fix a bug where using an outbound proxy would cause the local address to be 127.0.0.1.

Copy the outbound proxy IP address into the SIP dialog structure as the IP address we will
be sending to. This has to be done because the logic that determines what local IP address to use
in the SIP messages is not aware of an outbound proxy being in place. It only knows what IP address
we are sending to.

(closes issue #12006)
Reported by: mnicholson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@188067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent b6a2f407
No related branches found
No related tags found
No related merge requests found
......@@ -5005,6 +5005,7 @@ static int create_addr(struct sip_pvt *dialog, const char *opeer, struct sockadd
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;
memcpy(&dialog->sa.sin_addr, &dialog->outboundproxy->ip.sin_addr, sizeof(dialog->sa.sin_addr));
} else if (sin) {
/* This address should be updated using dnsmgr */
memcpy(&dialog->sa.sin_addr, &sin->sin_addr, sizeof(dialog->sa.sin_addr));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment