Need type=identify for one device but not another

I have the following pjsip configuration:

[example-endpoint](!)
type = endpoint
transport=transport-tcp-ipv4-nat
context=internal-sip
message_context=messages
ice_support=yes
disallow=all
allow=opus
allow=ulaw
allow=alaw
allow=all
use_avpf=yes
from_domain=pbx.example.com

[example-auth](!)
type = auth
auth_type=userpass
password=[redacted]

[example-aor](!)
type = aor
max_contacts=1
remove_existing=yes
maximum_expiration=31536000

[example_1](example-endpoint)
auth=example_1
aors=example_1
callerid=[redacted]

[example_1](example-auth)
username=example_1

[example_1](example-aor)

[example_2](example-endpoint)
auth=example_2
aors=example_2
callerid=[redacted]

[example_2](example-auth)
username=example_2

[example_2](example-aor)

[example_2]
type = identify
endpoint = example_2

example_1 can authenticate with no problems even without a type = identify definition. example_2 cannot. Without the type = identify for it, trying to REGISTER fails with:

[May 28 12:29:41] WARNING[21265]: res_pjsip_registrar.c:1080 find_registrar_aor: AOR 'example_2' not found for endpoint 'example_2'

Why the difference in how these two endpoints are being handled?

You’d have to provide the actual SIP REGISTER. Verifying things are read in correctly using the CLI commands is also good.

As well, that identify is incomplete. It won’t actually match anything because an identify matches based on IP address or header. I’d also advise looking at the console when PJSIP loads to see if there’s any configuration issues.

Indeed. It struck me that the identify is incomplete also. But it makes the difference between that endpoint being able to REGISTER or not.

<--- Received SIP request (1282 bytes) from TCP:[ipv6:address]:43176 --->
REGISTER sip:example.com SIP/2.0
Via: SIP/2.0/TCP [ipv6:address]:43176;alias;branch=z9hG4bK.3NI1vt1xV;rport
From: "[redacted]" <sip:example_2@example.com>;tag=eVJz1ZfCG
To: "[redacted]" <sip:example_2@example.com>
CSeq: 41 REGISTER
Call-ID: tbrUd1xxy5
Max-Forwards: 70
Supported: replaces, outbound, gruu
Accept: application/sdp
Accept: text/plain
Accept: application/vnd.gsma.rcs-ft-http+xml
Contact: "[redacted]" <sip:example_2@[ipv6:address]:43176;pn-type=firebase;app-id=[redacted];pn-tok=[redacted];pn-timeout=0;pn-silent=1;transport=tcp>;+sip.instance="<urn:uuid:312eea04-3559-00ae-9920-aac6701fd648>";+org.linphone.specs="ephemeral,groupchat/1.1,lime"
Expires: 31536000
User-Agent: Unknown (belle-sip/4.5.0)
Content-Length: 0
Authorization:  Digest realm="asterisk", nonce="[redacted]", algorithm=md5, opaque="[redacted]", username="example_2",  uri="sip:example.com", response="[redacted]", cnonce="[redacted]", nc=00000006, qop=auth


<--- Transmitting SIP response (584 bytes) to TCP:[ipv6:address]:43176 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TCP [ipv6:address]:43176;rport=43176;received=ipv6:address;branch=z9hG4bK.3NI1vt1xV;alias
Call-ID: tbrUd1xxy5
From: "[redacted]" <sip:example_2@example.com>;tag=eVJz1ZfCG
To: "[redacted]" <sip:example_2@example.com>;tag=z9hG4bK.3NI1vt1xV
CSeq: 41 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="[redacted]",opaque="[redacted]",stale=true,algorithm=md5,qop="auth"
Server: Asterisk PBX 18.2.2
Content-Length:  0


<--- Received SIP request (1282 bytes) from TCP:[ipv6:address]:43176 --->
REGISTER sip:example.com SIP/2.0
Via: SIP/2.0/TCP [ipv6:address]:43176;alias;branch=z9hG4bK.SM294N9zb;rport
From: "[redacted]" <sip:example_2@example.com>;tag=eVJz1ZfCG
To: "[redacted]" <sip:example_2@example.com>
CSeq: 42 REGISTER
Call-ID: tbrUd1xxy5
Max-Forwards: 70
Supported: replaces, outbound, gruu
Accept: application/sdp
Accept: text/plain
Accept: application/vnd.gsma.rcs-ft-http+xml
Contact: "[redacted]" <sip:example_2@[ipv6:address]:43176;pn-type=firebase;app-id=[redacted];pn-tok=[redacted];pn-timeout=0;pn-silent=1;transport=tcp>;+sip.instance="<urn:uuid:312eea04-3559-00ae-9920-aac6701fd648>";+org.linphone.specs="ephemeral,groupchat/1.1,lime"
Expires: 31536000
User-Agent: Unknown (belle-sip/4.5.0)
Content-Length: 0
Authorization:  Digest realm="asterisk", nonce="[redacted]", algorithm=md5, opaque="[redacted]", username="example_2",  uri="sip:example.com", response="[redacted]", cnonce="[redacted]", nc=00000001, qop=auth


