AOR '' not found for endpoint '2000-webrtc'

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

The registrar does not currently support matching on a header for the purposes of an inbound registration it looks like.

1 Like

Hi,
you are probably right because I think that outbound calls (INVITE) are working with header matching.

I use header matching to support two endpoints, with different transport (udp and wss) for same AOR. I haven’t found any other way to overcome this problem. It is completely unacceptable for user two have two contacts, one for webrtc and other for normal sip.

Is any tracking issue for this or should I add it?

best regards and nice day

There is no issue currently filed. Why is having two a problem? What does using one AOR actually get you?

I simply want to achive that for example user with name: 2000 will be able to register/call with same credentials over SIP/UDP and webrtc over WSS. I don’t want the same user two have for example 2000 for normal sip and 2001 for webrtc. Because asterisk is not able to identify endpoint by transport (what will be perfect solution) I added header From-WebRTC: 2000 for all webrtc clients so that correct [2000-webrtc] endpoint is used. For other endpoint [2000] is selected.

[2000]
type = aor
max_contacts = 10

[2000]
type = auth
username = 2000
password = 1

[2000]
type = endpoint
context = crossty-agents
aors = 2000
auth = 2000
outbound_auth = 2000
transport = transport-udp
identify_by = username
allow = !all,alaw

[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

Today I discovered that this configuration is not working for webrtc incoming call, Webrtc is not able to registered!

Is there any other way that client with name 2000 / psw 1 will be able to use this same credentials with webrtc and non webrtc agent?

br
edvin

Most people don’t care and use separate endpoints, because that just works and gives greater control and predictable behavior. I think the fact that header matching doesn’t work on an inbound registration like that is a bug so feel free to file one[1].

How are you handling outgoing calls? You dial both endpoints?

[1] https://issues.asterisk.org/jira

How are you handling outgoing calls? You dial both endpoints?

A little explanation. I have an ARI application and the main thing I would like to achieve is that technology is part of asterisk and not part of application.
So for webrtc UA and non webrtc you need two endpoints, let say 2000 and 2000-webrtc. (You are not able to configure one enpoint two have two transport!!)

  1. Inbound calls
  • here I can use custom header in webrtc UA, and header endpoint identification in asterisk to select correct endpoint. (Currently not working for register!)
  1. Outbound calls
    Here I thought that if I set same AOR ([2000]) for both endpoints ([2000] and [2000-webrtc]) I will be able to call this AOR and asterisk will select endpoint with available contact. But I don’t think this is possible?

Let’s say that I want to avoid calling both endpoints, what else is possible through ARI channel originate:

a.) can I call AOR and correct endpoint will be selected. I don’t think this works: PJSIP/2000/2000. As I understand this will search AOR inside endpoint? Any other syntax to call AOR [2000] that belong to both endpoint?

b.) can I use as endpoint in ari originate something like this: PJSIP/2000&PJSIP/2000-webrtc?

best regards
edvin

You can’t dial both through ARI through that mechanism - you would have to do it yourself by originating to each individually.

The problem with using the same AOR for both endpoints is that the INVITE generated is different depending on if it is WebRTC or not, and they are not compatible. Since your non-WebRTC and WebRTC are registered to the same thing they’ll each receive 2 calls. 1 with the INVITE SDP they are expecting, and 1 without. That’s just something to keep in mind and why it is hard to use one endpoint for WebRTC and non-WebRTC. The configuration is just fundamentally different.

That’s why noone has tackled that problem of using 1 endpoint.

Was absent, so little late response.

There is no need for single endpoint, of course you can have two endpoints, one for webrtc and one for non-webrtc, because protocols are very different. I just hope that in the future asterisk releases this will become invisible from outside.
So for example, if user has name 2000 and psw 1, he will be able with same credentials, without any client modification, register, make, receive calls from any UA being webrtc or not. This is currently not possible.

For this to work asterisk need two things:

  • addition identification for destination address/port or technology, so that you will be able to select correct endpoint. Example: use endpoint 2000-webrtc, when user is 2000 and destination port is 8089, otherwise use 2000.
  • for outbounds/dialing: from https://wiki.asterisk.org/wiki/display/AST/Endpoints+and+Location%2C+A+Match+Made+in+Heaven your are not able to dial directly AOR. You are able to dial endpoint (PJSIP/2000) or specific AOR inside endpoint (PJSIP/2000/2000). Maybe it will be good to have syntax to dial AOR like this: PJSIP/AOR/2000. Here AOR 2000 is queried for the available contacts. The first contact is selected. Now asterisk must select correct endpoint (the one used when contact was created in registration process), because the same AOR is on two endpoints 2000 and 2000-webrtc. The main point here is that you don’t provide endpoint, but asterisk founds one based on AOR.

Of course this is just my view from outside forest, where I don’t see individual trees :).

thanks and have a nice day
edvin