Unable to load module res_pjsip_transport_websocket.so

I am using Ubuntu 17.10.
I am trying to create call between web browser and asterisk user logged in zoiper. To enable call between browser and other asterisk user I need to take the help of SIPML5 and asterisk. For this I have installed asterisk 13.22.0 and I am following instructions of the WebRTC+tutorial+using+SIPML5

I have manually loaded codec_opus.so using help from http://asterisktutorials.blogspot.com/2017/08/how-to-install-and-use-opus-codec-in.html

The output of # asterisk -rx “module show like websocket”
Module Description Use Count Status Support Level res_http_websocket.so HTTP WebSocket Support 2 Running extended 1 modules loaded

As only 1 module is I tried to load the module res_pjsip_transport_websocket.so
I got an error saying that

Unable to unload resource res_pjsip_transport_websocket.so
Command ‘module unload res_pjsip_transport_websocket.so’ failed.

Checking the link Unable to load/run res_pjsip_transport_websocket.so

I have unloaded chan_sip.so and tried to load res_pjsip_transport_websocket.so
but it still gives me the same error.

How can I load the res_pjsip_transport_websocket.so ? or else is it not necessary ?

It is necessary in order to use PJSIP websocket support. Are you using PJSIP? Have you built Asterisk with support for it?

Made a small modification for your better understanding. Please check.

I am not much aware of asterisk. I just following the steps given in wiki asterisk. By searching I found is that I need to create an asterisk user which have the transport= ws and listen to port 8089.

Though I could create users, when I tried to register the user fails from registering.

You absolutely must have more than a minimal understanding of Asterisk if you are hoping to use WebRTC in the browser at all. You must also have more than a minimal understanding of VoIP in general. WebRTC is not for beginners. It won’t work all the time and you have to be able to figure out what is going on.

Are you using chan_sip already? It has WebRTC support.

Primarily I am trying to get the output similar to

asterisk -rx “module show like websocket”

Module Description Use Count Status Support Level
res_http_websocket.so HTTP WebSocket Support 3 Running extended
res_pjsip_transport_websocket.so PJSIP WebSocket Transport Support 0 Running core
2 modules loaded

but the output is

asterisk -rx “module show like websocket”

Module Description Use Count Status Support Level
res_http_websocket.so HTTP WebSocket Support 3 Running extended
1 modules loaded

If you really want to use PJSIP then your Asterisk has to be built with it, there is a blog post[1] which shows the easiest method.

[1] https://blogs.asterisk.org/2016/03/16/asterisk-13-8-0-now-easier-pjsip-install-method/

I just have the basics of installing and creating a user of my own alone. A little forward, I created a user 199 and 200 where transport = udp and port is 5060. I used two zoiper and could make call between 199 and 200. As a next step, I want to create a user 201 where transport = ws and port is 8089, so that using the link http://www.doubango.org/sipml5/call.htm?svn=252# I could establish call between the browser and the zoiper 199/200.

For this purpose I started to follow wiki WebRTC+tutorial+using+SIPML5 and above mentioned things in comment 1.

As I could make call 199 to 200 , I could say I have been sucessfully using chan_sip.

Then for what reason are you wanting to use PJSIP instead? It’s not necessary if you have it working with chan_sip and it’s not necessary to use opus. You just need to enable opus as an allowed codec in the sip.conf configuration.