[asterisk-commits] file: branch 12 r411927 - /branches/12/res/res_pjsip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 8 09:48:52 CDT 2014


Author: file
Date: Tue Apr  8 09:48:46 2014
New Revision: 411927

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=411927
Log:
res_pjsip: Ignore explicit transport configuration if a WebSocket transport is specified.

This change makes it so if a transport is configured on an endpoint that is a WebSocket
type the option will be ignored. In practice this is fine because the WebSocket
transport can not create outgoing connections, it can only reuse existing ones. By
ignoring the option the existing PJSIP logic for using the existing connection will
be invoked and stuff will proceed.

(closes issue ASTERISK-23584)
Reported by: Rusty Newton

Modified:
    branches/12/res/res_pjsip.c

Modified: branches/12/res/res_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip.c?view=diff&rev=411927&r1=411926&r2=411927
==============================================================================
--- branches/12/res/res_pjsip.c (original)
+++ branches/12/res/res_pjsip.c Tue Apr  8 09:48:46 2014
@@ -1494,6 +1494,12 @@
 	} else if (transport->state->factory) {
 		selector->type = PJSIP_TPSELECTOR_LISTENER;
 		selector->u.listener = transport->state->factory;
+	} else if (transport->type == AST_TRANSPORT_WS || transport->type == AST_TRANSPORT_WSS) {
+		/* The WebSocket transport has no factory as it can not create outgoing connections, so
+		 * even if an endpoint is locked to a WebSocket transport we let the PJSIP logic
+		 * find the existing connection if available and use it.
+		 */
+		return 0;
 	} else {
 		return -1;
 	}




More information about the asterisk-commits mailing list