[asterisk-commits] file: trunk r411928 - in /trunk: ./ res/res_pjsip.c

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


Author: file
Date: Tue Apr  8 09:49:47 2014
New Revision: 411928

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=411928
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
........

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

Modified:
    trunk/   (props changed)
    trunk/res/res_pjsip.c

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

Modified: trunk/res/res_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip.c?view=diff&rev=411928&r1=411927&r2=411928
==============================================================================
--- trunk/res/res_pjsip.c (original)
+++ trunk/res/res_pjsip.c Tue Apr  8 09:49:47 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