Asterisk 12 can't Dial to WS Peers

Hi, using Asterisk 12 i can’t communicate with peers using the websocket dialing from ws to sip works as expected, dialing from sip to ws can’t locate the peer and dialing from ws to ws is failing too.

Here is the dialplan:

[ Context 'phones' created by 'pbx_config' ] '_15XXX' => 1. Dial(PJSIP/${EXTEN:1}) [pbx_config] 2. Hangup() [pbx_config] '_5XXX' => 1. Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})}) [pbx_config] 2. Hangup() [pbx_config]

The Contact List of the peers:

 pjsip show endpoint 5001
Endpoint 5001:
AOR 5001:
	Contact sip:5001@10.0.1.102:48116;transport=ws;rtcweb-breaker=no:
		available = yes
		RTT = 114700 microseconds

pjsip show endpoint 5000
Endpoint 5000:
AOR 5000:
	Contact sip:5000@10.0.1.110:5063:
		available = yes
		RTT = 414624 microseconds

The result of dialing from SIP to WS

[code] – Executing [5001@phones:1] Dial(“PJSIP/5000-00000002”, “PJSIP/5001/sip:5001@10.0.1.102:48116;transport=ws;rtcweb-breaker=no”) in new stack
[Dec 19 12:28:53] WARNING[3492][C-00000002]: app_dial.c:2423 dial_exec_full: Unable to create channel of type ‘PJSIP’ (cause 3 - No route to destination)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [5001@phones:2] Hangup(“PJSIP/5000-00000002”, “”) in new stack
== Spawn extension (phones, 5001, 2) exited non-zero on ‘PJSIP/5000-00000002’

– Executing [15001@phones:1] Dial(“PJSIP/5000-00000003”, “PJSIP/5001”) in new stack
[Dec 19 12:29:12] WARNING[3493][C-00000003]: app_dial.c:2423 dial_exec_full: Unable to create channel of type ‘PJSIP’ (cause 3 - No route to destination)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [15001@phones:2] Hangup(“PJSIP/5000-00000003”, “”) in new stack
== Spawn extension (phones, 15001, 2) exited non-zero on ‘PJSIP/5000-00000003’
[/code]

The PJSIP debug:

[code]PJSIP Logging enabled
<— Received SIP request (926 bytes) from UDP:10.0.1.110:5063 —>
INVITE sip:5001@10.0.1.102 SIP/2.0
Via: SIP/2.0/UDP 10.0.1.110:5063;branch=z9hG4bK484473620
From: “test” sip:5000@10.0.1.102;tag=1576769793
To: sip:5001@10.0.1.102
Call-ID: 375194722@10.0.1.110
CSeq: 1 INVITE
Contact: sip:5000@10.0.1.110:5063
Content-Type: application/sdp
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
Max-Forwards: 70
User-Agent: Yealink SIP-T20P 9.70.23.2 00:15:65:39:02:92
Supported: replaces,100rel
P-Early-Media: supported
Expires: 360
Allow-Events: talk,hold,conference,refer,check-sync
Content-Length: 302

v=0
o=- 20049 20049 IN IP4 10.0.1.110
s=SDP data
c=IN IP4 10.0.1.110
t=0 0
m=audio 11796 RTP/AVP 0 8 18 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:9 G722/8000
a=fmtp:101 0-15
a=rtpmap:101 telephone-event/8000
a=ptime:20
a=sendrecv

<— Transmitting SIP response (419 bytes) to UDP:10.0.1.110:5063 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.0.1.110:5063;received=10.0.1.110;branch=z9hG4bK484473620
Call-ID: 375194722@10.0.1.110
From: “test” sip:5000@10.0.1.102;tag=1576769793
To: sip:5001@10.0.1.102;tag=z9hG4bK484473620
CSeq: 1 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1387477794/78c54cbbd8af3528f2fb1cb70d78cf1c”,opaque=“4fcb5c3a01b6d877”,algorithm=md5,qop="auth"
Content-Length: 0

<— Received SIP request (255 bytes) from UDP:10.0.1.110:5063 —>
ACK sip:5001@10.0.1.102 SIP/2.0
Via: SIP/2.0/UDP 10.0.1.110:5063;branch=z9hG4bK484473620
From: “test” sip:5000@10.0.1.102;tag=1576769793
To: sip:5001@10.0.1.102;tag=z9hG4bK484473620
Call-ID: 375194722@10.0.1.110
CSeq: 1 ACK
Content-Length: 0

