PJSIP: Force outgoing invite to an unavailable endpoint?

Hi all,

I am running Asterisk 13.16.0 and using PJSIP as a channel driver for a trunk with the remote SIP server.
The problem is that the remote server does not respond to OPTIONS requests sent from my Asterisk, which makes the endpoint unavailable from Asterisk’s point of view:

asterisk*CLI> pjsip show contacts
== output truncated ==
  Contact:  Remote/sip:880131@      dc9dddb73b Unavail       0.000

For that reason, all the call attempts over this trunk fail with the following message in the debug:

0m: Endpoint 'Remote': Could not create dialog to invalid URI 'Remote'. Is endpoint registered and reachable?

Obviously, no INVITEs are sent from Asterisk.
However, that remote server is actually reachable and would process a call should Asterisk initiate it.
Moreover, disabling Qualify entirely does not help - the endpoint still looks unreachable, and no calls are originated.

Question: Is there any way in Asterisk with PJSIP to force call origination to endpoints which seem unreachable due to the lack of answers to OPTIONS? Is it possible to customize this behaviour per endpoint or globally? Are there any other workarounds to this issue?

Thank you in advance!

No, you can’t have it try an endpoint that is unreachable. You can disable qualifying on a per-AOR basis, though, and the OPTIONS won’t occur. That’s controlled using the qualify_frequency option.

Thank you Josh,

  1. Should qualify_frequency be set to 0 to disable it?
  2. Once OPTIONS are disabled by this setting, will Asterisk assume that the endpoint is always reachable and try sending INVITE to it just after successful match in the dialplan?

Yes, qualify_frequency set to 0 disables it[1] and yes without qualify enabled it won’t be known if the endpoint is reachable or not and the INVITE will be sent regardless.

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Configuration_res_pjsip#Asterisk15Configuration_res_pjsip-contact_qualify_frequency

Thank you Josh.

You provided the link to res_pjsip in Asterisk 15. Is the same also applicable for Asterisk 13?

Yes. It is still applicable to Asterisk 13 as well.