Do I have a SIP ALG Issue?

Hey guys,

I’m in the process of setting up a hosted PBX (running on Vultr) and I’m experiencing a weirs SIP registration issue. I have a test extension which registers with the remote server and I can make outbound and inbound calls fine. After being idle all inbound calls go directly to the extensions voicemail box, however I can then pickup the phone and dial out and make an external call just fine. The phone drops the registration a short period after that and the process repeats again. I’ve tried registering the phone via the UDP and TCP protocols and have been able to produce the same results.

The router that the phone sits behind is ISP supplied and I can’t turn off SIP ALG. So i took the phone home with me and connected to my home Edgerouter (with SIP ALG disabled) and the phone works wonderfully.

This leads me to suspect that it may be the ISP supplied router and not being able to disable SIP ALG. Am I going in the right direction on this one? Do you have any other suggestions/recommendations?

That sounds about right. I suggest using a VPN to bypass the ALG if you can’t disable it. Phones like Sangoma have built-in VPN client that can connect direct to your PBX using VPN.

Possibly, this is just a lost NAT association (caused by a short UDP timeout in the ISP-supplied router).

If not already on, try setting qualify for the extension (with the default frequency of 60 seconds).
If the phone has a ‘keepalive’ setting, try turning that on (30 second interval).
Also try reducing the register expires time in the phone to 60 seconds.

If no luck, please post:
Phone make/model?
ISP-supplied modem/router make/model?
Is extension pjsip or chan_sip?
Is the default port (5060 for pjsip, 5160 for chan_sip) being used?

Please be more specific. Is the phone literally unregistering (sending a REGISTER request with a zero expiration time)? If so, what error may have caused it to do that?

Or, is a re-registration request failing? If so, what error response, if any, does it get? Does the Asterisk log show a registration failure?

Or, does the phone think it is still registered ok, but incoming calls fail? If so, does Asterisk show the registration ok at the time?

All of these setting seem to be set in the phone configuration and qualify is set to 60 seconds under the extensions setting.

The phone is a Grandstream GXP2170 (GrandCrap! I have Yealinks on order!) with the latest firmware. The ISP supplied router is a comcast business class router. No sure who makes the router or model. I don’t have access to the office on the weekend. The extensions is pjsip listening in port 5060 UDP.

I notice that if go into the backend of asterisk and run: pjsip show endpoints the phone shows as unavailable, however the phone looks as if it is registered from the phone GUI. If I pick up the phone and dial a number internal and external calls go through.

My experience with SIP ALG is that it produces consistent failures, and not random failures.

If moving the phone makes a difference and it is not SIP ALG, it could be something else about the router that is responsible.

Tony’s suggestion of using a VPN should solve the problem, as long as the VPN goes from the phone to a remote location, but it would seem that the easier solution would be to get a better router. Even where the ISP supplies the router, you can usually get your own. Some IPSs allow the use of any router. Others require the use of theirs, but allow you to put it into bridge mode.

Having said all of that: If you’re using remote extensions, I always recommend the use of a VPN rather than port forwarding. Opening port 5060 is too much of a security risk.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.