<— Received SIP request (1192 bytes) from UDP:10.0.1.110:5063 —>
INVITE sip:5001@10.0.1.102 SIP/2.0
Via: SIP/2.0/UDP 10.0.1.110:5063;branch=z9hG4bK388011450
From: “test” sip:5000@10.0.1.102;tag=1576769793
To: sip:5001@10.0.1.102
Call-ID: 375194722@10.0.1.110
CSeq: 2 INVITE
Contact: sip:5000@10.0.1.110:5063
Authorization: Digest username=“5000”, realm=“asterisk”, nonce=“1387477794/78c54cbbd8af3528f2fb1cb70d78cf1c”, uri="sip:5001@10.0.1.102", response=“ee80bdc04900a490555fa91c3b79abba”, algorithm=MD5, cnonce=“0a4f113b”, opaque=“4fcb5c3a01b6d877”, qop=auth, nc=00000001
Content-Type: application/sdp
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
Max-Forwards: 70
User-Agent: Yealink SIP-T20P 9.70.23.2 00:15:65:39:02:92
Supported: replaces,100rel
P-Early-Media: supported
Expires: 360
Allow-Events: talk,hold,conference,refer,check-sync
Content-Length: 302

v=0
o=- 20049 20049 IN IP4 10.0.1.110
s=SDP data
c=IN IP4 10.0.1.110
t=0 0
m=audio 11796 RTP/AVP 0 8 18 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:9 G722/8000
a=fmtp:101 0-15
a=rtpmap:101 telephone-event/8000
a=ptime:20
a=sendrecv

<— Transmitting SIP response (245 bytes) to UDP:10.0.1.110:5063 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.0.1.110:5063;received=10.0.1.110;branch=z9hG4bK388011450
Call-ID: 375194722@10.0.1.110
From: “test” sip:5000@10.0.1.102;tag=1576769793
To: sip:5001@10.0.1.102
CSeq: 2 INVITE
Content-Length: 0

<— Received SIP request (1192 bytes) from UDP:10.0.1.110:5063 —>
INVITE sip:5001@10.0.1.102 SIP/2.0
Via: SIP/2.0/UDP 10.0.1.110:5063;branch=z9hG4bK388011450
From: “test” sip:5000@10.0.1.102;tag=1576769793
To: sip:5001@10.0.1.102
Call-ID: 375194722@10.0.1.110
CSeq: 2 INVITE
Contact: sip:5000@10.0.1.110:5063
Authorization: Digest username=“5000”, realm=“asterisk”, nonce=“1387477794/78c54cbbd8af3528f2fb1cb70d78cf1c”, uri="sip:5001@10.0.1.102", response=“ee80bdc04900a490555fa91c3b79abba”, algorithm=MD5, cnonce=“0a4f113b”, opaque=“4fcb5c3a01b6d877”, qop=auth, nc=00000001
Content-Type: application/sdp
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
Max-Forwards: 70
User-Agent: Yealink SIP-T20P 9.70.23.2 00:15:65:39:02:92
Supported: replaces,100rel
P-Early-Media: supported
Expires: 360
Allow-Events: talk,hold,conference,refer,check-sync
Content-Length: 302

v=0
o=- 20049 20049 IN IP4 10.0.1.110
s=SDP data
c=IN IP4 10.0.1.110
t=0 0
m=audio 11796 RTP/AVP 0 8 18 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:9 G722/8000
a=fmtp:101 0-15
a=rtpmap:101 telephone-event/8000
a=ptime:20
a=sendrecv

-- Executing [5001@phones:1] Dial("PJSIP/5000-00000004", "PJSIP/5001/sip:5001@10.0.1.102:48116;transport=ws;rtcweb-breaker=no") in new stack

<— Transmitting SIP response (245 bytes) to UDP:10.0.1.110:5063 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.0.1.110:5063;received=10.0.1.110;branch=z9hG4bK388011450
Call-ID: 375194722@10.0.1.110
From: “test” sip:5000@10.0.1.102;tag=1576769793
To: sip:5001@10.0.1.102
CSeq: 2 INVITE
Content-Length: 0

[Dec 19 12:29:55] WARNING[3503][C-00000004]: app_dial.c:2423 dial_exec_full: Unable to create channel of type ‘PJSIP’ (cause 3 - No route to destination)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [5001@phones:2] Hangup(“PJSIP/5000-00000004”, “”) in new stack
== Spawn extension (phones, 5001, 2) exited non-zero on ‘PJSIP/5000-00000004’
<— Transmitting SIP response (312 bytes) to UDP:10.0.1.110:5063 —>
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 10.0.1.110:5063;received=10.0.1.110;branch=z9hG4bK388011450
Call-ID: 375194722@10.0.1.110
From: “test” sip:5000@10.0.1.102;tag=1576769793
To: sip:5001@10.0.1.102;tag=a3b1b278-f170-45e0-9303-c32f561156e3
CSeq: 2 INVITE
Reason: Q.850;cause=3
Content-Length: 0

