After setting up some extensions on my FreePBX instance, I attempted to call one extension (registered via a desk phone attached to a Grandstream adapter) from another (registered via Linphone on my mobile device). I just got a “service unavailable or network error” message. I tried a few times, same result.
I then went to my desk phone, and dialed the extension for my softphone. This actually worked, and I picked up the call. Audio worked in both directions. I then hung up, and attempted a call from my softphone again. This time it worked. I’ve tried multiple times again since, and it continues to work.
Both my phones/extensions were dialing/receiving on the same network (my local home network) behind the same router. So I don’t think this is a simple issue of the deskphone call punching a port open through my router, which then allowed my softphone to work.
Like I said, it seems to be working now, but wondering if anyone has any insight as to what may be happening, in case this is an issue which returns or indicates some nuanced misconfiguration somewhere.
Did you change the standard PJSIP ports at some point? Run core restart now in Admin > Asterisk CLI to ensure those changes have been applied - you won’t get any output so only send it once, check System Logfiles if you want to see what happened. When you make test calls, first check both extensions are showing as Available in Reports > Asterisk Info. If not, then start looking at the local network rather than FreePBX itself. System Logfiles are useful to you, especially for a basic setup and it’s a good idea to get used to looking at them often while things are fairly quiet. Check Settings > Asterisk Logfile Settings > Log Files > full > Verbose: 4 > Save. Also, ensure SIP ALG is disabled on your router, it will cause the weird intermittent results you describe.
Try to reproduce it and share the sngrep screenshots when it’s failing, if you can share the Asterisk logs with pjsip logger enabled that would be great as well.
I never changed the standard SIP ports, no. I am using TLS encryption with my signed cert, so would be using port 5061.
I have OpenWRT on my router, which doesn’t have any SIP ALG module by default.
If this problem comes up again, I will remember to grab the asterisk logs. I was tooling around in my shell with “asterisk -rvvv” with pjsip logging on at various points, but don’t remember if I was doing so at that particular point, and if I was, I didn’t think to save the logs. My mistake for sure.
On the softphone on your cell, Did you set the domain/server as your LAN IP Address, or your external public IP ?
If your WiFi is on and connected to your local network, but you have a public IP as the pbx server in the soft phone, that is the error you will get as the phone is attempting to use WiFi first as a priority, and already inside of your network.
The same applies in reverse, If you put in a LAN IP address but did not have the WiFi on the phone tunred on, it will not connect.
I was using either the public IP address, or the domain I eventually configured. On that note though, based on the experience of a friend who I was having help me test things, I have an (unprovable) hunch as to what was happening. The particular softphone we chose (Linphone) lets you redial previous attempts. So I am thinking its possible that between various reconfigurations and tweaking things, the unsuccessful dials were due to accidentally using a redial from an old/invalid config.
This would explain my initial observation, where it suddenly worked after I dialed from the deskphone first. Since then, the redial would be using the connection as it came in from the deskphone, which would necessarily have the right settings.