Trying tor register phones, getting "extension does not exist in context"

Here’s a pretty full snippet - names have been changed to protect the innocent. I’m fairly new to FreePBX. Managed supported VOIP systems before, and more recently a Digium system, and now we’re trying to move onto FreePBX. I just can’t get the phones to register. They download the config files fine and look like they’re ready to go on the display, but the pjsip registration is failing. We’re using Digium phones and have the Endpoint Manager templates. The extensions are all set for pjsip as far as I can tell. I must be missing something though.

<— Received SIP request (623 bytes) from UDP:10.55.30.150:5060 —>
SUBSCRIBE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 10.55.30.150:5060;rport;branch=z9hG4bKPjweA49fuuRpyZJjaNKqRyIQY94AcFvMVt
Max-Forwards: 70
From: “Sharon Stone-2114” sip:[email protected];tag=XFRx6xY6gzDZ8wiM-hQ.d8wlgKJmd.KA
To: sip:[email protected]
Contact: “Sharon Stone-2114” sip:[email protected]:5060;ob
Call-ID: 9DJGNmpJv4W4.puoXtLnmCYmgTGKftke
CSeq: 6294 SUBSCRIBE
Event: presence
Expires: 600
Supported: replaces, 100rel, timer, norefersub
Accept: application/pidf+xml, application/xpidf+xml
Allow-Events: presence, message-summary, refer
User-Agent: Digium D70 2_2_1_7
Content-Length: 0

<— Transmitting SIP response (569 bytes) to UDP:10.55.30.150:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.55.30.150:5060;rport=5060;received=10.55.30.150;branch=z9hG4bKPjweA49fuuRpyZJjaNKqRyIQY94AcFvMVt
Call-ID: 9DJGNmpJv4W4.puoXtLnmCYmgTGKftke
From: “Sharon Stone-2114” sip:[email protected];tag=XFRx6xY6gzDZ8wiM-hQ.d8wlgKJmd.KA
To: sip:2114[email protected];tag=z9hG4bKPjweA49fuuRpyZJjaNKqRyIQY94AcFvMVt
CSeq: 6294 SUBSCRIBE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1540325546/a214a6b965dcbe53ca20768c4b3396c0”,opaque=“2e6d7d4e278c019a”,algorithm=md5,qop=“auth”
Server: FPBX-14.0.4.1(13.22.0)
Content-Length: 0

<— Received SIP request (920 bytes) from UDP:10.55.30.150:5060 —>
SUBSCRIBE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 10.55.30.150:5060;rport;branch=z9hG4bKPjuhiZEOYXoWYN2ldkP6hjWwItHxcbuGVU
Max-Forwards: 70
From: “Sharon Stone-2114” sip:[email protected];tag=XFRx6xY6gzDZ8wiM-hQ.d8wlgKJmd.KA
To: sip:[email protected]
Contact: “Sharon Stone-2114” sip:[email protected]:5060;ob
Call-ID: 9DJGNmpJv4W4.puoXtLnmCYmgTGKftke
CSeq: 6295 SUBSCRIBE
Event: presence
Expires: 600
Supported: replaces, 100rel, timer, norefersub
Accept: application/pidf+xml, application/xpidf+xml
Allow-Events: presence, message-summary, refer
User-Agent: Digium D70 2_2_1_7
Authorization: Digest username=“2114”, realm=“asterisk”, nonce=“1540325546/a214a6b965dcbe53ca20768c4b3396c0”, uri=“sip:[email protected]:5060”, response=“16193bdf852e09a6e167017935ab0bbf”, algorithm=md5, cnonce=“LbhmJyxe8FvODIUJLNfkII80AtlFpkCN”, opaque=“2e6d7d4e278c019a”, qop=auth, nc=00000001
Content-Length: 0

[2018-10-23 16:12:26] NOTICE[28104]: res_pjsip_exten_state.c:358 new_subscribe: Endpoint ‘2114’ state subscription failed: Extension ‘2114’ does not exist in context ‘’ or has no associated hint
<— Transmitting SIP response (419 bytes) to UDP:10.55.30.150:5060 —>
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 10.55.30.150:5060;rport=5060;received=10.55.30.150;branch=z9hG4bKPjuhiZEOYXoWYN2ldkP6hjWwItHxcbuGVU
Call-ID: 9DJGNmpJv4W4.puoXtLnmCYmgTGKftke
From: “Sharon Stone-2114” sip:[email protected];tag=XFRx6xY6gzDZ8wiM-hQ.d8wlgKJmd.KA
To: sip:[email protected];tag=z9hG4bKPjuhiZEOYXoWYN2ldkP6hjWwItHxcbuGVU
CSeq: 6295 SUBSCRIBE
Server: FPBX-14.0.4.1(13.22.0)
Content-Length: 0

<— Transmitting SIP request (429 bytes) to UDP:10.55.30.150:5060 —>
OPTIONS sip:[email protected]:5060;ob SIP/2.0
Via: SIP/2.0/UDP 10.55.30.160:5060;rport;branch=z9hG4bKPjaeb4f7b3-4619-4a80-99d9-f1b82dc3914d
From: sip:[email protected];tag=5f5a39b4-b703-493f-b03b-0c0a2e47ffc4
To: sip:[email protected];ob
Contact: sip:[email protected]:5060
Call-ID: bc1544e9-55b0-4c93-b2ab-3797afa30ca0
CSeq: 63513 OPTIONS
Max-Forwards: 70
User-Agent: FPBX-14.0.4.1(13.22.0)
Content-Length: 0

