[svn-commits] file: branch 13 r421932 - in /branches/13: ./ res/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Aug 24 13:53:09 CDT 2014


Author: file
Date: Sun Aug 24 13:53:06 2014
New Revision: 421932

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=421932
Log:
res_pjsip_transport_websocket: Ensure secure Websocket clients can be called.

This change enforces the transport in the Contact header for Websocket clients.
Previously a client may provide a transport of 'ws' when it is actually using
a transport of 'wss'. This would cause outgoing calls to fail as the existing
connection could not be found.
........

Merged revisions 421931 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    branches/13/   (props changed)
    branches/13/res/res_pjsip_transport_websocket.c

Propchange: branches/13/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: branches/13/res/res_pjsip_transport_websocket.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/res_pjsip_transport_websocket.c?view=diff&rev=421932&r1=421931&r2=421932
==============================================================================
--- branches/13/res/res_pjsip_transport_websocket.c (original)
+++ branches/13/res/res_pjsip_transport_websocket.c Sun Aug 24 13:53:06 2014
@@ -300,6 +300,8 @@
  */
 static pj_bool_t websocket_on_rx_msg(pjsip_rx_data *rdata)
 {
+	static const pj_str_t STR_WS = { "ws", 2 };
+	static const pj_str_t STR_WSS = { "wss", 3 };
 	pjsip_contact_hdr *contact;
 
 	long type = rdata->tp_info.transport->key.type;
@@ -314,6 +316,7 @@
 
 		pj_cstr(&uri->host, rdata->pkt_info.src_name);
 		uri->port = rdata->pkt_info.src_port;
+		pj_strdup(rdata->tp_info.pool, &uri->transport_param, (type == (long)transport_type_ws) ? &STR_WS : &STR_WSS);
 	}
 
 	rdata->msg_info.via->rport_param = 0;




More information about the svn-commits mailing list