Unable to Register WebRTC Client via Proxy

When attempting to REGISTER a WebRTC client, the Registration is sent to a Proxy, which then forwards the Registration to Asterisk. There is an endpoint for the Proxy in pjsip.conf, and Asterisk matches the incoming number to that Proxy endpoint. This is where we see a 404 from Asterisk. It appears Asterisk is reaching back to the Proxy to verify the number (which is Registered on the Proxy). My question is, what could be causing Asterisk to throw the 404 error?

We also tried not Registering the number on the Proxy and sending the Registration directly to Asterisk via the Proxy, but Asterisk uses the IP of the Proxy and not the Browser IP, so we get a similar error. I was hoping I could force Asterisk to use the Contact IP or from IP, but this is not allowed.

Thank you,

The endpoint that matches the proxy has an associated context which has no number pattern that matches the digits received.

You’ll need to provide an actual SIP trace so it can be seen exactly what is happening.

Hello jcolp, I am trying to upload the Asterisk log, but I get the error that new users cannot upload files. Is there another way to get you the Asterisk log?

Thank you,

Include it inline, marked as preformatted text, if it is small enough, or put it on one of the many sites that will host files for reference from forums or as alternatives to large email attachements.

I find the former preferable, where it is possible.

Proxy IP is 10.190.4.9
Asterisk IP is 10.190.4.10

[Sep 25 23:22:49] DEBUG[5854] res_pjsip_registrar.c: Woke up at 1569453769 Interval: 30
[Sep 25 23:22:49] DEBUG[5854] res_pjsip_registrar.c: Expiring 0 contacts
[Sep 25 23:22:54] VERBOSE[5832] res_pjsip_logger.c: <— Received SIP request (412 bytes) from TCP:10.190.4.9:36886 —>
REGISTER sip:10.190.4.10:5060;lr;transport=tcp SIP/2.0
Via: SIP/2.0/TCP proxy.test.org:5060;branch=z9hG4bKab6d.c5d132d0000000000000000000000000.0
To: sip:90001@10.190.4.10
From: sip:90001@10.190.4.10;tag=e9157ca888c5715d6539bddbaeb92a76-76ec
CSeq: 10 REGISTER
Call-ID: 794ba68e1d88275d-2117@10.190.4.9
Max-Forwards: 70
Content-Length: 0
Contact: sip:90001@10.190.4.9:5060
Expires: 600

[Sep 25 23:22:54] DEBUG[5832] res_pjsip/pjsip_distributor.c: Could not find matching transaction for Request msg REGISTER/cseq=10 (rdata0x7f0fc4011ba0)
[Sep 25 23:22:54] DEBUG[5832] res_pjsip/pjsip_distributor.c: Calculated serializer pjsip/distributor-0000005d to use for Request msg REGISTER/cseq=10 (rdata0x7f0fc4011ba0)
[Sep 25 23:22:54] DEBUG[5828] threadpool.c: Increasing threadpool SIP’s size by 5
[Sep 25 23:22:54] DEBUG[27494] netsock2.c: Splitting ‘10.190.4.9’ into…
[Sep 25 23:22:54] DEBUG[27494] netsock2.c: …host ‘10.190.4.9’ and port ‘’.
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderZVRS3’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderZVRS2’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderPurple’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderZVRS5’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderZVRS4’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderSorensonQA’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderGlobal2’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘Purple2’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderGlobal’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderSorenson2’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderPurpleDEV’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderSorenson1’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderZVRS’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderConvo’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderSorensonQA2’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 does not match identify ‘ProviderPurpleDEV2’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Source address 10.190.4.9:36886 matches identify ‘kamailio’
[Sep 25 23:22:54] DEBUG[27494] res_pjsip_endpoint_identifier_ip.c: Identify ‘kamailio’ SIP message matched to endpoint kamailio
[Sep 25 23:22:54] VERBOSE[27494] res_pjsip_logger.c: <— Transmitting SIP response (422 bytes) to TCP:10.190.4.9:36886 —>
SIP/2.0 404 Not Found
Via: SIP/2.0/TCP proxy.test.org:5060;rport=36886;received=10.190.4.9;branch=z9hG4bKab6d.c5d132d0000000000000000000000000.0
Call-ID: 794ba68e1d88275d-2117@10.190.4.9
From: sip:90001@10.190.4.10;tag=e9157ca888c5715d6539bddbaeb92a76-76ec
To: sip:90001@10.190.4.10;tag=z9hG4bKab6d.c5d132d0000000000000000000000000.0
CSeq: 10 REGISTER
Server: Asterisk PBX 15.3.0
Content-Length: 0

