PJSIP Trunk Registration Failure

Good Day Everyone!

Shaw network in our area is doing upgrades hence internet is not very stable lately and as a consequence in a past 2 weeks I woke up 4 times to a Rejected Trunk! :((

Running:
Asterisk 13.7.2
PJPROJECT version currently running against: 2.2.1

<Registration/ServerURI…> <Auth…> <Status…>

PjSipVoIPmsCG/sip:vancouver.voip.ms:5060 PjSipVoIPmsCG Rejected

After reading and looking into this I found the following:

PBX*CLI> pjsip show registration PjSipVoIPmsCG

<Registration/ServerURI…> <Auth…> <Status…>

PjSipVoIPmsCG/sip:vancouver.voip.ms:5060 PjSipVoIPmsCG Registered

ParameterName : ParameterValue

auth_rejection_permanent : false
client_uri : sip:[email protected]:5060
contact_user :
endpoint :
expiration : 180
fatal_retry_interval : 0
forbidden_retry_interval : 0
line : false
max_retries : 10
outbound_auth : PjSipVoIPmsCG
outbound_proxy :
retry_interval : 30
server_uri : sip:vancouver.voip.ms:5060
support_path : false
transport : 0.0.0.0-udp

I would like to change the following settings:

max_retries : 10 (To 1000)
fatal_retry_interval : 0 (30)
forbidden_retry_interval : 0 (30)

Unfortunately all my attempt have failed…

  1. I tried Grep to find the string - no luck
  2. Edited: pjsip.registration.conf ( obviously got overwritten )
  3. Added below lines to pjsip.registration_custom.conf ( no avail )
    [PjSipVoIPmsCG]
    max_retries=1000
    forbidden_retry_interval=30
    fatal_retry_interval=30

Here is my pjsip.registration.conf

[PjSipVoIPmsCG]
type=registration
transport=0.0.0.0-udp
outbound_auth=PjSipVoIPmsCG
retry_interval=30
expiration=180
auth_rejection_permanent=no
server_uri=sip:vancouver.voip.ms:5060
client_uri=sip:[email protected]:5060

It seems that max_retries and fatal_retry_interval values from web interface are being ignored… I have them setup higher but according to “pjsip show registration PjSipVoIPmsCG” they are at their defaults for some reason.

Thanks!

-A

P.S.
Links:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Configuration_res_pjsip_outbound_registration

http://lists.digium.com/pipermail/asterisk-code-review/2015-October/009807.html

http://lists.digium.com/pipermail/asterisk-commits/2015-October/074078.html

Anyone?

We’re gonna need you to check your /var/log/asterisk/full log and see what the problem is. There should be something in there that tells you what the problem is and why the PJ-SIP reconnection is failing.

Hi Dave,

Thank you for your reply, as per your request here is my log:

[2016-12-27 15:37:29] VERBOSE[3403] res_pjsip/pjsip_configuration.c: Contact PjSipVoIPmsCG/sip:vancouver.voip.ms:5060 is now Unreachable. RTT: 0.000 msec
[2016-12-27 15:37:29] VERBOSE[3403] res_pjsip/pjsip_configuration.c: Endpoint PjSipVoIPmsCG is now Unreachable
[2016-12-27 15:38:18] WARNING[26205] res_pjsip_outbound_registration.c: No response received from ‘sip:vancouver.voip.ms:5060’ on registration attempt to ‘sip:[email protected]:5060’, retrying in ‘30’
[2016-12-27 15:39:20] WARNING[9272] res_pjsip_outbound_registration.c: No response received from ‘sip:vancouver.voip.ms:5060’ on registration attempt to ‘sip:[email protected]:5060’, retrying in ‘30’
[2016-12-27 15:39:36] WARNING[22094] pjsip: tsx0xb7522cec Failed to send Request msg OPTIONS/cseq=47017 (tdta0x95c2a88)! err=70009 (Operation timed out (PJ_ETIMEDOUT))
[2016-12-27 15:40:00] WARNING[22094] pjsip: tsx0x96ccfec Failed to send Request msg REGISTER/cseq=18633 (tdta0x9fbf140)! err=70009 (Operation timed out (PJ_ETIMEDOUT))
[2016-12-27 15:40:00] WARNING[29975] res_pjsip_outbound_registration.c: No response received from ‘sip:vancouver.voip.ms:5060’ on registration attempt to ‘sip:[email protected]:5060’, retrying in ‘30’
[2016-12-27 15:40:40] WARNING[22094] pjsip: tsx0x95035ec Failed to send Request msg REGISTER/cseq=18634 (tdta0xb752c850)! err=70009 (Operation timed out (PJ_ETIMEDOUT))
[2016-12-27 15:40:40] WARNING[29975] res_pjsip_outbound_registration.c: No response received from ‘sip:vancouver.voip.ms:5060’ on registration attempt to ‘sip:[email protected]:5060’, retrying in ‘30’
[2016-12-27 15:41:20] WARNING[22094] pjsip: tsx0xb7522cec Failed to send Request msg REGISTER/cseq=18635 (tdta0x95c2a88)! err=70009 (Operation timed out (PJ_ETIMEDOUT))
[2016-12-27 15:41:20] WARNING[29975] res_pjsip_outbound_registration.c: No response received from ‘sip:vancouver.voip.ms:5060’ on registration attempt to ‘sip:[email protected]:5060’, retrying in ‘30’
[2016-12-27 15:41:36] WARNING[22094] pjsip: tsx0x96ccfec Failed to send Request msg OPTIONS/cseq=20156 (tdta0x9fbf140)! err=70009 (Operation timed out (PJ_ETIMEDOUT))
[2016-12-27 15:42:00] WARNING[22094] pjsip: tsx0xb73c0134 Failed to send Request msg REGISTER/cseq=18636 (tdta0x9f90310)! err=70009 (Operation timed out (PJ_ETIMEDOUT))
[2016-12-27 15:42:00] WARNING[26285] res_pjsip_outbound_registration.c: No response received from ‘sip:vancouver.voip.ms:5060’ on registration attempt to ‘sip:[email protected]:5060’, retrying in ‘30’
[2016-12-27 15:42:40] WARNING[22094] pjsip: tsx0xb7522cec Failed to send Request msg REGISTER/cseq=18637 (tdta0x95c2a88)! err=70009 (Operation timed out (PJ_ETIMEDOUT))
[2016-12-27 15:42:40] WARNING[26285] res_pjsip_outbound_registration.c: No response received from ‘sip:vancouver.voip.ms:5060’ on registration attempt to ‘sip:[email protected]:5060’, retrying in ‘30’
[2016-12-27 15:43:20] WARNING[22094] pjsip: tsx0x96ccfec Failed to send Request msg REGISTER/cseq=18638 (tdta0x9fbf140)! err=70009 (Operation timed out (PJ_ETIMEDOUT))
[2016-12-27 15:43:20] WARNING[26285] res_pjsip_outbound_registration.c: No response received from ‘sip:vancouver.voip.ms:5060’ on registration attempt to ‘sip:[email protected]:5060’, retrying in ‘30’
[2016-12-27 15:43:36] WARNING[22094] pjsip: tsx0xb73c0134 Failed to send Request msg OPTIONS/cseq=43221 (tdta0x9f90310)! err=70009 (Operation timed out (PJ_ETIMEDOUT))
[2016-12-27 15:44:00] WARNING[22094] pjsip: tsx0x95035ec Failed to send Request msg REGISTER/cseq=18639 (tdta0xb752c850)! err=70009 (Operation timed out (PJ_ETIMEDOUT))
[2016-12-27 15:44:00] WARNING[9094] res_pjsip_outbound_registration.c: No response received from ‘sip:vancouver.voip.ms:5060’ on registration attempt to ‘sip:[email protected]:5060’, retrying in ‘30’
[2016-12-27 15:44:40] WARNING[22094] pjsip: tsx0x96ccfec Failed to send Request msg REGISTER/cseq=18640 (tdta0x9fbf140)! err=70009 (Operation timed out (PJ_ETIMEDOUT))
[2016-12-27 15:44:40] WARNING[9094] res_pjsip_outbound_registration.c: No response received from ‘sip:vancouver.voip.ms:5060’ on registration attempt to ‘sip:[email protected]:5060’, retrying in ‘30’
[2016-12-27 15:45:20] WARNING[22094] pjsip: tsx0xb73c0134 Failed to send Request msg REGISTER/cseq=18641 (tdta0x9f90310)! err=70009 (Operation timed out (PJ_ETIMEDOUT))
[2016-12-27 15:45:20] WARNING[9094] res_pjsip_outbound_registration.c: Maximum retries reached when attempting outbound registration to ‘sip:vancouver.voip.ms:5060’ with client ‘sip:[email protected]:5060’, stopping registration attempt
[2016-12-27 15:45:26] WARNING[29975] pjsip: tsx0x95035ec .Failed to send Request msg OPTIONS/cseq=54508 (tdta0xb752c850)! err=320046 (No working DNS nameserver (PJLIB_UTIL_EDNSNOWORKINGNS))
[2016-12-27 15:45:26] ERROR[29975] res_pjsip.c: Error 320046 ‘No working DNS nameserver (PJLIB_UTIL_EDNSNOWORKINGNS)’ sending OPTIONS request to endpoint
[2016-12-27 15:47:36] WARNING[22094] pjsip: tsx0x95c20cc Failed to send Request msg OPTIONS/cseq=56364 (tdta0xa2199f8)! err=70009 (Operation timed out (PJ_ETIMEDOUT))
[2016-12-27 15:49:36] WARNING[22094] pjsip: tsx0x95035ec Failed to send Request msg OPTIONS/cseq=6985 (tdta0x95c2a88)! err=70009 (Operation timed out (PJ_ETIMEDOUT))

Here is the reply of the event:

  1. Internet goes down for 15 minutes at 15:37:29
  2. PJSIP is retrying registration exactly 10 times (as per ‘pjsip show registration PjSipVoIPmsCG’ command)
  3. PJSIP stops all registration atempts after Maximum retries reached (10) at 15:45:20

I have attached a screenshot of PJSIP Trunk Timers from the Web Interface below, but they have no affect on the following counters:
max_retries : 10
fatal_retry_interval : 0
forbidden_retry_interval : 0

How can I change manually ‘max_retries: 10’ and the other two to a higher value as Web interface settings do not change it?

Thank you and Happy New Year!
A

I’m not sure I understand the problem. The system is operating pretty much exactly as designed.

Some providers will block your access after a given number of disconnects and reconnects, which is one of the reasons the limits are there.

After a 15-minute outage, though, you should eventually start to reconnect. Have you tried to do your ITSP connection with a Chan-SIP connection instead of PJ-SIP. While PJ-SIP is newer, it’s not been a consistent hit with a lot of ITSPs. Mine, for example, wants me to continue using Chan-SIP until they let me know I should change.

Switching to Chan-SIP may give you a better experience. Of course, it may not, so be prepared to troubleshoot/mess around a little bit to get it working.

Hello again,

Main issue here is PBX attempting to reconnect while internet is still down (ITSP Endpoint is unreachable) for a maximum retry count of 10 and then it stops any further registration attempts leaving us with an unregistered trunk.
In other words, while internet is still down, PBX is trying to reconnect 10 times but because it hasn’t received a reply (since ITSP is not reachable) it quits any following attempts even after internet connectivity has been restored requiring a manual intervention to restart amportal.

As a possible workaround I would like to know how can I increase a max_retries from 10 to a higher number (or even an infinite amount of retries) since I was not able to find a corresponding Parameter in the entire web interface or a config file? I hope the solution or a workaround could be found.

It does not attempt to reconnect after 15 minutes as per above since it times out after only 5 minutes (10 retries x 30 seconds = 300 seconds = 5 minutes) Increasing Retry interval from 30 seconds will potentially create other issues.

I have configured all endpoints with PJ-SIP and using different driver for a trunk wouldn’t be the optimal design. I have no other issues with PJ-SIP except this timeout nonsense and since CHAN_SIP is going away I would rather stay with PJ-SIP. Above issue has nothing to do with my ITSP but has everything to do with inability to increase Maximum Retry count which in turn makes PJ-SIP unstable.

I have seen many posts all over the internet hitting exactly the same issue without offering a solution which in turn doesn’t create additional problems.

Looking forward to a solution :wink:

Cheers,
A

Did you put in a support ticket in the “Issues” area yet? I’m pretty sure this is “as designed”, but as you point out, that leaves a problematic state in place where the phone system is no longer responsive even when the network connectivity is restored.

If your system was on a SLIP connection (for example) this would be a real problem that needs to be taken into account.

Now, if you know this is an issue in your installation, you could write a simple script that watched for IP connectivity, and when it’s restored, you could use the “fwconsole restart” command to restart the timer on the reconnect.

Yes I have:
http://issues.freepbx.org/browse/FREEPBX-13959
No much traction there…

Script workaround is not an ideal solution as it may introduce more issues with a local calling.

So nobody can tell how to change a bloody retry counter?

A