[Home]

Summary:ASTERISK-25575: res_pjsip: Dynamic outbound registrations created via ARI are not loaded into memory on Asterisk start/restart
Reporter:Matt Jordan (mjordan)Labels:
Date Opened:2015-11-19 09:41:16.000-0600Date Closed:2015-11-20 06:18:54.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_pjsip_outbound_registration
Versions:13.6.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Consider a system where {{sorcery.conf}} is configured to store/retrieve outbound registrations through the AstDB - such as in the snippet below:
{code}
[res_pjsip_outbound_registration]
registration=astdb,ps_registrations
{code}

When an outbound registration is created through ARI and persisted to the AstDB, this creates the necessary outbound registration objects in {{res_pjsip_outbound_registration}} and {{REGISTER}} requests being to fire. An example of a registration stored in the AstDB is shown below:

{code}
/ps_registrations/registration/foo                : {"auth_rejection_permanent":"true","transport":"","support_path":"false","expiration":"3600","forbidden_retry_interval":"0","endpoint":"","contact_user":"","server_uri":"sip:bar@127.0.0.1:5061","line":"false","outbound_proxy":"","client_uri":"sip:foo@127.0.0.1:5060","retry_interval":"60","fatal_retry_interval":"0","max_retries":"10"}
{code}

This works because the creation of the object causes the object's sorcery apply handler to be called, which in turn creates the registration state. However, when Asterisk is started or restarted, this does not occur.

Interestingly, if one queries the objects at any time - such as using the CLI command {{pjsip show registrations}} - the state will be created (again, because the apply handler is called) and REGISTER requests will being to fire again.

One way of solving this is to simply query for all objects in the existing sorcery observer's {{loaded}} callback. This has the effect during load/reload of asking the backend for all objects and applying the configuration to the runtime.
Comments: