PJSIP and dynamic addressing

I’m using asterisk 13.11.2/PJSIP on a consumer DSL line that gets disconnected from the ISP’s side every 24 hours. When that happens, a number of things occur:

  • My IP address changes
  • DNS may return a different IP address for my ITSP’s SIP server via SRV record.
  • All outbound registrations need to be renewed, otherwise I get a ‘401 unauthorized’ response from their SIP server when trying to place an outbound call prior to the corresponding registration being renewed.

Performing a ‘module reload res_pjsip.so’ seems to accomplish the task of updating the changed IP addresses, when I have the transport configured with ‘allow_reload = yes’. But I could not find a way to tell asterisk to force a renew of all outbound registrations, other than performing a full restart of asterisk. There is the ‘pjsip send register’ command, but unfortunately it does not allow to specify something like ‘all’, so I would need to do this for each outbound registration separately. Is there another way to force an immediate refresh of all configured outbound registrations?

If you do a “module reload res_pjsip_outbound_registration.so” does this do as you need?

Unfortunately not. The module gets reloaded, but no registrations are being sent out.

And it also seems as if ‘module reload res_pjsip.so’ also does not update the machine’s public IP address, even with ‘allow_reload = yes’, if there have not been any changes to the pjsip.conf and/or transport section. ‘pjsip dump endpt’ still shows the old IP address as ‘published as’. Only thing I found so far that does both is ‘core restart gracefully’.

I’d suggest filing an issue[1] then so we can try to improve things for that scenario.

[1] https://issues.asterisk.org/jira

Would that be categorized as a ‘feature request’? And although both problems are related to the same scenario, shall they go into one issue or separate ones?

The fact we don’t handle that scenario very well is a bug. One issue is fine.

For anyone who may come across this thread the issue is being tracked at https://issues.asterisk.org/jira/browse/ASTERISK-26458