summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2014-04-08 14:49:47 +0000
committerJoshua Colp <jcolp@digium.com>2014-04-08 14:49:47 +0000
commit909f8350668ded7b7afedaf998fccc596c0fd1a4 (patch)
treef66bf523129f641fa37a12a2a109ce07a0d3056d
parent607c6e9772e0bcb1537edc7cf9cad22e1ca73fa8 (diff)
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
-rw-r--r--res/res_pjsip.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 3ff60ee5b..0cf162a22 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;
}