500 Internal Server Error When Dialing Int Extension

I had a working FreePBX 14 / Unifi VOIP running on an Odroid H2 for about four years, used as a fancy intercom inside my house / garage / workshop. No outside dialing needed. The H2 suffered a hardware failure, so I decided to setup the same version of FreePBX on another computer. Unifi VOIP is an odd duck, is the only thing supported by the phones I have, so I opted not to upgrade to the latest and greatest.

FreePBX is installed, but I am unable to activate it, says “Failed to connect to Network is unreachable”, even though the internet in general works, and I can ping / traceroute that IP.

Moving on, I created the extensions, updated the phone controller with the SIP user name / secret, and the phones register with the PBX. But whenever I try to to dial an internal extension, I get the message “500, Internal Server Error” on the phone itself.

Any ideas?

PC - HP T620 thin client, 16 Gb Flash drive, 4 Gb RAM
Phone - Unifi VOIP UVP-Executive.
VOIP Controller - Unifi Cloud Key, running Unifi VOIP

Can you please share a call trace via pastebin?


No calls are listed at all in CDR Reports. I think that means the phone’s dialing requests never hits FreePBX? I get the following in Asterisk → Peers

Name/username             Host                                    Dyn Forcerport Comedia    ACL Port     Status      Description                      
200                       (Unspecified)                            D  No         No          A  0        UNKNOWN                                      
210                       (Unspecified)                            D  No         No          A  0        UNKNOWN                                      
220                       (Unspecified)                            D  No         No          A  0        UNKNOWN                                      
3 sip peers [Monitored: 0 online, 3 offline Unmonitored: 0 online, 0 offline]

If your phone is ‘ofline’ then you have it set to connect to something that is not there. Check it’'s provisioning and it’s account settings.

It has the correct IP for the SIP server (FreePBX), and the username / password were copied and pasted right out of Extensions. Not sure what else it could be talking to.

If this is a brand new installation, then PJSIP is probably running on 5060. However, it looks like you have created ChanSIP extensions, which runs on a different port.

Is there any specific reason you want to use ChanSIP?

Older phones and VOIP system, wasn’t sure they would support PJSIP. I did change the default ports, PJSIP to 5160 and ChanSIP to 5060 in Settings → SIP Settings

Have you restarted Asterisk after changing the ports? What do you see in the Asterisk CLI when you attempt to register your phone?

I’m going to reinstall a new version of FreePBX. I did the most recent, and it dropped support for ChanSIP, which my UniFi VOIP phones don’t seem to support. At least all the documentation refers to using the ChanSIP ports. I’ll try again, with something recent, but not brand new.

It’s probably much less work to find out what is going wrong and fix it, than to start over with a ‘new’ system.

First, make sure that the extensions you created are pjsip. In Asterisk SIP Settings, pjsip tab, confirm that Port to Listen On for the UDP transport is set to 5060 (and if chan_sip is enabled, that Bind Port is set to something else). Restart Asterisk. Reboot the Unifi stuff. At the Asterisk command prompt (not a shell prompt) type
pjsip set logger on

This will cause SIP packets to appear in the Asterisk log, along with the regular entries.

If the devices do not show as registered, paste the Asterisk log for a registration attempt at pastebin.com and post the link here. If they are registered, paste the log for an attempted call.

Well, that seems to be the crux of the issue… PJSIP isn’t an option for these devices.

Why do you believe this is true?
And if it really is, please tell us why, so the developers can fix the big or add the missing feature.

A SIP phone has to only know the ip address/name of the server, the extension number, the password of that extension, and the protocol and port if your pbx is not listening on the extension’s understanding of default ( probably UDP/5060 ). It will never know (or need to know) what the SIP stack running on the server is.

1 Like

Because the support forums for the UniFi VOIP (UVP) phones explicitly say to use the ports for ChanSIP. When FreePBX changed them 5060 to 5160 for ChanSIP, it broke the UniFi installs. The fix is to reassign PJSIP to 5160 and ChanSIP to 5060. Or specifify port 5160 in the IP address of the SIP server

What do you mean by ‘installs’? If you are trying to replace an existing PBX (for example listening on port 5060), without touching the phones, I would set up pjsip extensions on the new system with the same extension numbers, configure it to use the same LAN IP address as the old, and set the values of ‘Secret’ on the new system to match those on the old.

You apparently did that, since the extensions registered ok, but get a 500 error when calling. Paste a log of the call attempt (including pjsip logger), and we can likely see the trouble and how to fix it. Also, let us know whether incoming calls also fail.

As I said, your unifi phones have no idea about what they are talking to, if they can only talk UDP/5060 and your PBX is answering using pjsip on UDP/5060, how will they know ‘not to work cos it’s pjsip’ :slight_smile: ?

Good point. I was just going off a forum post without understanding the underlying issues. I changed the SIP channel driver back to PJSIP, moved the ports back to 5060, deleted the existing users and extensions from FreePBX, then re-added the extensions and PJSIP extensions. Enabled logging, and after a reboot, everything connected. I can call other extensions, as well as use the group intercom / page, which is all I needed.

Thank you all for your assistance.

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