FreePBX Behind Kamailio Registrar – Extension Routing Issue

That is completely incorrect. Dsip works with FreeSwitch (and FreeSwitch based systems), Avaya and other PBX systems. None of which use chan_sip or chan_pjsip since those are Asterisk only versions of SIP drivers. On top of that there is the whole Common Use Cases — dSIPRouter documentation pjsip trunking example they provide. So no, chan_sip isn’t required for trunking.

Dsip has supported chan_pjsip since Asterisk 13 release so if there is an issue like you said it’s existed for 12 years and that’s just not the case. The only issue I still see they say is untested is pass-through configuration in which Dsip is just there to pass the traffic between endpoints and Asterisk (i.e. proxy only) in which registrar/location and other things aren’t handled directly by Dsip but just routed through.

These claims that chan_sip must be used for X and chan_pjsip must be used for Y is just wrong because Dsip supports numerous PBX systems that use various SIP stacks.

FusionPBX. Uses port 5080 for Trunk and 5060 for extensions. So that’s straightforward. With FreePBX and chan_pjsip on 5060, it gets tricky. I’m holding back on some information I’m aware off. I know for a fact that as-is, dsip and FreePBX 17 don’t play nice yet and resolution of that is work in progress.

I’m specifically talking about situations where someone wants to use dsip for sip trunking AND proxying phone registrations

Such as?

Really? How is FreePBX v17 the actual problem in all of this?

That is a lot of information to digest. I have set up a dSIP VM with 2 CPUs, 8GB RAM and 80 GB HD. I kept my other Kamailio and RTPengine VMS, just powered them down. I am reusing the IP from Kamailio server on dSIP to ease some configuration on FreePBX. I have to admit some impatience. I thought that the install of dSIP was locking up so I changed OS types. Went with Debian 12 instead of Ubuntu 24.04.4. Turns out that I wasn’t waiting long enough as there were no indications that the install was proceeding. Guess I am used to seeing something spin (Windows). Either way, I have a fresh install of dSIP and am able to get into the web interface. Going to start testing this morning. If you have any insight that would be helpful, feel free to share. Thanks again.

@BlazeStudios I don’t know that I can say much more on this

Endpoints first. Note the ID of the created endpoint. Then create SIP domain and add the ID for the created endpoint.

Is part of that information about how broken their install process is? That they grab the latest 5.8.x release but have modules still on 5.8.4 from 2024 that break things? I’m trying to test this and I’m spending more time fixing their broken install than the install took.

The team is aware of that and they will be fixing it for v0.79

I think we should focus the OPs issue which is helping to get a working setup for them. We can discuss the pros and cons of dsip in an alternate thread

I have dSIP up and running with FreePBX connected, thanks all. The only issue right now is that only one phone will register. Once it does, none of the others will. First one wins, so to speak. Have you ran into this before?

You left the Match (permit) field blank for the extension endpoints, right?

Yep, Sure did.

So what does any debugging, sngrep, etc show when a second phone tries to register?

The first phone to register shows the internal IP of the PBX to the internal IP of the dSIP server. Both are on the same network for now.. The rest show the external interface of the dSIP server from and to.

Can I get some advice on the FreePBX setup side. How should my external interface be configured for dSIPRouter. Should FreePBX you the dSIP internal or external address? Or neither. I currently have my firewall external NAT’d to dSIP. Definitely confused.

I will have to look up my notes. In most cases where I’ve used dsiprouter, dsiprouter was internet facing while the PBX was not so I always used the Internal address.

You have some actual logs to show?

That is my setup. dSIP is NAT’d from the Internet via my firewall. FreePBX and dSIP are on the same internal network. So, basically I have Phones → Internet →dSIP → FreePBX. FreePBX (10.169.0.11), dSIP (10.169.0.3),and Phones (172.16.1.0/24)

What logs would help? I am new to this, sorry.

That is my setup. dSIP is NAT’d from the Internet via my firewall. FreePBX and dSIP are on the same internal network. So, basically I have Phones → Internet →dSIP → FreePBX. FreePBX (10.169.0.11), dSIP (10.169.0.3),and Phones (172.16.1.0/24).

SOLUTION:

Found the issue. It was in FreePBX → Settings-> Asterisk SIP settings ->SIP Settings (chan_pjsip) → Endpoint Identifier Order. I set it to Username, anonymous, IP and was able to register multiple phones. Rookie mistake, have never had to change that before. Now on to getting audio to work.

Update: Audio is working. Made some simple firewall policy changes. Now on to Auto Provisioning. Will it pass that through as well? You guys have been awesome. I truly appreciate all of the help. I literally spent weeks on this.

Just to keep whoever may need this in the future, here’s the update.

Setup a new VM and a fresh install of Debian 12 and FreePBX. Added new phones and am able to auto provision from FreePBX and Yealinks RPS service. If you use Yealink, I think it is worth giving it a try. One snag that I ran into was having to set my Sip Dest Address in the template to custom and using my external DNS address, probably could be IP as well. I also set the phone provisioning address to custom and gave it the url using this http://username:password@dnsaddress:84. This will all change, just testing for now.

Last hurdle is connecting an outside DID and configuring external calls. I have a trunk through SIPStation, but have been at a loss as to how to configure it. I am keeping notes on this to post my successes after, well AI is. Any help with the trunks would be very much appreciated. That is my last piece of the puzzle. Looked through videos and the site and couldn’t find anything useful. Thanks for all the help.

Jural