PJSIP registration max_retries=0


I’m registering to my ITSP (Callcentric) using Asterisk 13.18 and PJSIP. Sometimes my ISP goes down at night and eventually, Asterisk will stop sending register request.
The default max_retries=10 and retry_interval=60 in my outbound registration config file, so after 10 minutes asterisk do not try to register anymore and when my internet connection is back my trunk is down.

If I set the max_retries=0 will asterisk retry forever to register?

I don’t know if we have a way to configure things for that specific behavior, but you can certainly try and see what happens.

Unfortunately, max_retries=0 is not working, Asterisk will stop trying to register.
The only way I have found to register after a network downtime is by monitoring the network with Monit and then start a script to force an outbound registration once the network is back. Tested and working.

My Monit file:

#check host google.com with address google.com
  if failed icmp type echo
    count 3 with timeout 5 seconds
    4 times within 10 cycles
then alert
ELSE IF succeeded THEN EXEC "/home/register_callcentric.sh"
alert myemail@gmail.com

The content of register_callcentric.sh:


asterisk -x 'pjsip send register callcentric'
1 Like

I’m trying :
registration/auth_rejection_permanent = no

I think setting max_retries = 0 causes retries unless there’s a reject from the server. For some reason, callcentric rejects registration authorization every once in a while. Setting auth_rejection_permanent has been working for me for 3 days. We’ll see if it lasts.

You set auth_rejection_permanent to Yes?

Weird… From the Wiki:

If this option is enabled and an authentication challenge fails, registration will not be attempted again until the configuration is reloaded.

Did you mean set to no?

1 Like

By yes, I meant no.