SIP Trunking Mismatch

(Greg Kujawa) #1

So I tried changing the PJSIP port associated with my SIP trunking provider from 5060 to 6060. There were some issues on their end handling the change. So instead I limit my public port 5060 to just their network. And switched the PJSIP port back in FreePBX.

I can make outbound calls just fine, but inbound aren’t even making it to the FreePBX. Nothing in the pjsip debug or in the logs as to inbound routes.

Here is the trunk config on the FreePBX.

And when I look at the results of a pjsip show endpoints command, here is what I see for the SIP trunk. Note the udp transport that’s listed. Where is this coming from? I’ve rebooted the FreePBX after switching back to port 5060, and my SIP trunking provider is configured for port 5060 as well.

Endpoint: Twilio_Trunking Not in use 0 of inf
OutAuth: Twilio_Trunking/myfreepbx
Aor: Twilio_Trunking 0
Contact: Twilio_Trunking/sip:[email protected] e3329b4bf2 Avail 1.009
Transport: udp 3 96
Identify: Twilio_Trunking/Twilio_Trunking


did you change trunk origination port to 6060 on the twilio trunk?

(Greg Kujawa) #3

I did, although there still were problems. Now if I have my desk phones using PJSIP port 6060, but wanted to only have Twilio use PJSIP 5060 for trunking will this cause an issue?


its only one pjsip port for phones and trunks, i will share my config how i have done it


do you use also chan_sip ?

(Greg Kujawa) #6

Nope. Wanted to steer clear of that finally.

(Greg Kujawa) #7

Finally working now. Literally changed things back to what they were before, restarted things, and it’s working. Weirdness…lol.

(Jared Busch) #8

Did you do this the first time? Changing IP or port requires fwconsole restart or a reboot.

And before anyone wants to come in with a million other ays, yes there ae. but these are the “normal” methods. Normal users should either reboot or use standard fwconsole commands.

(Greg Kujawa) #9

Sorry about that. I was too vague. Yes, I restarted via fwconsole restart.

The root cause of the “weirdness” was the SIP provider could send me inbound calls via the non-standard SIP port I wanted and configured. But when I’m sending out calls to them, the standard SIP port 5060 is hard-coded on their end.

That’s what had me stumbling for a bit. So I configured PJSIP under Asterisk SIP settings to define the port as the non-standard one. But in the SIP trunk settings I had to flip it back to port 5060. Then inbound as well as outbound calls are working.

(Jared Busch) #10

Ok, this is not weird. This is normal.

You can only define and control half of a connection.

You can tell them that you are listening on any port you want. That is what you defined in the settings in FreePBX and then told the provider as much on the provider’s side.

Again, that is where you are listening. So that is where they sent you calls.

When it comes to sending calls to them, we’ll you have to send it where they are listening. You are not flipping anything back.

(Greg Kujawa) #11

Yes this makes perfect sense now. My mind was stuck in the days of T1’s where both sides had to align as to SF/ESF, B8ZS/AMI, etc. In this case I didn’t realize I could receive on a totally different SIP port than I’m sending to the SIP trunking provider. Thanks for the insight!

(system) closed #12

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