[asterisk-commits] qwell: branch qwell/fun_with_transports r388215 - /team/qwell/fun_with_transp...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 9 14:30:34 CDT 2013


Author: qwell
Date: Thu May  9 14:30:32 2013
New Revision: 388215

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388215
Log:
Only try to lookup if WebSocket transport is used.

Modified:
    team/qwell/fun_with_transports/res/res_sip_transport_websocket.c

Modified: team/qwell/fun_with_transports/res/res_sip_transport_websocket.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/res/res_sip_transport_websocket.c?view=diff&rev=388215&r1=388214&r2=388215
==============================================================================
--- team/qwell/fun_with_transports/res/res_sip_transport_websocket.c (original)
+++ team/qwell/fun_with_transports/res/res_sip_transport_websocket.c Thu May  9 14:30:32 2013
@@ -278,7 +278,13 @@
 	RAII_VAR(struct ast_sip_contact_transport *, ct, NULL, ao2_cleanup);
 	pjsip_tpselector selector = { .type = PJSIP_TPSELECTOR_TRANSPORT, };
 
-	pjsip_uri_print(PJSIP_URI_IN_REQ_URI, tdata->msg->line.req.uri, contact_uri, sizeof(contact_uri));
+	const pjsip_sip_uri *request_uri = pjsip_uri_get_uri(tdata->msg->line.req.uri);
+
+	if (strcasecmp(request_uri->transport_param.ptr, "WS") && strcasecmp(request_uri->transport_param.ptr, "WSS")) {
+		return;
+	}
+
+	pjsip_uri_print(PJSIP_URI_IN_REQ_URI, request_uri, contact_uri, sizeof(contact_uri));
 
 	if (!(ct = ast_sip_location_retrieve_contact_transport_by_uri(contact_uri))) {
 		return;




More information about the asterisk-commits mailing list