WebRC Phone Session failed, session Terminated

Hi. I have problem with WebRC Phone maybe some one can help me, I check multiple posts but i can’t run WebRC Phone. I even prepare fresh clean test installation from STABLE SNG7-PBX-64bit-2104-1 ISO.
I performed the following steps

  1. Install
  2. Update modules and update system. PBX Version:15.0.17.43 , PBX Distro:12.7.8-2107-3.sng7 , Asterisk Version: 16.17.0
  3. In Certificate Management add Let’s Encrypt certificate, and check it as default.
  4. In System Admin , HTTPS Setup, settings In staled Let’s Encrypt Certificate, and all next steps i perform using https
  5. Create Extension , One with legacy chain sip , and one chain pjsip
  6. In User Manager for bot extensions , in UCP tab i enable Allow Login and Enable Phone
  7. Connect to UCP using https for both extension i got phone registered but when i try make a call, even to *43 (echo test) in browser console i got Session failed, and session Terminated, and nothing happen.

In Advanced settings i check enable TLS for mini http and enable tls for nodeJS, to be shure i check using nmap if ports are open, and everything looks ok, but WebRC phone doesn’t work.

Get asterisk logs including pjsip debug logging.

after enable debuging in pjsip, in /var/log/asterisk/full i got:
[2021-07-09 14:33:54] VERBOSE[30212] res_http_websocket.c: WebSocket connection from ‘10.10.3.138:1074’ for protocol ‘sip’ accepted using version ‘13’
[2021-07-09 14:33:54] VERBOSE[30212] chan_sip.c: Registered SIP ‘991234’ at 10.10.3.138:1074
after page load, but there is any new entry when i try make a call.

Webrtc should be using pjsip but yours is using Chan-sip. That’s weird; you should have pjsip listening on wss. You can adjust this is Asterisk SIP Settings.

Under settings -> asteris sip settings -> chan_pjsip i select yes under WS and WSS (they were on NO by default), and i restart whole server. After that i select no under UCP->phone tab in user manager, delete device (99XXXX) under URL config.php?display=devices because type was SIP, and again select yes under UCP->phone tab in user manager. The new device is of type SIP again. And in log i have this same entry’s, and phone in ucp behaves the same, session filed, session terminated.
I don’t find any other settings related to WS and WSS

There is a setting in Advanced Settings for websocket mode; check that too. (pjsip)

You’re right but after change Display Readonly Settings and Override Readonly Settings to Yes.
I change that setting Force WebSocket Mode from auto to pjsip, disable UCP->Phone in user manager, restart server, enable UCP -> phone. Now in config.php?display=devices device has pjsip type.
No when i disconect and connect phone in /var/log/asterisk/full i got :
[2021-07-12 14:48:39] VERBOSE[22074] res_pjsip_logger.c: <— Received SIP request (825 bytes) from WSS:10.10.3.138:1024 —>
REGISTER sip:t…r.com SIP/2.0
Via: SIP/2.0/WSS gev42hcfp6fi.invalid;branch=z9hG4bK99903
Max-Forwards: 70
To: sip:991234@t…r.com
From: sip:991234@t…r.com;tag=e3a6qimiec
Call-ID: s52tp56r86gp9820hhfgie
CSeq: 87 REGISTER
Authorization: Digest algorithm=MD5, username=“991234”, realm=“asterisk”, nonce=“1626101309/c70021d4d583eab4762ef74e3e776f02”, uri=“sip:t…r.com”, response=“b2f7ec7625260931c067782b2fa8acec”, opaque=“5ca677ac46b1d3ca”, qop=auth, cnonce=“928488q7fcrv”, nc=00000001
Contact: sip:[email protected];transport=wss;reg-id=1;+sip.instance=“urn:uuid:c7f3f4fb-8ccd-4031-8716-4aab82f4d56b”;expires=600
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: path, gruu, outbound
User-Agent: SIP.js/0.7.7
Content-Length: 0

[2021-07-12 14:48:39] VERBOSE[22074] res_pjsip_registrar.c: Added contact ‘sip:[email protected]:1024;transport=ws’ to AOR ‘991234’ with expiration of 600 seconds
[2021-07-12 14:48:39] VERBOSE[22074] res_pjsip_logger.c: <— Transmitting SIP response (427 bytes) to WSS:10.10.3.138:1024 —>
SIP/2.0 200 OK
Via: SIP/2.0/WSS gev42hcfp6fi.invalid;rport=1024;received=10.10.3.138;branch=z9hG4bK99903
Call-ID: s52tp56r86gp9820hhfgie
From: sip:991234@t…r.com;tag=e3a6qimiec
To: sip:991234@t…r.com;tag=z9hG4bK99903
CSeq: 87 REGISTER
Date: Mon, 12 Jul 2021 14:48:39 GMT
Contact: sip:[email protected]:1024;transport=ws;expires=599
Server: FPBX-15.0.17.43(16.17.0)
Content-Length: 0

