SIP Trunk port not changing, keeps sending 5060

The problem is, I have set the SIP Trunk port to 5069, but in the debug, freepbx still sends 5060. Why is it sending 5060 and how can I get it to send 5069 instead which is what my provider is accepting. Thanks!


On my router:
5069 is forwarded to freepbx (SIP Port)
100000 - 20000 forwarded to freepbx (RTP ports)

In the debug,

I changed some numbers for privacy

the called number is 00027606001234
My external IP is
My extension is 200

My Trunk Settings:


Call Debug (abbrviated):


Connected to Asterisk 11.13.1 currently running on localhost (pid = 2013)

[2014-11-25 16:24:12] DEBUG[8552][C-0000d579]: chan_sip.c:6207 sip_call: Outgoing Call for 7606001234
[2014-11-25 16:24:12] DEBUG[8552][C-0000d579]: chan_sip.c:13085 add_sdp: ** Our capability: (ulaw|g729) Video flag: False Text flag: False
[2014-11-25 16:24:12] DEBUG[8552][C-0000d579]: chan_sip.c:13086 add_sdp: ** Our prefcodec: (ulaw)
[2014-11-25 16:24:12] DEBUG[8552][C-0000d579]: chan_sip.c:3367 initialize_initreq: Initializing initreq for method INVITE - callid [email protected]:5060
– Called SIP/SIPTrunk-2/7606001234
[2014-11-25 16:24:12] DEBUG[2288]: manager.c:5262 process_message: Running action ‘Command’
[2014-11-25 16:24:12] DEBUG[2086][C-0000d579]: chan_sip.c:4457 __sip_semi_ack: (Provisional) Stopping

retransmission (but retaining packet) on ‘[email protected]:5060’ Request 102: Found

[2014-11-25 16:24:12] DEBUG[2086][C-0000d579]: chan_sip.c:4378 __sip_ack: Acked pending invite 102
[2014-11-25 16:24:12] DEBUG[2086][C-0000d579]: chan_sip.c:4416 __sip_ack: Stopping retransmission on ‘[email protected]:5060’ of Request 102: Match Found
[2014-11-25 16:24:12] WARNING[2086][C-0000d579]: chan_sip.c:23019 handle_response_invite: Received response: “Forbidden” from ‘sip:[email protected];tag=as2afbd62d’

-- Executing [[email protected]:1] NoOp("SIP/200-0000219f", "TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 21 - failing through to other trunks") in new stack

[2014-11-25 16:24:12] DEBUG[8552][C-0000d579]: app_macro.c:434 _macro_exec: Executed application: Noop
[2014-11-25 16:24:12] DEBUG[8552][C-0000d579]: pbx.c:4883 pbx_extension_helper: Launching ‘Set’
– Executing [[email protected]:2] Set(“SIP/200-0000219f”, “CALLERID(number)=200”) in new stack

[2014-11-25 16:24:12] DEBUG[8552][C-0000d579]: res_rtp_asterisk.c:3308 ast_rtp_write: Ooh, format changed from unknown to ulaw
[2014-11-25 16:24:12] DEBUG[8552][C-0000d579]: res_rtp_asterisk.c:3343 ast_rtp_write: Created smoother: format: ulaw ms: 20 len: 160
[2014-11-25 16:24:12] DEBUG[8552][C-0000d579]: res_rtp_asterisk.c:3205 ast_rtp_raw_write: Starting RTCP transmission on RTP instance ‘0x7f86e06333f8’
[2014-11-25 16:24:12] DEBUG[8552][C-0000d579]: channel.c:3594 ast_settimeout_full: Scheduling timer at (50 requested / 50 actual) timer ticks per second
– <SIP/200-0000219f> Playing ‘all-circuits-busy-now.ulaw’ (language ‘en’)
[2014-11-25 16:24:12] DEBUG[8552][C-0000d579]: res_rtp_asterisk.c:4178 ast_rtp_read: 0x7f86e0cbc160 – Probation learning mode pass with source address
> 0x7f86e0cbc160 – Probation passed - setting RTP source address to
[2014-11-25 16:24:14] DEBUG[8552][C-0000d579]: channel.c:3594 ast_settimeout_full: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[2014-11-25 16:24:14] DEBUG[8552][C-0000d579]: channel.c:3594 ast_settimeout_full: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[2014-11-25 16:24:14] DEBUG[8552][C-0000d579]: channel.c:3594 ast_settimeout_full: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[2014-11-25 16:24:14] DEBUG[8552][C-0000d579]: channel.c:3594 ast_settimeout_full: Scheduling timer at (50 requested / 50 actual) timer ticks per second
– <SIP/200-0000219f> Playing ‘pls-try-call-later.ulaw’ (language ‘en’)
localhost*CLI> exit
Asterisk cleanly ending (0).

