Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Commit

Permalink
res_pjsip: Ignore explicit transport configuration if a WebSocket tra…
Browse files Browse the repository at this point in the history
…nsport 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: http://svn.asterisk.org/svn/asterisk/trunk@411928 f38db490-d61c-443f-a65b-d21fe96a405b
  • Loading branch information
jcolp committed Apr 8, 2014
1 parent 57a2bae commit 78a1e5f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions res/res_pjsip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 78a1e5f

Please sign in to comment.