Outgoing call context

My provider says that he bring me access to his lines trough internet. There are no trunks. It authorizes me with my external ip and phone number.
I wrote custom extention
exten => _XXXXXXXXXX,1,Dial(SIP/[email protected]_HOST:PORT)
and trying to make call:
Executing [[email protected]:1] ResetCDR(“SIP/1100-0000197b”, “”) in new stack
Asterisk put my call to from-internal and can’t forward it more.
What i need to do to tell asterisk that this call it need forward to provider sight?

You’ll still need to create a trunk in FreePBX with sip settings similar to below:

host=FQDN or IP address of your provider
nat=no ;depends on if your PBX is NAT’d or not. If NAT’d, put nat=yes

I need to create trunk with registration string? In such case trunk isn’t registering and asterisk say that all lines are busy.


No register string, but you do have to tell your system where to send calls, which is the host=_IPADDRESS_ section of that information.

This would go under Connectivity > Trunks > select existing or create new trunk > SIP settings > Outgoing > PEER Details

For Trunk Name choose something that makes sense, like Provider_Out or whatever makes sense to you, so when looking at logs, you know what it is.

Some things you’ll need to have:

  1. You need to know your IP addresses. If your PBX has a routable address as it’s primary connection to the Internet, you will need to set up a trunk and the Integrated Firewall. If not (if you have a NAT firewall or router that’s providing Network Address Translation services), you will need to have your PBX’s local IP address (probably starting with 192.168.x.x or 172.16.x.x or 10.0.x.x) as well as the external address of the router.

  2. You need to know where your phones are. If they are outside your LAN, you will need the addresses of those phones. If they are in your local LAN, you will need to make sure they can “see” the PBX. The Integrated Firewall will help you make sure these are set up correctly.

Set up your “peer” settings in the trunk using the following:

host=IP address of your provider

With that in the “peer” section, you will set up a bidirectional trunk to your provider. You do not need anything else in the trunk. Leave the USER section and the Registation section blank.

Next, you will need some inbound routes so that the calls your provider sends have a place to land. Set up your first inbound route as an “any/any” route (no Direct In Dial and no Caller ID settings) and send them to a destination. The second inbound route will be for your actual phone number. This, by the way, is what he meant by address and phone number.

Next, you will need an outbound route that tells your PBX that all calls not intended for an extension should be sent out “over the wire”. Point it at your Trunk.

With those three (or four, depending on what you count) pieces in place, you should be good to go.

Thank for your help.
I create trunk with no registration string and this settings:
and peer now registering.

Another problem that - Executing [[email protected]:5] Playback(“SIP/1100-00002179”, “silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer”) in new stack even when i create
outbound route with i think proper dial patterns:
XXXXXXXXXX (0442908000)
XXXXXXX (7004040)

A ‘type=friend’ trunk is a shorthand for both incoming (for the Peer) and outgoing (using these settings as the User). A User trunk needs to have an incoming context. Obviously, you can’t control the context at the other end, so there’s no need for a Peer context.

So, if you can add an inbound (User type) context (like ‘from-trunk’), you should be all set.

Remember, in spite of the fact that they are defined in a single configuration stanza as a “friend” type, they are still separate connections. Inbound and outbound trunks are for almost all intents separate.

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