Grandstream, Asterisk, and PJSIP. Are they compatible?

I’ve been reading that CHAN-SIP will be going away and that we should be changing everything to PJSIP so I started looking at my FreeBPX 15.0.23 system and Grandstream GXP2010 phones. I see my Asterisk is set for Default TLS port assignment for Chan Sip. I see my extensions are all set for ChanSip as well. I thought I should change the extension to PJSIP however when I do, I seem to lose all contact with the phone. When I open the configuration on the 2010 phone I don’t see a PJSIP option so that makes sense that they aren’t talking.

Does this mean that we’ll soon need to replace all of our phones and reconfigure them all? It’s my understanding that CHAN sip isn’t supported and is going away. Is that wrong?

SIP is SIP. The PJSIP channel driver is just a different implementation of SIP. It works fine with Grandstream phones and there are people using it with them. You shouldn’t need to replace your phones. It is almost always an issue of configuration.

2 Likes

No. you don’t need to replace all you phones, you should however consider moving all of them to using TLS transport (if they support it) to your chan_pjsip driver on the port of your choice, using 5061 is usually the least fretful.

1 Like

But I’m reading that CHANsip is depreciated and may be removed from future versions of FreePBX. I read in other threads where they’re warning people to move to PJSIP so they don’t have issues when that happens.

When you say SIP is SIP, you’re saying I can just leave the phone the way it is with SIP registration by just changing the port to the PJSIP port? And only change the settings to PJSIP on the FreePBX server itself?

I went ahead and tried this. It didn’t work. The phone couldn’t register.

PJSIP is more flexible, but FreePBX will set the parameters as needed (most of the time). Connections to service providers is a horse of a different color. It was always a pain in the neck.

Yes. That is what I’m saying.

I changed the port on the phone to 5061 and left everything else the same. Then I changed FreeBPX to PJSIP and the port to 5061, submitted and applied, then rebooted the phone. It was unable to connect to FreePBX. Looking at FreePBX I see the port setting is handled by PJSIP so my 5061 isn’t visible any more but should be correct.
Since the phone couldn’t connect I changed everything back and rebooted the phone which now works normally again. I must be missing something.

This is exactly what i did as well, and did not work.
I had to revert back to ‘legacy’ chan_sip.
I had a sangoma tech as well assist me, and we couldn’t figure out why it wasn’t working. Didn’t spend too much time on it since we had a migration in process, but i’m running both grandstream and cisco phones and they all wouldn’t register, so i’m sure it’s a configuration problem, just not sure where.
Would be nice to find an answer to this one.

1 Like

Uhm. What port is chan_pjsip listening on? This works just fine.

Actually I’m happy to hear it’s not just me, especially since you had a tech from Sangoma involved.

What port is chan_pjsip listening on for your system?

I set the port to 5061 on the Grandstream.

I didn’t ask about the Grandstream. What is the port chan_pjsip is bound to in FreePBX?

How many places is the port set? On the phone it’s set to 5061. In the Settings-Asterisk Sip Settings it’s set to 5061. Is there another place I should be looking too? The port goes away on the Extensions-advanced tab the port goes away when it’s set to pjsip.

You may find this brief tutorial helpful: Ports, and the endless confusion they cause

You need to go into Settings → Asterisk SIP Settings → Chan_PJSIP and see what port it is bound to. FreePBX binds Chan_PJSIP to 5060 for UDP and 5061 for TLS. Chan_SIP is bound to 5160 and 5161.

Are you both using TLS and this is why you keep setting the port to 5061? Did either of you change these bind ports? Is Chan_SIP listening on 5060?

Just saying “I put 5061 in the phone” doesn’t tell us anything if we don’t know what ports are listening for what on FreePBX.

Thanks. There was nothing new in that post for me unfortunately. The Grandstream doesn’t want a IP:Port format. The references to trunks was irrelevant since it’s the extensions that we’re working on.

What Grandstream is this? Because I’ve had no problems with setting a port on current Grandstreams.

The concept of “trunks” and “extensions” is for you not the PBX. An endpoint is an endpoint. To the PBX your trunk is the same as an extension with the only difference being how it handles auth and the direction of said auth.

Ah. This might be helpful. My FreePBX is set to port 5061 which appears to be the default, but I’m using UDP so it should be 5060. If I try to change it to port 5060 it reports a conflict with SIP Port.

But since FreePBX is showing 5061 for pjsip shouldn’t the phone still connect if the port in the phone is also set to 5061?
You said CHAN_SIP is set to 5160 and 5161 but mine are at 5060 and 5061 and no, I haven’t changed them that I can recall. The help ? button shows that 5060 was the default.

The Grandstream 2010 doesn’t have any TLS option on it that I can find. The phone was set to 5060 and working with CHAN_SIP. The port in FreeBPX for CHAN_SIP is set to 5060 for non TLS

Frankly I think you should go back and read it again because you seem quite confused.