<— Received SIP response (787 bytes) from UDP:10.55.30.150:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.55.30.160:5060;rport=5060;received=10.55.30.160;branch=z9hG4bKPjaeb4f7b3-4619-4a80-99d9-f1b82dc3914d
Call-ID: bc1544e9-55b0-4c93-b2ab-3797afa30ca0
From: sip:[email protected];tag=5f5a39b4-b703-493f-b03b-0c0a2e47ffc4
To: sip:[email protected];ob;tag=z9hG4bKPjaeb4f7b3-4619-4a80-99d9-f1b82dc3914d
CSeq: 63513 OPTIONS
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Accept: application/sdp, application/pidf+xml, application/xpidf+xml, application/simple-message-summary, message/sipfrag;version=2.0, application/im-iscomposing+xml, text/plain
Supported: replaces, 100rel, timer, norefersub
Allow-Events: presence, message-summary, refer
User-Agent: Digium D70 2_2_1_7
Content-Length: 0

The “usual suspect” with that error is that you’ve got your phones pointed at the PJ-SIP port on the PBX instead of the Chan-SIP port, and that the phones are defined in the Chan-SIP configuration.

I dont even see a register attempt in there

Let me provide what to me look like the relevant settings, maybe there’s something wrong/missing.

Extension 2114
General Tab
“This device uses PJSIP technology listening on Port 5060 (UDP)”
Extension Secret left alone - autogenerated
User is from internal directory named 2114, also auto-generated password
Other tab
Endpoint is tied my MAC address, it’s a Digium D70
Everything else is default.

Settings–>Asterisk SIP settings–>Chanpjsip
UDP is enabled
Port is 5060

Here is what I’m seeing as well
Connected to Asterisk 13.22.0 currently running on iwgpbx (pid = 28069)
– Updating DPMA user ‘4408’ uri=‘pjsip:10.55.30.153:5060;transport=’ ua=‘Digium D70 2_2_1_7’
– Updating DPMA user ‘2114’ uri=‘pjsip:10.55.30.150:5060;transport=’ ua=‘Digium D70 2_2_1_7’
[2018-10-24 07:59:23] NOTICE[9186]: res_pjsip_exten_state.c:358 new_subscribe: Endpoint ‘4408’ state subscription failed: Extension ‘4408’ does not exist in context ‘’ or has no associated hint
[2018-10-24 07:59:29] NOTICE[28371]: res_pjsip_exten_state.c:358 new_subscribe: Endpoint ‘2114’ state subscription failed: Extension ‘2114’ does not exist in context ‘’ or has no associated hint
– Updating DPMA user ‘4408’ uri=‘pjsip:10.55.30.153:5060;transport=’ ua=‘Digium D70 2_2_1_7’
– Updating DPMA user ‘2114’ uri=‘pjsip:10.55.30.150:5060;transport=’ ua=‘Digium D70 2_2_1_7’
– Updating DPMA user ‘4408’ uri=‘pjsip:10.55.30.153:5060;transport=’ ua=‘Digium D70 2_2_1_7’
– Updating DPMA user ‘2114’ uri=‘pjsip:10.55.30.150:5060;transport=’ ua=‘Digium D70 2_2_1_7’
[2018-10-24 08:04:23] NOTICE[22227]: res_pjsip_exten_state.c:358 new_subscribe: Endpoint ‘4408’ state subscription failed: Extension ‘4408’ does not exist in context ‘’ or has no associated hint
[2018-10-24 08:04:27] NOTICE[28371]: res_pjsip_exten_state.c:358 new_subscribe: Endpoint ‘2114’ state subscription failed: Extension ‘2114’ does not exist in context ‘’ or has no associated hint
– Updating DPMA user ‘4408’ uri=‘pjsip:10.55.30.153:5060;transport=’ ua=‘Digium D70 2_2_1_7’
– Updating DPMA user ‘2114’ uri=‘pjsip:10.55.30.150:5060;transport=’ ua=‘Digium D70 2_2_1_7’
– Updating DPMA user ‘4408’ uri=‘pjsip:10.55.30.153:5060;transport=’ ua=‘Digium D70 2_2_1_7’
== Endpoint 2114 is now Unreachable
– Contact 2114/sip:[email protected]:5060;ob is now Unreachable. RTT: 0.000 msec

My understanding is that nothing has to be done on the phones, as they will get their configuration from the server. They do get the configuration, I confirmed that because the first time they booted up, they downloaded and installed the updated firmware. They also show their Extension and other template settings on the screen. So it’s got to do with the SIP/PJSIP settings somewhere, right?

I think I may have found something, but I’m not sure what to do about it. One of the two phones I was using for testing, I was able to get working by just deleting the extension and user and recreating the extension. I imported a lot of stuff using bulk handler, so maybe something didn’t take quite right. Anyhow, the second of the two phones/extensions that weren’t working is still not working, and the extension also doesn’t show up in the sip_additional.conf file. No matter how many times I’ve deleted/recreated, restarted asterisk, rebooted, etc., it just doesn’t want to add the 4408 extension. Any ideas on how to attempt to mitigate this?

Go figure. I’m using D70 Digium phones. On a whim, I changed this one extension to a D65 in the endpoint manager and now it works. Changed back to D70, still works.

That’s a Chan_SIP config file. You’re using PJSIP, all your “extension” configs will be split amount the pjsip*.conf files.

Thanks for pointing that out. I can see that my two extensions are showing up in the pjsip.endpoint.conf file. I hadn’t looked at it before.

Still strange is that all of my other extensions (ones that I haven’t tested with a phone yet, just imported using bulk handler) are showing up in the GUI as pjsip, but showing up in the sip_additional.conf file. Is that a bug?

That means the import had mixed information in it and you probably filled in Chan_SIP fields along with PJSIP fields and caused “duplicate” entries. In other words, it added information to the database tables that store the pjsip/chan_sip details for an extension and made it think it should build both. That’s my theory.

1 Like

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