[asterisk-users] multiple host in 1 context on sip.conf

Johansson Olle E oej at edvina.net
Thu Feb 14 03:35:11 CST 2008


Hi Mark!

13 feb 2008 kl. 23.42 skrev Mark Quitoriano:

> Is it possilble for a single context to have multiple host=  
> something like this
First "context" is something we use to describe a segment of the  
dialplan. I would call this "section".


>
>
> [carrier]
> host=<ip address1>
> host=<ip address2>
> host=<ip address3>
> type=peer
> disallow=all
> allow=g729
> allow=ulaw
> canreinvite=no
> insecure=yes
> qualify=yes

No. You can only add one.

Normally I would add host=sip.mydomain.com and have multiple DNS  
entries or use SRV records to do failover and such,
provided you use this for outbound calls.

Since you call this peer "carrier" I assume you want to handle inbound  
calls. Today, you will have to define three different
peers, but remember that you can use templates.

[carrier](!)
type=peer
disallow=all
allow=g729
allow=ulaw
canreinvite=no
insecure=yes
qualify=yes

[carrier-01](carrier)
host=<ip address1>

[carrier-02](carrier)
host=<ip address2>

[carrier-03](carrier)
host=<ip address3>

You will now have three peers named carrier-01-03 but no peer named  
"carrier" in your sip driver when you run "sip show peers".

Regards,
/Olle


---
* Olle E. Johansson - oej at edvina.net
* Asterisk Training http://edvina.net/training/






More information about the asterisk-users mailing list