Switched from chan_sip to chan_pjsip and phones unable to register - 404 Not found

Asterisk: 18.5.0

Have a local virtual FreePBX server with phones on a separate VLAN. Both subnets can communicate.

Working to connect to our eSIP provider, which is a local telco that has service directly delivered (no username / password authentication).

Had ~40 extensions setup (using bulk handler) and working with Chan_SIP. Decided to switch to PJSIP before implementation (setup chan_SIP a long time ago, wanted to make the change now). Did not know about the command line or GUI utilities to switch extensions over to pjsip. As a result, I deleted all of the extensions and users and started over. Immediately, got a number of fail2ban emails banning phones, which were left connected and without extensions on the FreePBX server. I added the subnet to the intrusion detection whitelist and no more notices.

Unfortunately, no phones are able to register. Yealink T-41P and T-48G both tried. Manually setup extension (as chan_pjsip) and user. Have spent hours reading forum posts and cannot figure out the error.

I did switch the chan_sip [advanced general settings --> bind port 5160 / TLS bind port 5161] and chan_pjsip [ (udp) --> Port to listen on --> 5060] ports in Settings --> Asterisk SIP Settings when I switched. I also deleted the chan_sip trunk and recreated with chan_pjsip. Not sure I have all the details of the trunk correct yet, but in my prior experience that should not affect local phone registration, just inbound/outbound calls. (Of note, it looks like many fewer options for PJSIP trunks and likely difficult to screw up).

In examples below:
Phone IP address replaced by PHONEIP
FreePBX server IP address replaced by FREEPBXIP
Telco IP address (static internal route to their on prem delivery) replaced by TELCOIP.

Phone username is its extension. Password verified.

Server has been restarted several times.

Any guidance would be appreciated. Pulling out my hair. Sorry if it is very obvious / simple. Glad to provide additional details that might help. Not sure what this AOR error means.

sngrep output:

2021/08/11 08:14:40.162771 PHONEIP:5060 -> FREEPBXIP:5060
Via: SIP/2.0/UDP PHONEIP:5060;branch=z9hG4bK4032473559
From: "466-Robert" <sip:[email protected]:5060>;tag=271542086
To: "466-Robert" <sip:[email protected]:5060>
Call-ID: [email protected]
Contact: <sip:[email protected]:5060>
Max-Forwards: 70
User-Agent: Yealink SIP-T48G
Expires: 3600
Allow-Events: talk,hold,conference,refer,check-sync
Content-Length: 0

2021/08/11 08:14:40.163137 FREEPBXIP:5060 -> PHONEIP:5060
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP PHONEIP:5060;rport=5060;received=PHONEIP;branch=z9hG4bK4032473559
Call-ID: [email protected]
From: "466-Robert" <sip:[email protected]>;tag=271542086
To: "466-Robert" <sip:[email protected]>;tag=z9hG4bK4032473559
Server: FPBX-
Content-Length:  0

From /var/log/asterisk/fail2ban.log

[2021-08-11 08:28:06] WARNING[13081] res_pjsip_registrar.c: AOR '' not found for endpoint 'My_telco_PJSIP' (PHONEIP:5060)

[2021-08-11 08:28:06] SECURITY[19143] res_security_log.c: SecurityEvent="RequestNotSupported",EventTV="2021-08-11T08:28:06.171-0800",Severity="Error",Service="PJSIP",EventVersion="1",AccountID="My_telco_PJSIP",SessionID="[email protected]",LocalAddress="IPV4/UDP/FREEPBXIP/5060",RemoteAddress="IPV4/UDP/PHONEIP/5060",RequestType="registrar_requested_aor_not_found"

From /etc/asterisk/pjsip.aor.conf:


Did you restart asterisk when you changed the port bindings?

I restarted the server previously with no change.

I just restarted asterisk and the trouble phone registered. Shouldn’t a server restart also restart asterisk?

core restart now

Very odd. Based on all the forums I read, incredulous the improvement will persist. Fingers crossed.

I will check to see if other phones can be registered and report back.

Any thoughts on the AOR warning for the PJSIP trunk?

I have a feeling that something got messed up while importing with bulk handler. I would simply try to delete the problematic extensions and manually recreate them.

Regarding the trunk, please post the trunk configuration.

Also, can you please post the output of

asterisk -rvvvvvv
core reload

I appreciate the feedback.

I continue to troubleshoot and find odd behavior when using the bulk uploader. Particularly when overwriting changes to existing extensions, even with asterisk and system restarts. Registrations fail for some reason, despite unchanged secrets uploaded.

Have to rebuild the extensions and do factory resets on the phones to get them to register again. Time consuming.

Once the configuration is setup, I plan to not touch the bulk uploader again to hopefully prevent this ugly issue from arising.

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