Hi,
I try to register webrtc client with identify set to header but it doesn’t work. Here is my pjsip.conf.
(Asterisk 13.21.1)
; *******************************************
; SIP Global configuration
; *******************************************
[global]
type=global
endpoint_identifier_order = header,username
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
[transport-wss]
type=transport
protocol=wss
bind=0.0.0.0
; ----------------------------
; agents
; ----------------------------
[2000]
type = aor
max_contacts = 10
[2000]
type = auth
username = 2000
password = 1
[2000-webrtc]
type = identify
endpoint = 2000-webrtc
match_header = From-WebRTC: 2000
[2000-webrtc]
type=endpoint
context=crossty-agents
aors=2000
auth=2000
transport=transport-wss
identify_by=header
use_avpf=yes
media_encryption=dtls
dtls_cert_file=/etc/asterisk/keys/asterisk.pem
dtls_private_key=/etc/asterisk/keys/asterisk.key
dtls_verify=fingerprint
dtls_setup=actpass
ice_support=yes
media_use_received_transport=yes
rtcp_mux=yes
direct_media=no
allow=!all,alaw,vp8,h264
and here is asterisk console output.
== WebSocket connection from '10.1.2.240:36946' for protocol 'sip' accepted using version '13'
<--- Received SIP request (571 bytes) from WSS:10.1.2.240:36946 --->
REGISTER sip:10.1.2.240 SIP/2.0
Via: SIP/2.0/WSS jic12v819c2h.invalid;branch=z9hG4bK5153721
Max-Forwards: 69
To: <sip:2000@10.1.2.240>
From: "edvinv" <sip:2000@10.1.2.240>;tag=6qapgq3b7m
Call-ID: 007eu7tif8jokg5op4rl71
CSeq: 1 REGISTER
From-WebRTC: 2000
Contact: <sip:91id2r16@jic12v819c2h.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:709b8a96-e759-435d-aec6-d81e60ac6f2e>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 3.2.11
Content-Length: 0
<--- Transmitting SIP response (468 bytes) to WSS:10.1.2.240:36946 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS jic12v819c2h.invalid;rport=36946;received=10.1.2.240;branch=z9hG4bK5153721
Call-ID: 007eu7tif8jokg5op4rl71
From: "edvinv" <sip:2000@10.1.2.240>;tag=6qapgq3b7m
To: <sip:2000@10.1.2.240>;tag=z9hG4bK5153721
CSeq: 1 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1532071296/7aa81154227edae1d64e32e0f6922728",opaque="69a0654047bfd2d2",algorithm=md5,qop="auth"
Server: Asterisk PBX 13.21.1
Content-Length: 0
<--- Received SIP request (836 bytes) from WSS:10.1.2.240:36946 --->
REGISTER sip:10.1.2.240 SIP/2.0
Via: SIP/2.0/WSS jic12v819c2h.invalid;branch=z9hG4bK2115638
Max-Forwards: 69
To: <sip:2000@10.1.2.240>
From: "edvinv" <sip:2000@10.1.2.240>;tag=6qapgq3b7m
Call-ID: 007eu7tif8jokg5op4rl71
CSeq: 2 REGISTER
Authorization: Digest algorithm=MD5, username="2000", realm="asterisk", nonce="1532071296/7aa81154227edae1d64e32e0f6922728", uri="sip:10.1.2.240", response="32f74367fc19242aa45546ed60a79954", opaque="69a0654047bfd2d2", qop=auth, cnonce="al0q17gb49si", nc=00000001
From-WebRTC: 2000
Contact: <sip:91id2r16@jic12v819c2h.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:709b8a96-e759-435d-aec6-d81e60ac6f2e>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 3.2.11
Content-Length: 0
<--- Transmitting SIP response (318 bytes) to WSS:10.1.2.240:36946 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/WSS jic12v819c2h.invalid;rport=36946;received=10.1.2.240;branch=z9hG4bK2115638
Call-ID: 007eu7tif8jokg5op4rl71
From: "edvinv" <sip:2000@10.1.2.240>;tag=6qapgq3b7m
To: <sip:2000@10.1.2.240>;tag=z9hG4bK2115638
CSeq: 2 REGISTER
Server: Asterisk PBX 13.21.1
Content-Length: 0
[Jul 20 09:21:36] WARNING[12099]: res_pjsip_registrar.c:967 find_registrar_aor: AOR '' not found for endpoint '2000-webrtc'
epc*CLI>
From configuration you can see that match_header is set to ‘From-WebRTC: 2000’ and from sip log you can see From-WebRTC heder is set correctly, but I always get following error:
res_pjsip_registrar.c:967 find_registrar_aor: AOR ‘’ not found for endpoint ‘2000-webrtc’
Error says that AOR ‘’ is not found, but from config you can see that AOR is set and also if I check in asterisk cli it all looks OK.
Also if I change identify_by=header to identify_by=username it works ok. So it looks like problem with header identification.
Thanks for any hint
edvin