[Home]

Summary:ASTERISK-28496: PJSIP max_retries
Reporter:Sinisa (siny)Labels:pjsip
Date Opened:2019-08-05 07:06:58Date Closed:2019-08-20 12:00:02
Priority:MinorRegression?
Status:Closed/CompleteComponents:Channels/chan_pjsip
Versions:16.5.0 Frequency of
Occurrence
Related
Issues:
Environment:anyAttachments:
Description:I have just experienced a “situation”. I have converted my SIP configuration to PJSIP months ago. Everything was working fine until a few days ago, when one of the providers experienced problems. Their system was reachable to “ping”, but registrations were not working, so after some time Asterisk gave up on it with Maximum retries reached when attempting outbound registration to ‘sip:10.x.x.x’ with client ‘sip:xxxx@domain.com’, stopping registration attempt", so after provider fixed its problems, Asterisk did not register to it until I reloaded the config.
Default value of “max_retries” is 20, which is probably OK for testing, but should be much higher in production. I am not suggesting that you should change the default, but it might be good to add a bit more description here https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Configuration_res_pjsip_outbound_registration, and also in sample config file, like to set it to 1000000 (one million) (0 does NOT work as 'unlimited' but as NO retries, tested)

Thank you and best regards
Sinisa

Comments:By: Asterisk Team (asteriskteam) 2019-08-05 07:06:58.470-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Benjamin Keith Ford (bford) 2019-08-05 10:37:06.490-0500

What changes would help in this situation? Is your concern with max_retries, or something else?

By: Sinisa (siny) 2019-08-05 11:36:26.793-0500

Yes, max_retries is not really well documented, but I think it is important to do so. Default of 20 is probably good when testing, because some parameters might be wrong, so we might not want to try for too long (because server might blacklist us, for example).
But when we go to production, we can be pretty sure that "problem" is not on our side after months and years of working properly, and should retry connecting indefinitely (providers experience problems too from time to time).

I suggest to better explain that in WIKI, and also in sample config file.

(I probably won't make that mistake again, because I keep my working config as a template and copy it whenever I build a new Asterisk, but I have seen quite a few similar problems on the 'net without proper resolution)


By: Benjamin Keith Ford (bford) 2019-08-05 13:22:55.909-0500

Would making it possible to retry indefinitely be a viable solution for you? The documentation can of course be updated along with this.

By: Sinisa (siny) 2019-08-05 16:49:21.133-0500

Absolutely, it just needs to be made clear.

Thanks!

By: Benjamin Keith Ford (bford) 2019-08-06 09:28:53.958-0500

Since this is a feature request, we won't be able to work on it, but if you would like to add this as new (and optional) functionality, we would be happy to review it!

As far as documentation goes, that's something that we can update. What about the documentation is confusing? And what would you like to see there to make it more informative?

If you do decide you want to work on the new feature, I would look at {{res/res_pjsip_outbound_registration.c}}. This is where {{max_retries}} is initialized. You can do the same with your new option, and then whenever Asterisk makes the check to see if it should retry, just bypass that with your option. You will need to sign up for Gerrit \[1] as well, and post your patch there. Instructions on how to do all of this can be found here \[2].

I hope this helps!

\[1]: https://gerrit.asterisk.org/#/q/status:open
\[2]: https://wiki.asterisk.org/wiki/display/AST/Gerrit+Usage

By: Asterisk Team (asteriskteam) 2019-08-20 12:00:01.884-0500

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines