Make sure we set the socket port, so we don't try to use <ip address>:0.

(closes issue #13255)
Reported by: falves11
Patches:
      13255-socketport.diff uploaded by qwell (license 4)
Tested by: falves11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.2
Jason Parker 17 years ago
parent 297ebf779f
commit 3bcc8510b3

@ -4343,7 +4343,7 @@ static int create_addr(struct sip_pvt *dialog, const char *opeer, struct sockadd
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) {
portno = dialog->socket.type & SIP_TRANSPORT_TLS ?
portno = (dialog->socket.type & SIP_TRANSPORT_TLS) ?
STANDARD_TLS_PORT : STANDARD_SIP_PORT;
}
} else {
@ -4380,6 +4380,8 @@ static int create_addr(struct sip_pvt *dialog, const char *opeer, struct sockadd
if (!dialog->socket.type)
dialog->socket.type = SIP_TRANSPORT_UDP;
if (!dialog->socket.port)
dialog->socket.port = bindaddr.sin_port;
dialog->sa.sin_port = htons(portno);
dialog->recv = dialog->sa;
return 0;

Loading…
Cancel
Save