Softphones won't recive calls after some time

Hi there,
I have an asterisk/freepbx server locally running (with own dns, but only accessable from lan), which isl only used to call internal extensions, therefore it’s not possible to make outbound calls, as well no need.

Setup Example:
I am ussing some Unify SIP phone, and some softphones (android, mizudroid and PortSIP Softphone ).
I can call the softphones from the unify phone and they can call the unify phone but after sometime (after app start) they seem to unregister, because they can’t recieve any calls from the unify phones anymore, but as soon as I start the app again or want to call from app f.e the unify phones -> no problem they can be called again for sometime
I already deactivated energy saving mode for this app, also in mizudroid tried the modes like Foreground, Automatic.
But the app still seems to go in some sort of Standby

  • Is there some way to be able recieve calls anytime ?
  • Configuration on freepbx side ?
  • Configuration on Softphone side ?
  • Is there some open-source service which keeps the app awake (locally) ?
  • Is there some sort of timeout config?
  • Do you recommend another app which can recieve calls anytime ?

SMS or text messaging won’t work and mizudroid said that I need to change to foreground (unsuccessful) because if the server runs local there will be an problem with push noftifications.

I am still new to Freepbx.
Thank you for your time.

Version:

FreePBX 15.0.17.24

Are you using chan_pjsip or chan_sip?

I am using chan_pjsip

Try adding

0.0.0.0   localhost 

to /etc/hosts (that’s a guess that the softphones are trying to escape your network, and assumes that your PBX is also their gateway)

Well the Network looks like this (in IPv4)
Gateway: x.x.x.1
DNS: x.x.x.10
PBX: x.x.x.15
[…]

And the (Soft)Phones still have and need internet access, just the pbx service shall be on lan.
Do you want me to edit the hosts file of the pbx machine ? (If yes then I will try tomorrow) ?

  • But wouldnt that prevent pbx to connect to the gateway and therefore all communication (f.e. ssh / web /…) ?

Sorry, I have no experience deploying an intrinsically network based service on an unconnected server I would look to sngrep and then tcpdump for possible resolution. but that would likely ultimately need to be done on the gateway also, you would be looking for where the phones are sending their REGISTER and INVITE SIP connections to

1 Like

@dicko Thank you very much. I will try (tomorrow)

  • Could the cause be a self signed certificate, because currently I am using just a self-signed certificate (and didn’t yet import the c.autohirty to the phones) ?
1 Like

For devices on the same LAN, you should not have any registration loss from IP phones or common softphones (Zoiper, MicroSIP, PhonerLite, Linphone, etc.) running under Windows, MacOS or Linux. If you have problems with those, look at the Asterisk log or use tcpdump to troubleshoot.

OTOH, there are problems with SIP apps running on mobile devices (both Android and iOS), because the logic to conserve battery and memory often causes interruptions leading to registration loss.

Mainstream VoIP apps (Skype, WhatsApp, FaceTime, etc.) use push notifications to avoid this issue and impose zero additional battery drain when idle.

Acrobits Groundwire (not free) is an example that uses push and is very reliable. However, it depends (by default) on its publisher’s SIPIS (push) server to register to your PBX when the app is backgrounded. If your PBX is isolated from the internet for security reasons, you could open it to only the push server addresses (Acrobits provides a list). Alternatively, Acrobits provides the software so you could run your own push server (but that still needs an internet connection to contact Google / Apple).

The next best solution is to use SIP over TCP, combined with disabling battery optimization for the app. With luck, that should be reasonably reliable.

The registration issue affects only incoming calls; the app should be able to place a call in any case. The PBX can use ‘qualify’ to determine when registration has been lost, and take alternate action to handle a call to the device, such as placing a normal cellular voice call. This of course would require the PBX to have a trunk, either a SIP trunk (needs an internet connection), a POTS line or a GSM gateway.

@Stewart1

Well I think thats the case. I will try first changing to TCP and observe the behaviour of the Softphones (on android)

  • Is there some kind of timeout which also should be increased so that the connection won’t timeout after a while ?

certificates will not be a problem unless you are using TLS, If your phones are using stun or turn and there is no valid return resolution, there might be a problem for your isolated server.

Ok, currently we don’t use TLS. Also I just checked, there is no stun and turn.

Then it’s something else :wink:

1 Like

In theory, a TCP connection between two hosts on the same LAN subnet should stay up forever.

If you lose registration, possibly the phone is losing its Wi-Fi connection (pinging it will fail) or the app has been put to sleep so it doesn’t renew the registration or respond to incoming requests.

You may be able to avoid these by setting a short qualify interval for the extension, or using a keep-alive mechanism (if present) in the app. Both of these shorten battery life; if they help you’ll need to experiment to find the longest interval that works reliably.

1 Like

Well we switched to TCP and could observe that if the Extension is “disconnected” or not reachable (the call will stop after a few sec. without reaching the other softphone) and we tried to call multiple times (after ca. 6 times), the softphone was “awaken”

@Stewart1 goes through multiple subnets (min. 2)

Try Groundwire… I used it for over a year and it had none of these issues, worked great. I recently switched about a month and a half ago to Sangoma Connect which is working great as well but wont work for you with your PBX locked down to local internal lan traffic only.

I would try Groundwire (as stated above, not free).

Does Groundwire not require inbound access to the PBX from the internet for their push servers? In Sangoma Connect you can define whatever ip/fqdn you want for Sangoma Connect registration. As long as both the push servers and the client resolves the fqdn properly, you can register Connect clients from a local LAN.

The ony operational difference between Groundwire and Sangoma Connect (and Clearly Anywhere) is the provisioning server.

SIP traffic is managed identically, down to using the same push servers.

Hmmm, I did not need to give any special access to any push servers when using Groundwire. Only thing open on my firewall was PJSIP UDP Bind Port and RTP 10000-20000 that were already open… Now, If used internally on a LAN with phones connected to WiFI on the same LAN, I have no idea if that would work without internet access… Would need to be tested.

1 Like