I am posting this because this issue drove me nuts for days and I finally solved it. Hopefully this post will help someone else…
I have a couple hundred pjsip extensions. There were no obvious issues with the phone config nor the extensions, but I kept none of the extensions could complete a call, even from extension to extension.
I disconnected all phones but one and ran wireshark on the ip of the phone: “tshark host 192.168.1.x”
I was repeatedly getting 401 Unauthorized replies to all of my attempted REGISTER requests.
Ran debug on asterisk:
https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information
CLI> core set verbose 5
CLI> core set debug 5
CLI> module reload logger
My phones were trying to register two test extensions that I set up, 11 and 12. I saw in the matrix running across my screen that it was referencing a different extension, call it 99. I saw references to “99-identify” - clearly WRONG!
Some to find out, asterisk tries to identify an endpoint in an order that causes it to miscategorize my phones extensions.
https://blogs.asterisk.org/2018/02/07/identifying-endpoint-pjsip/
Solution was to enter the following line in my pjsip_custom_post.conf file and restarting
https://issues.freepbx.org/browse/FREEPBX-17803
endpoint_identifier_order=auth_username,username,ip
The default identify order is apparently not what I was expecting.
CLI> pjsip show identifiers
Identifier Names:
name not specified
ip
username
anonymous
header
auth_username
Im sure some of the others may be able to add some suggestions to this, but I hope this helps someone.