[Sep 25 23:22:54] DEBUG[27494] netsock2.c: Splitting ‘10.190.4.10’ into…
[Sep 25 23:22:54] DEBUG[27494] netsock2.c: …host ‘10.190.4.10’ and port ‘’.
[Sep 25 23:22:54] DEBUG[27494] netsock2.c: Splitting ‘10.190.4.9’ into…
[Sep 25 23:22:54] DEBUG[27494] netsock2.c: …host ‘10.190.4.9’ and port ‘’.
[Sep 25 23:22:54] DEBUG[5823] manager.c: Examining AMI event:
Event: RequestNotSupported
Privilege: security,all
EventTV: 2019-09-25T23:22:54.479+0000
Severity: Error
Service: PJSIP
EventVersion: 1
AccountID: kamailio
SessionID: 794ba68e1d88275d-2117@10.190.4.9
LocalAddress: IPV4/TCP/10.190.4.10/5060
RemoteAddress: IPV4/TCP/10.190.4.9/36886
RequestType: registrar_requested_aor_not_found

[Sep 25 23:22:54] DEBUG[5822] manager.c: Examining AMI event:
Event: RequestNotSupported
Privilege: security,all
EventTV: 2019-09-25T23:22:54.479+0000
Severity: Error
Service: PJSIP
EventVersion: 1
AccountID: kamailio
SessionID: 794ba68e1d88275d-2117@10.190.4.9
LocalAddress: IPV4/TCP/10.190.4.10/5060
RemoteAddress: IPV4/TCP/10.190.4.9/36886
RequestType: registrar_requested_aor_not_found

[Sep 25 23:22:54] DEBUG[5821] manager.c: Examining AMI event:
Event: RequestNotSupported
Privilege: security,all
EventTV: 2019-09-25T23:22:54.479+0000
Severity: Error
Service: PJSIP
EventVersion: 1
AccountID: kamailio
SessionID: 794ba68e1d88275d-2117@10.190.4.9
LocalAddress: IPV4/TCP/10.190.4.10/5060
RemoteAddress: IPV4/TCP/10.190.4.9/36886
RequestType: registrar_requested_aor_not_found

[Sep 25 23:22:54] DEBUG[5824] manager.c: Examining AMI event:
Event: RequestNotSupported
Privilege: security,all
EventTV: 2019-09-25T23:22:54.479+0000
Severity: Error
Service: PJSIP
EventVersion: 1
AccountID: kamailio
SessionID: 794ba68e1d88275d-2117@10.190.4.9
LocalAddress: IPV4/TCP/10.190.4.10/5060
RemoteAddress: IPV4/TCP/10.190.4.9/36886
RequestType: registrar_requested_aor_not_found

[Sep 25 23:22:54] SECURITY[5877] res_security_log.c: SecurityEvent=“RequestNotSupported”,EventTV=“2019-09-25T23:22:54.479+0000”,Severity=“Error”,Service=“PJSIP”,EventVersion=“1”,AccountID=“kamailio”,SessionID="794ba68e1d88275d-2117@10.190.4.9",LocalAddress=“IPV4/TCP/10.190.4.10/5060”,RemoteAddress=“IPV4/TCP/10.190.4.9/36886”,RequestType=“registrar_requested_aor_not_found”
[Sep 25 23:22:54] WARNING[27494] res_pjsip_registrar.c: AOR ‘90001’ not found for endpoint ‘kamailio’
[Sep 25 23:22:54] DEBUG[5823] manager.c: Running action ‘Agents’

It has stated why in the warning message:

[Sep 25 23:22:54] WARNING[27494] res_pjsip_registrar.c: AOR ‘90001’ not found for endpoint ‘kamailio’

The incoming request has matched an endpoint named “kamailio” and the REGISTER was for AOR “90001” which is not configured on the endpoint.

If it should have matched a different endpoint such as based on the username instead, then you may need to adjust the endpoint identifier order[1].

[1] https://github.com/asterisk/asterisk/blob/master/configs/samples/pjsip.conf.sample#L1077

Yes, the Registration is coming from the “kamailio” Proxy, which does have 90001 Registered. kamalio is an endpoint in pjsip.conf and I was not sure of the configuration needed to get Asterisk to reach back to the Kamalio server to validate the 90001 endpoint registered in Kamalio. Should I not treat the Proxy (kamailio) as an endpoint?

I also tried to just pass the Registration from the browser endpoint to Asterisk through the Proxy, but Asterisk uses the IP of the Proxy and not of the Browser for matching, but I read your past post about this, saying you cannot force Asterisk to use the Contact IP.

Thank you

Asterisk doesn’t “reach back” to validate. With this kind of configuration you need a fairly solid understanding of SIP, SIP proxies, and B2BUAs to put together an architecture of how it should work. If you don’t have that you’re likely to run into difficulties.

In general though if the browser is registering to Kamailio and Kamailio is acting as the registrar you don’t need to send the REGISTER to Asterisk at all. You would dial Kamailio and it would do the lookup and send traffic to the browser.

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