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

Fix a network byte order issue and ensure when creating an outgoing dialog...

Fix a network byte order issue and ensure when creating an outgoing dialog that the socket always contains information such as type and port.
(closes issue #11916)
Reported by: mnnojd


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 3d3852f1
Branches
Tags
No related merge requests found
...@@ -3942,6 +3942,10 @@ static int create_addr(struct sip_pvt *dialog, const char *opeer) ...@@ -3942,6 +3942,10 @@ static int create_addr(struct sip_pvt *dialog, const char *opeer)
int res = create_addr_from_peer(dialog, peer); int res = create_addr_from_peer(dialog, peer);
unref_peer(peer); unref_peer(peer);
return res; return res;
} else {
/* Setup default parameters for this dialog's socket. Currently we only support regular UDP SIP as the default */
dialog->socket.type = SIP_TRANSPORT_UDP;
dialog->socket.port = bindaddr.sin_port;
} }
   
ast_string_field_set(dialog, tohost, peername); ast_string_field_set(dialog, tohost, peername);
...@@ -17904,9 +17908,9 @@ static int handle_request_do(struct sip_request *req, struct sockaddr_in *sin) ...@@ -17904,9 +17908,9 @@ static int handle_request_do(struct sip_request *req, struct sockaddr_in *sin)
static int sip_standard_port(struct sip_socket s) static int sip_standard_port(struct sip_socket s)
{ {
if (s.type & SIP_TRANSPORT_TLS) if (s.type & SIP_TRANSPORT_TLS)
return s.port == STANDARD_TLS_PORT; return s.port == htons(STANDARD_TLS_PORT);
else else
return s.port == STANDARD_SIP_PORT; return s.port == htons(STANDARD_SIP_PORT);
} }
   
/*! \todo document this function. */ /*! \todo document this function. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment