From: Joshua Colp Date: Tue, 8 Apr 2014 14:49:47 +0000 (+0000) Subject: res_pjsip: Ignore explicit transport configuration if a WebSocket transport is specified. X-Git-Tag: 13.0.0-beta1~371 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=909f8350668ded7b7afedaf998fccc596c0fd1a4;p=thirdparty%2Fasterisk.git 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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411928 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_pjsip.c b/res/res_pjsip.c index 3ff60ee5b4..0cf162a225 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -1494,6 +1494,12 @@ static int sip_get_tpselector_from_endpoint(const struct ast_sip_endpoint *endpo } 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; }