Configuration of OutBound routes

Hello Good People,

I am having problems with Elasticx so I am trying to migrate into asterisk complied from source code.
Thus far, I have been able to create some extensions and establish local calls. Now, I want to route my calls outside. I am completely puzzled from where to start off…

I have two SIP providers:

From Provider A:

Outbound Settings
Peer Details:
type=peer
qualify=yes
port=5060
host=116.68.210.20
disallow=all
allow=g729&ulaw&alaw&gsm
dtmfmode=info
relaxdtmf=yes

Inbound Settings
User Details:
type=peer
qualify=yes
port=5060
host=116.68.210.20
disallow=all
allow=g729&ulaw&alaw&gsm
dtmfmode=info
relaxdtmf=yes
insecure=invite,port

From Provider B:
Peer Details
type=friend
qualify=yes
secret=password
host=10.11.30.7 --> IP address of a VoIP Gateway Device.
context=from-trunk
port=5060
dtmfmode=rfc2833
canreinvite=no
disallow=all
allow=ulaw

I am not getting any idea where to put these configuration that my SIP providers have provided me.
Please help.

Thank you.

Regards,
Ganesh

sip.conf See the sample sip.conf. This is all basic stuff.

Note that canreinvite is, at least, deprecated. no is default, but if you want to specify this you need to use directmedia.

context is not something that your provider can specify. That depends on the design of your dialplan. Unless you specifically want the two providers to be handled differently, they should either both have context or neither have context, relying on the general section, or the “default” context, instead.

Also, you should merge the inbound and outbound sections, as they relate to the same IP address.

Provider B will almost certainly be better as type=peer. In fact friend seems to be dangerous, as there is no authentication other than the IP address, in their case, and that will bypassed if you have friend and the attacker uses your sip.conf section name.

Provider A will require a register line and a secret - insecure=invite makes no sense without them.

insecure=port is unlikely to be necessary, and just increases insecurity.

Dear David,

I am really glad that you gave some time answering me. I admit that I am almost a beginner in Asterisk. Whatever the configuration I sent you, that was from the live Asterisk Server built in Elastix.
I don’t still understand why SIP Carrier A mentioned me to configure both Peer Details and Incoming settings (they provided), where SIP Carrier B mentioned me just to configure Peer details only.

For SIP Carrier A: We have a fiber connectivity and they have just passed a VLAN
For SIP Carrier B: We have 10 Analog lines terminated in a GrandStream PSTN Gateway.

What happens if you we just configure Peer Details for both the providers? And what is the significance of “Incoming settings” is Trunk section?

I am completely lost. Would you kindly provide me a solid material regarding the sip.conf configuration which would help me to build a solid foundation.
Thank you again David.
Hoping to hear from you soon.
Love from Nepal.

Ganesh Dhugnana

Having incoming and outgoing peers just causes confusion as Asterisk is quite likely to match incoming calls against the outgoing section. There may be cases where it is needed, e.g. you must make outgoing calls through an inbound proxy, but incoming calls come directly, in which case the host will be different.

Configuration is documented in the sample configuration files that come with the source code, and, to some extent, at http://www.asteriskdocs.org/. Explaining all the ins and outs of configuring Asterisk is beyond the scope of a peer support forum run by volunteers.