Your peer is telling you ‘Forbidden’.

Yes it is forbidden, because freepbx is sending on the wrong port

Debug says it is sending on 5060:
retransmission (but retaining packet) on ‘[email protected]:5060’

My Trunk Settings say to send on 5069:


Peer forbids because it is coming from 5060 instead of 5069

So why is freepbx sending on 5060 and how do I get it to send on 5069 instead?

You can not bind asterisk to more then 1 port. The bind port is defined in the SIP Settings module in FreePBX

Thanks Tony,

But I have used ports other than 5060 for other SIP Trunks … it should work. I don’t understand. I currently have working SIP trunks on ports other than 5060…

So if I change the Asterisk Bind Port, then do I have to change all my phones to also send SIP msgs to asterisk on 5069? Why cant I just have the SIP Trunk send messages to 5069

To clarify, the SIP trunk provider expects to rcv SIP msgs on 5069

Ah. In that case, I think it’s host= and then port=5069.

‘bindport’ is ‘what port am I listening on’

Thanks Rob!!! I will try that

Still getting “All circuits are busy now” but with a different error in the debug

Here are my new SIP Trunk settings


Debug error
[2014-11-25 22:32:32] WARNING[2687][C-000001a4]: app_dial.c:2437 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)

Thanks for everyones help with this. I don’t know how SIP Trunk providers sell any circuits without giving basic support for how to configure FreePBX or other most-common-in-the-world systems…

‘cause 20 - Subscriber absent’ means that asterisk wasn’t able to understand the host and port entry, and was trying to figure it out from the registration string.

Honestly, I wouldn’t waste your time, if your provider isn’t willing to help.

Did you know that the guys who pay me also run SipStation? And that’s what pays for FreePBX development? AND it’s going to work! There’s even a module for it 8)


1 Like


That is a good idea. I will give the provider one more chance tomorrow to get this setup, but I will definitely save the headache next time and use SIPstation.



I think there’s a misunderstanding here.


Is the entry to tell Asterisk what port to send calls out to. Your provider is going to use 5060. You can’t change that for them. Some providers have backup ports that also work. For example, allows you to use either 5060 or 5080. But, you cannot just pick a port for them to receive your calls. You must use the port that they have configured their equipment to work with.

With respect to the port that your system is going to use, i.e.


I don’t think you can set that on a per trunk basis. You set that in the Asterisk SIP Settings module, and it can only be one port. There’s really no reason to change it from the default of 5060.

Generally speaking, it should not be necessary to forward ports at all, unless you need to receive remote connections from phones. I recommend that you stop forwarding ports 5060 and 10,000 to 20,000 and see if your system works. If it does work (all 20 of mine do) without port forwarding, there’s no reason to do it and doing it exposes your system to significant security risks.

The only time that I’ve ever found it necessary to forward ports is (1) if you’re using a router that doesn’t function as most routers do or (2) you are receiving registrations from remote devices (i.e., a remote phone) or a remote FreePBX system. As long as you are registering to the external systems (i.e., you have a Registration String in your trunk settings), you shouldn’t need to forward any ports. And if you do need to forward ports, I’d recommend trying a different router…


Thank you for your reply.

You are correct, I did not need to forward any ports to make it work in the end.

All that nonsense about changing ports was pointless.

The real problem was this

The client uses Comcast Xfinity for internet (side note: worst customer service I’ve ever experienced)

  • New SIP Trunk service provided by BroadVoice

  • the client used xfinity provided Cisco Modem/wireless router

  • the cisco modem/router had SIP ALG enabled by default and it could not be disabled

  • the cisco modem router was required by the provider because client used static IPs and provider only allowed their own modem be used

  • tried to put the device into bridging mode and used clients own router, but it wasnt a true bridge and the SIP ALG was still on at the modem

After 9 hours on tech support, i was able to get them to replace the cisco modem router with an SMC device that had a better modem bridge setting and no SIP ALG

Passed the connection from SMC modem to clients Asus router (with SIP ALG disabled on it)

Works with no port forwards needed.

Also, had to change to DTMF to inband in FreePBX trunk settings to work for BroadVoice trunk

Thanks for everyones help on this post!

Ah, the old SIG ALG problem. Glad you found that. I always require my clients to use my recommended router, which is the Ubiquiti Edgerouter Lite.

P.S. Next time you are planning to come up to Orange County, send me a PM and we’ll get lunch… :slight_smile:

1 Like