[Home]

Summary:ASTERISK-24106: WebSockets Automatically decides what driver it will use
Reporter:Andrew Nagy (tm1000)Labels:
Date Opened:2014-07-23 12:35:15Date Closed:2015-11-03 08:17:35.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_http_websocket Resources/res_pjsip_transport_websocket
Versions:12.4.0 13.6.0 Frequency of
Occurrence
Constant
Related
Issues:
duplicatesASTERISK-24777 chan_sip and chan_pjsip cannot coexist when using websocket transport
is duplicated byASTERISK-24725 WebSockets uses first loaded SIP module(chan_sip, pjsip) as SIP provider for WebRTC
Environment:Attachments:( 0) chan_sip-websocket-disable.patch
Description:When using WebSockets in Asterisk 12, Asterisk itself randomly decided what driver will manage the websockets protocol if both chan_sip and pjsip are loaded at the same time. This means it's a random draw for a system as to what driver is actually being used.

It would be nice to be able to use both, either through a different url (as opposed to just ws) or through a flag or another option.

Right now I have to check the CLI to see is module "res_pjsip_transport_websocket" is loaded and is running, if it's not running then I blindly assume that chan_sip is in control of the websocket port.

This was discussed at length in #asterisk-dev so I am attaching the log here:

{code}
tm1000: file: one last question about webrtc I swear, just trying to figure out a good way to determine if pjsip or chan_sip is controlling the websocket. The best way I can think of is to run: module show like res_pjsip_transport_websocket, and see if the use count is above 0 and status is Running
[09:31am] file: that should work
[09:32am] tm1000: k
[09:32am] • file ponders
[09:32am] file: we could make the pjsip one use a different URL, actually
[09:36am] mjordan: file: if it were configurable on the transport, that would be a "good thing"
[09:37am] tm1000: mjordan: I strongly agree
[09:37am] tm1000: however I wasnt going to push anything since 12 is feature locked
[09:38am] tm1000: file: different url, different something, but the guessing is kind of painful to be honest
[09:38am] file: it should be... possible
[09:38am] mjordan: well.... (a) it doesn't mean it should be done. (b) interoperability concerns are still problematic. Running chan_sip + chan_pjsip together is sort of what we were trying to ensure with this, and this feels like a bug (that is, you can't split apart the two on websockets easily)
[09:39am] mjordan: s/it should be done/it shouldn't be done
[09:39am] tm1000: mjordan: Yeah its confusing in my land since I run both at the same time and I have to guess through the CLI which device to write out (think auto creating webrtc devices)
[09:47am] tm1000: mjordan: because really if I have both chan_sip and pjsip enabled and I go and create a webrtc device on pjsip it wont work and how am I suppose to know that? (as an end user) if chan sip is taking control
[09:48am] mjordan: rationalization!
[09:48am] file: sleepy
[09:48am] mjordan: tm1000: mind opening an issue for it?
[09:54am] tm1000: mjordan: sure how would I word it? like how I put it above?
[09:54am] mjordan: yup
{code}
Comments:By: Aleksei Kulakov (Each) 2015-02-02 10:06:48.937-0600

Workaround:

{code}
[modules]
autoload=yes
preload => res_sorcery_astdb.so
preload => res_sorcery_memory.so
preload => res_sorcery_config.so

preload => res_http_websocket.so

preload => res_pjsip.so
preload => res_pjsip_outbound_publish.so
preload => res_pjsip_pubsub.so
preload => res_pjsip_session.so
preload => res_pjsip_transport_websocket.so

;... remaining contents of default modules.conf
{code}

By: Corey Farrell (coreyfarrell) 2015-06-20 12:02:07.731-0500

This patch adds "websocket_enabled" setting to sip.conf.  I realize it would be nice to support websockets for both at the same time, but in the short term this should ensure that chan_sip can be configured to not conflict with res_pjsip_transport_websocket.  chan_sip websockets default to enabled since that is the current behavior.

The patch has not been tested (beyond compile).  If someone experiencing this issue can test and report back I can post to gerrit for review.

By: Marek Cervenka (cervajs) 2015-08-27 06:44:49.975-0500

patch tested. works ok. thanks

By: Corey Farrell (coreyfarrell) 2015-11-03 08:02:25.644-0600

The option to disable chan_sip websockets is now posted to gerrit for 13 and master.