<— Received SIP request (275 bytes) from UDP:10.0.1.110:5063 —>
ACK sip:5001@10.0.1.102 SIP/2.0
Via: SIP/2.0/UDP 10.0.1.110:5063;branch=z9hG4bK388011450
From: “test” sip:5000@10.0.1.102;tag=1576769793
To: sip:5001@10.0.1.102;tag=a3b1b278-f170-45e0-9303-c32f561156e3
Call-ID: 375194722@10.0.1.110
CSeq: 2 ACK
Content-Length: 0

Airo-Shaka*CLI> pjsip set logger off
PJSIP Logging disabled
[/code]

Best Regards.

Updated to the stable version of Asterisk 12 and persist the issue.

WS Peer settings:

pjsip show endpoint 5001

 <Endpoint/CID................................................>  <State.....>  <Channels.>
    I/OAuth:  <AuthId/UserName...........................................................>
        Aor:  <Aor............................................>  <MaxContact>
      Contact:  <Aor/ContactUri...............................>  <Status....>  <RTT(ms)..>
    Channel:  <ChannelId......................................>  <State.....>  <Time(sec)>
        Codec:  <Codec>  Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
 =========================================================================================

 5001/5001                                                       Not in use    0 of inf
     InAuth:  5001/5001
        Aor:  5001                                              10
      Contact:  5001/sip:5001@10.0.1.102:59397;transport=ws;rtc  Avail             153.837

 ParameterName                 : ParameterValue
 ====================================================
 100rel                        : yes
 aggregate_mwi                 : false
 allow                         : (ulaw|vp8)
 allow_subscribe               : true
 allow_transfer                : true
 aors                          : 5001
 auth                          : 5001
 call_group                    : 
 callerid                      : "WRTC" <5001>
 callerid_privacy              : allowed_not_screened
 callerid_tag                  : 
 connected_line_method         : invite
 context                       : phones
 cos_audio                     : 0
 cos_video                     : 0
 device_state_busy_at          : 0
 direct_media                  : false
 direct_media_glare_mitigation : none
 direct_media_method           : invite
 disable_direct_media_on_nat   : false
 disallow                      : (ulaw|vp8)
 dtls_ca_file                  : 
 dtls_ca_path                  : 
 dtls_cert_file                : 
 dtls_cipher                   : 
 dtls_private_key              : 
 dtls_rekey                    : 0
 dtls_setup                    : active
 dtls_verify                   : No
 dtmf_mode                     : rfc4733
 fax_detect                    : false
 force_rport                   : false
 from_domain                   : 
 from_user                     : 
 ice_support                   : true
 identify_by                   : username
 inband_progress               : false
 language                      : es
 mailboxes                     : 5001@default
 media_address                 : 
 media_encryption              : sdes
 moh_suggest                   : default
 mwi_from_user                 : 
 named_call_group              : 
 named_pickup_group            : 
 one_touch_recording           : true
 outbound_auth                 : 
 outbound_proxy                : 
 pickup_group                  : 
 record_off_feature            : automixmon
 record_on_feature             : mixmonitor
 rewrite_contact               : false
 rtp_engine                    : asterisk
 rtp_ipv6                      : false
 rtp_symmetric                 : false
 sdp_owner                     : -
 sdp_session                   : Asterisk
 send_diversion                : false
 send_pai                      : false
 send_rpid                     : false
 srtp_tag_32                   : false
 sub_min_expiry                : 0
 t38_udptl                     : false
 t38_udptl_ec                  : none
 t38_udptl_ipv6                : false
 t38_udptl_maxdatagram         : 0
 t38_udptl_nat                 : false
 timers                        : no
 timers_min_se                 : 90
 timers_sess_expires           : 1800
 tone_zone                     : 
 tos_audio                     : 0
 tos_video                     : 0
 transport                     : transport-ws
 trust_id_inbound              : false
 trust_id_outbound             : false
 use_avpf                      : true
 use_ptime                     : false 

CLI output:

-- Executing [5001@phones:1] Dial("PJSIP/5000-00000001", "PJSIP/5001/sip:5001@10.0.1.102:59397;transport=ws;rtcweb-breaker=no") in new stack [Dec 20 18:42:59] WARNING[2291][C-00000001]: app_dial.c:2425 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination) == Everyone is busy/congested at this time (1:0/0/1) -- Executing [5001@phones:2] Hangup("PJSIP/5000-00000001", "") in new stack == Spawn extension (phones, 5001, 2) exited non-zero on 'PJSIP/5000-00000001'

I’m not familiar with the web sockets support, but the error is “no route to destination” which either means that the host OS doesn’t know how to send to 10.0.1.102, or there is a syntax error causing the wrong address to be parsed from the string.

(I suppose web sockets could involve using a proxy that is off your network, as well.)

If I removed my transport for the peer then it can be reached, but then it can’t dial out so I guess something is wrong with the transport that I have made.