How to make a trunk in Asterisk 13 FreePBX to call to other SIP networks, a voip peering?

I have made a trunk to make calls within my sip group (i.e) Now I want to make calls to another sip network (i.e)

I know we need to make dedicate trunks for these, but I am not sure of the configurations that I should make.

For making calls with antisip I tried the context of the trunk as default or from-pstn. When I call from an extension to external antisip number, the call is connected but gets cut immediately. I am not sure what I am doing wrong here ? I have given the server name, port, username, secret and selected the codecs as ulaw and alaw. I have connected this to a outbound route with dialplans as 4XXXXXXX as the number which I am testing now is that. I gave a password to check if the outbound route works correctly and it works.

For making calls to fairytel, I am using a trunk with the same credentials but the context is from-sip-external. I have connected this to another new outbound route with a dialplan of 4NNNXNNNN1X which exactly matches my fairytel number. I am not sure, if I am going completely wrong somewhere or not ?

I have one provider, but a ‘from-trunk’ context works for me… Have not tried multiple providers.

The context you use for a peer trunk depends on your situation. If you want the call to arrive at the destination pbx and be handled as if it was dialed from the PSTN, then you use ‘from-trunk’. If you want the call to arrive at the pbx and be handled as if it was dialed by a local extension then you use ‘from-internal’.

Is it just me, or there is not enough references one can dig up, as to what context to use when setting up a trunk under FreePBX…? lands no FreePBX wiki page … at least not on first page of results anyway… :slight_smile:

I did some changes to make this work finally,

I setup a trunk with antisip credentials and another trunk with fairytel credentials The context in both cases were from-pstn and codecs were ulaw and alaw only. Later, I created two outbound routes.
One was called antisip-outbound and it has the dial pattern of fairytel in it (i.e) 479XXXXX and the trunks were in the order antisip and then fairytel. But, I think we don’t need antisip here. Then. I created another outbound route call fairytel-outbound which has the dial pattern of anti-sip (i.e) 431XXXXXXX. The trunks for this were fairytel first, then antisip.
Now, if I make a call from any extension, it knows if it should connect to the fairytel trunk or antisip trunk and makes the call correctly. This way, I got two different providers connected inside my freePBX.