FreePBX | Register | Issues | Wiki | Portal | Support

Custom transport in PJSIP, possible from GUI?

(Avayax) #1

I would like to create a pjsip trunk, to which I want to assign a different external_signaling_address and a different bind port, different from the default 5060 and from default external IP address.
Reason is that I want to have two trunks, each going out a different WAN interface, therefore requiring different external addresses in the SIP headers.

This is possible in pjsip using different transports, but it doesn’t look like those can be configured from the GUI, can they?

The second transport should look something like this:


Can PJSIP use multiple ports
Multiple outgoing routes, per trunk nat settings
(Dave Burgess) #3

I’m gonna guess no, but I am by no way a definitive source.

The reason I’m guessing that is that I just don’t know how you’d set up the second transport through the GUI. Arguably, this is an unusual enough setup that the GUI probably hasn’t been stressed to this level yet.

Unless someone pops up and says “Oh sure, click ‘here’” I’d say put in a Feature Request to see if you can get it added.

(Tom Ray) #4

Yes, you can. You can create multiple UDP transports as long as they all have their own unique port.

(Lorne Gaetz) #5

At present I don’t see any feasible way of doing this at all with FreePBX. You can create a transport easily enough, by manually adding the necessary details to pjsip.transports_custom.conf, and you can confirm that the transport is created by the Asterisk output from pjsip show transports. But you can’t apply this transport to a PJSIP trunk (nor to an extension) directly from the GUI, so you must also manually create a PJSIP trunk then manually create dialplan to use the trunk. At that point, using the GUI you would create a trunk of type ‘Custom’ with an appropriate dial string that matches your dialplan.

This needs a feature request to allow users to create custom transports in Asterisk SIP settings.

edit - Having finished coffee #3, I realize there is a feasible way to do this. Create a new PJSIP transport in pjsip.transports_custom.conf:


From the Asterisk CLI confirm it is working:

core reload
pjsip show transport TESTING

In the file pjsip.endpoint.conf locate the endpoint associated with the trunk you want to change, and note the name in square brackets. Then create something like the following in pjsip.endpoint_custom_post.conf using the name that matches your trunk:


.Then check the transport line from the Asterisk CLI:

core reload
pjsip show endpoint pjsip-test-trunk

ATT IP Flex VoIP Nearly Working
Problems with SIP calls dropping outside of local network
(Avayax) #6

That works, great!
I still opened a feature request, as having this as a GUI feature would be more elegant.

Last question, those _custom_post.conf files are there to override or add settings that have been written by the GUI into the equivalent .conf files owned by FreePBX?
Where is the difference between _custom_post.conf and _custom.conf files, and what does the (+) do in [pjsip-test-trunk](+)?

(Dave Burgess) #7

Yes. The _post file gets processed last and the not _post file gets processed first.

[quote=“avayax, post:6, topic:45812”]Where is the difference between _custom_post.conf and _custom.conf files, and what does the (+) do in pjsip-test-trunk?
The plus sign says to extend the existing context instead of the Asterisk default of ignoring the conflicting/duplicate context.