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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@411927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2014-04-08 14:48:46 +00:00
parent 46cdbe5863
commit 97e034a4d8

View File

@@ -1494,6 +1494,12 @@ static int sip_get_tpselector_from_endpoint(const struct ast_sip_endpoint *endpo
} else if (transport->state->factory) { } else if (transport->state->factory) {
selector->type = PJSIP_TPSELECTOR_LISTENER; selector->type = PJSIP_TPSELECTOR_LISTENER;
selector->u.listener = transport->state->factory; 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 { } else {
return -1; return -1;
} }