[2021-07-12 14:48:39] VERBOSE[22074] res_pjsip_logger.c: <— Transmitting SIP request (483 bytes) to WSS:10.10.3.138:1024 —>
OPTIONS sip:[email protected]:1024;transport=ws SIP/2.0
Via: SIP/2.0/WSS 10.1.15.57:8089;rport;branch=z9hG4bKPj0db80b30-b9fe-4454-b380-60fe2c9da250;alias
From: sip:[email protected];tag=5a391670-c3ee-40ea-947b-40ef590f1757
To: sip:[email protected]
Contact: sip:[email protected]:5060;transport=ws
Call-ID: d3f94cb1-1931-4ee7-b206-d8992d47b3af
CSeq: 42296 OPTIONS
Max-Forwards: 70
User-Agent: FPBX-15.0.17.43(16.17.0)
Content-Length: 0

[2021-07-12 14:48:39] VERBOSE[22074] res_pjsip_logger.c: <— Transmitting SIP request (694 bytes) to WSS:10.10.3.138:1024 —>
NOTIFY sip:[email protected]:1024;transport=ws SIP/2.0
Via: SIP/2.0/WSS 10.1.15.57:8089;rport;branch=z9hG4bKPjcdaecdbc-8439-43c8-8b30-92297be0cf0d;alias
From: sip:[email protected];tag=b380fd23-52bb-4b86-83f2-c3ac6475fc73
To: sip:[email protected]
Contact: sip:[email protected]:5060;transport=ws
Call-ID: bc405005-623b-487e-a984-87569de6e26f
CSeq: 50174 NOTIFY
Subscription-State: terminated
Event: message-summary
Allow-Events: presence, dialog, message-summary, refer
Max-Forwards: 70
User-Agent: FPBX-15.0.17.43(16.17.0)
Content-Type: application/simple-message-summary
Content-Length: 48

Messages-Waiting: no
Voice-Message: 0/0 (0/0)

[2021-07-12 14:48:39] VERBOSE[22074] res_pjsip_logger.c: <— Received SIP response (493 bytes) from WSS:10.10.3.138:1024 —>
SIP/2.0 200 OK
Via: SIP/2.0/WSS 10.1.15.57:8089;rport;branch=z9hG4bKPj0db80b30-b9fe-4454-b380-60fe2c9da250;alias
To: sip:[email protected];tag=53q0ffqfu1
From: sip:[email protected];tag=5a391670-c3ee-40ea-947b-40ef590f1757
Call-ID: d3f94cb1-1931-4ee7-b206-d8992d47b3af
CSeq: 42296 OPTIONS
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Accept: application/sdp,application/dtmf-relay
Supported: outbound
User-Agent: SIP.js/0.7.7
Content-Length: 0

[2021-07-12 14:48:39] VERBOSE[22074] res_pjsip/pjsip_configuration.c: Endpoint 991234 is now Reachable
[2021-07-12 14:48:39] VERBOSE[22074] res_pjsip/pjsip_options.c: Contact 991234/sip:[email protected]:1024;transport=ws is now Reachable. RTT: 21.973 msec
[2021-07-12 14:48:39] VERBOSE[22074] res_pjsip_logger.c: <— Received SIP response (405 bytes) from WSS:10.10.3.138:1024 —>
SIP/2.0 481 Subscription does not exist
Via: SIP/2.0/WSS 10.1.15.57:8089;rport;branch=z9hG4bKPjcdaecdbc-8439-43c8-8b30-92297be0cf0d;alias
To: sip:[email protected];tag=om1990bn36
From: sip:[email protected];tag=b380fd23-52bb-4b86-83f2-c3ac6475fc73
Call-ID: bc405005-623b-487e-a984-87569de6e26f
CSeq: 50174 NOTIFY
Supported: outbound
User-Agent: SIP.js/0.7.7
Content-Length: 0

In browser i got engine unregisterd (after discionnect), enginer registed (after connect)

But when i try dail any number (other extension , *43), nothing new appears in log, and in browser i got session failed, session terminated and nothing happen.

It looks like you might be connecting to your server by IP address. You should connect using the name you got for the Let’s Encrypt certificate. I’m not sure that’s the main issue here but webrtc is concerned with security so connections/names/certificates have to match up.

ws:// can use ip addresses but wss:// needs a cert and any self signed cert will be less and less likely accepted by any client, your logs show both transports, I would suggest you solidify and only use wss://

I connect to server using https and proper public domain name, with lets encrypt certificate.
looks like some setting in freepbx override domain name to IP. All settings except mention in this post are default, It is clean installation to test WebRC phone.

I review the log file which i sent before and where you see any indication that i connect to UCP by IP ?
t…r.com <- it is domain name on which I connect to UCP with https, and for that domain name i have Letes Encrypt certificate.
freepbx.sangoma.local <- I don’t know where this address came from
10.10.3.138 <- this is my (client) IP address from which I am connecting to UCP

OK, that’s probably not an issue then. Do you have logs from the browser console? In Firefox, it’s Tools - Browser Tools - Browser Console, looks like this if you are not familiar:

I have only session failed, session terminated, no errors.

Any idea what’s wrong ? If its help i can prepare teamviewer for remote session

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.