Multiple outgoing routes, per trunk nat settings

Hi,
I have trying to set up a more complciated system than I normally, would. We are trying to simplify our companies phone system and move from some analog based systems.
I have multiple internet gateways and need to send my SIP traffic to various providers via different connections. I dont get a choice to register with each trunk I have to go over their hardware/network.
is it possible to set per trunk NAT external IP addresses? we need one of our numbers, (I cant escape this contact yet) to register over a specific low bandwith connection whilst I have a fast connection some where else.
The sip UI only allows one out going NAT to be described, all the routing works fine.

Not in chan_sip, but in PJSIP it is possible.

You have to define different transports for each pjsip endpoint (trunk) that you want to send traffic out a different WAN interface for. And the bind address for each transport must specify a different port for each external IP address used.
In a transport section you can specify your “external_media_address=” and your “external_signaling_address=” for each endpoint.

Now I don’t see how to “set external_signaling_address” per transport on FreePBX GUI.
Maybe I am missing it or it’s not possible. If not, I would configure the trunks in pjsip_custom.conf manually.
In Trunks/PJSIP settings/general you can set a SIP port on FPBX GUI, but I don’t know if that is the setting you would need.

But maybe it’s all possible through the GUI, then forget below info.

[transport-udp-provider1]
type=transport
protocol=udp
bind=0.0.0.0:your sip port 1
local_net=192.0.2.0/24
local_net=127.0.0.1/32
external_media_address=xxx.xxx.xxx.xxx
external_signaling_address=xxx.xxx.xxx.xxx

[transport-udp-provider2]
type=transport
protocol=udp
bind=0.0.0.0:your sip port 2
local_net=192.0.2.0/24
local_net=127.0.0.1/32
external_media_address=xxx.xxx.xxx.xxx
external_signaling_address=xxx.xxx.xxx.xxx

You would have to configure all the other pjsip sections too, like endpoint, aor, auth, registration, etc.
https://wiki.asterisk.org/wiki/display/AST/Configuring+res_pjsip+to+work+through+NAT
https://wiki.asterisk.org/wiki/display/AST/PJSIP+Configuration+Sections+and+Relationships

thank you got it working!

Ben,

Can you document how you got it working?

Thanks