<--- Transmitting SIP response (424 bytes) to TCP:[ipv6:address]:43176 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/TCP [ipv6:address]:43176;rport=43176;received=ipv6:address;branch=z9hG4bK.SM294N9zb;alias
Call-ID: tbrUd1xxy5
From: "[redacted]" <sip:example_2@example.com>;tag=eVJz1ZfCG
To: "[redacted]" <sip:example_2@example.com>;tag=z9hG4bK.SM294N9zb
CSeq: 42 REGISTER
Server: Asterisk PBX 18.2.2
Content-Length:  0


[May 28 12:50:44] WARNING[23945]: res_pjsip_registrar.c:1080 find_registrar_aor: AOR 'example_2' not found for endpoint 'example_2'

Have you examined things as I said when PJSIP loads or looked at the CLI commands that inspect what is loaded to confirm your assumptions about configuration?

Unfortunately due to [ASTERISK-29399] app_voicemail: Crash when using app_voicemail with IMAP - Digium/Asterisk JIRA I cannot simply just reload pjsip and see what it reports as reloading pjsip crashes Asterisk.

So the only thing I can examine is the entire Asterisk startup, which as you are aware is pretty verbose.

Is there anything in particular I could/should be looking for in that output?

Reloading PJSIP wouldn’t result in such a thing anyway, because things only reload if they change so you’d have to do extra work to make them happen.

I don’t have anything in particular - but if there are configuration errors or issues then they will be output when PJSIP loads. As it is, the message means that it believes there is no AOR named “example_2” configured.

I’m telling you that that’s what happens. pjsip reload → crash. Have to restart Asterisk. That aside:

I was able to do:

server*CLI> module unload app_voicemail_imap.so
Unloaded app_voicemail_imap.so
 Unloading app_voicemail_imap.so
  == Unregistered application 'VoiceMail'
  == Unregistered application 'VoiceMailMain'
  == Unregistered application 'VMAuthenticate'
  == Unregistered application 'VoiceMailPlayMsg'
  == Unregistered application 'VMSayName'
  == Unregistered custom function VM_INFO
  == Manager unregistered action VoicemailUsersList
  == Manager unregistered action VoicemailUserStatus
  == Manager unregistered action VoicemailRefresh
server*CLI> pjsip reload 
Module 'res_pjsip.so' reloaded successfully.
Module 'res_pjsip_authenticator_digest.so' reloaded successfully.
Module 'res_pjsip_endpoint_identifier_ip.so' reloaded successfully.
Module 'res_pjsip_mwi.so' reloaded successfully.
Module 'res_pjsip_notify.so' reloaded successfully.
Module 'res_pjsip_outbound_publish.so' reloaded successfully.
Module 'res_pjsip_publish_asterisk.so' reloaded successfully.
Module 'res_pjsip_outbound_registration.so' reloaded successfully.
    -- Reloading module 'res_pjsip.so' (Basic SIP resource)
[May 28 13:04:22] ERROR[25231]: config_options.c:780 aco_process_var: Could not find option suitable for category 'example_2' named 'debug' at line 1442 of 
[May 28 13:04:22] ERROR[25231]: res_sorcery_config.c:418 sorcery_config_internal_load: Could not create an object of type 'aor' with id 'example_2' from configuration file 'pjsip.conf'

which was due to my uncommenting/setting:

debug=[redacted] ; Enable/Disable SIP debug logging.  Valid options include yes|no

Without also uncommenting the:

;[global]

above it.

So ultimately your suggestion to look at pjsip reload's output was very helpful. I would have noticed this a very long time ago if it were not for the pjsip reload crashing Asterisk. :frowning:

Your help is much appreciated, as always, regardless. Thank you!

I meant reloading PJSIP wouldn’t result in PJSIP reloading unless something in the PJSIP configuration changed. It doesn’t needlessly reload if the underlying configuration files are unchanged under normal conditions. If something fails to load for some reason, then it may still try to reload (I forget if I wrote that in or not).

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