My web sockets is working, the connection is established but the server send me a 401 sip code and a 403 sip code (unauthorized then forbidden). I don’t know why because Asterisk 11 support WebSockets and I enabled http server. I’m using FreePBX GUI to configure asterisk file. My password and username are good. Someone can help me ? Thanks !
FreePBX does a lot more than configure Asterisk. It provides a lot of dialplan code, on which its configuration depends. Consequently, you need to ask in a place that understands FreePBX, e.g. https://community.freepbx.org/
I imagine they will require the details of the configuration of your channel driver (chan_pjsip, or possibly chan_sip).
Thank you for your reply ! I asked my question on FreePBX forum without response for the moment.
Now I can see that my res_http_websocket module isn’t on my module list. It faded away for no reason, and when I try to add it, this don’t work. I can’t see it in module list with cli command “module show like http” for example .
with “http show status”, “/ws => Asterisk HTTP WebSocket” is missing in URI’s …
I really need it to enable webRTC, how can I add or activate this module ?
You asked in the developer section, when this appears to be a user question, and you didn’t provide details of your configuration. I notice there is another question about jsSSIP, which might be relevant.
Try manually loading it from the CLI. If that fails, the messages should give clues to the reason. If it succeeds, that suggests that modules.conf isn’t set to load it, or it trying to load it before one of its dependencies.
A module can fail to load because the module is missing (e.g. not built), it was built for the wrong version, it requires configuration and the configuration is missing or invalid, noload was specified, autoload was not specified and it wasn’t explicitly loaded, or was loaded before its dependencies, or one of its dependencies failed to load.
I moved it to Development on auto-pilot since generally anything to do with JsSIP is really developer level. I moved it out to Configuration based on the new information here.
I fixed the problem, I already tried that but it seems that I have to add it with FreePBX GUI. Now I’m returning with the socket problem ahah. I’m trying to read server’s log
I can see here that it don’t recognize ws transport. But, in settings, I add it. Furthermore, I don’t know why it using chan_sip channel and not pjsip_sip channel. My settings are “using both”. What can I have to do more ??
What does this mean? I suspect this is yet another artefact of using FreePBX. Note that only one of chan_sip and chan_pjsip can actually bind to an IP address/socket combination.
You still haven’t provided your configuration (which for this forum is the contents of the .conf files, or, but more difficult to handle, the contents of the ARA database tables.
The module is part of Asterisk, not FreePBX, so it will have no knowledge of the FreePBX GUI. If you are forced to use that GUI, that is because of your general use of FreePBX, and is why you got redirected to the FreePBX forum.
PS Please provide log fragments (and configuration files) as pre-formatted text, copied from, preferably the log file, and failing that, the terminal emulator, not as images of screen content.
Thank you a lot for you answers ! I’m sorry I’m a new user
Do you mean that I have to select one ? chan_pjsip for instance ? On FreePBX GUI there is an option “both”, we can still select chan_sip or chan_pjsip. Now I’m not using FreePBX GUI, I’m on the virtual machine with linux.
pjsip.conf :
[global]
type=global
user_agent=FPBX-14.0.13.23(13.18.4)
default_outbound_endpoint=duma_endpoint
[0.0.0.0-udp]
type=transport
protocol=udp
bind=0.0.0.0:5160
external_media_address=178.33.26.237
external_signaling_address=178.33.26.237
allow_reload=yes
[0.0.0.0-tcp]
type=transport
protocol=tcp
bind=0.0.0.0:5160
external_media_address=178.33.26.237
external_signaling_address=178.33.26.237
allow_reload=yes
[0.0.0.0-tls]
type=transport
protocol=tls
bind=0.0.0.0:5161
external_media_address=178.33.26.237
external_signaling_address=178.33.26.237
allow_reload=yes
[0.0.0.0-ws]
type=transport
protocol=ws
bind=0.0.0.0
external_media_address=178.33.26.237
external_signaling_address=178.33.26.237
allow_reload=yes
[0.0.0.0-wss]
type=transport
protocol=wss
bind=0.0.0.0
external_media_address=178.33.26.237
external_signaling_address=178.33.26.237
allow_reload=yes
[dpma_endpoint]
type=endpoint
context=dpma-invalid
; I added this because I followed the asterisk's auto on setup webrtc, it is a example.
[199]
type=aor
max_contacts=1
remove_existing=yes
[199]
type=auth
auth_type=userpass
username=199
password= 199 ; This is a completely insecure password. Do NOT expose this
; system to the Internet without utilizing a better password.
[199]
type=endpoint
aors=199
auth=199
use_avpf=yes
media_encryption=dtls
dtls_ca_file=/etc/asterisk/keys/ca.crt
dtls_cert_file=/etc/asterisk/keys/asterisk.pem
dtls_verify=fingerprint
dtls_setup=actpass
ice_support=yes
media_use_received_transport=yes
rtcp_mux=yes
context=default
disallow=all
allow=opus
allow=law
That is, is obviously, normally the sensible thing to do, given that they both implement the same protocol, and therefore compete for the same default ports. New installations should normally only use chan_pjsip.
Your sip.conf appears to be missing a section name, and has a lot of baggage from FreePBX, which makes it difficult to see what the significant options are. It is also setting the user agent to say it is FreePBX, which will cause confusion when viewed in logs. It contains some deprecated option names and, I think, it may also contain some bogus parameters, used by FreePBX, but not Asterisk.
allowguest=yes is not generally considered safe; the FreePBX dialplan has specific measures to mitigate that.
I’m not sure whether bind treats IPV4 wildcard and IPV6 wildcard addresses separately, but it looks like both are competing for port 5061.
Given that chan_sip is the one that ended up binding to the TLS port, you need to comply with the requirements in Home - Asterisk Documentation in order to use websockets. You comply with neither of them.