返回列表 發帖

Failover trunk

本帖最後由 ckleea 於 2011-2-13 22:24 編輯

What is your favourite dialplan for a failover trunk setup so that if trunk 1 fails, dial via trunk 2?

Gladful if you can share

本帖最後由 ckleea 於 2011-6-18 21:27 編輯

Another trick:

This is to set up a remote trunk IP01 (asterisk 1.4) to dial my asterisk server (1.8) with gtalk and google voice out. The aim is to use specific GV account to dial out so that the caller ID will be correct.

In asterisk server set up a calling rule for the user at remote side

[CallingRule_usergv]
exten => _813XXXXXXXXXX,1,Dial(gtalk/user/+1${EXTEN:3}@voice.google.com)

user is set up in jabber.conf as

[user]
type = client
serverhost = talk.google.com
username = username@gmail.com/Talk
secret = password
port = 5222
usetls = yes
usesasl = yes
statusmessage = "Hi, I am user."
timeout = 100

AT IP01, since it does not have gtalk/jabber module. I have to bridge the call to my asterisk server and dial via an account belong to user i.e. maintain proper caller ID

I have a US calling rule as
exten=_001XXXXXXXXXX,1,Macro(superdial,SIP/813${EXTEN:3}@sipns,,m,,,1,,,,)
exten=_001XXXXXXXXXX,n,Macro(superdial,SIP/**1${EXTEN:2}@obitrunk,,m,,,1,,,,)
exten=_001XXXXXXXXXX,n,Hangup()

In this calling rule, when I dial a US number 0012345678900, the first line will change the number as 8132345678900 and pass to the sip trunk sipns; then my asterisk server responds and using callingrule_usergv, it then dials via a specific account as

gtalk/user/12345678900@voice.google.com

in my server CLI, I can use the call is made by user@gmail.com and hence its callerID is brought together.

TOP

Another type of speeddial with superdial macro is

exten => 348,1,Set(GLOBAL(speeddial)=xxxxxxxxx)
exten => 348,n,Macro(superdial,SIP/133${speeddial}@hkbn2b,,m,,,1,,,,)
exten => 348,n,Macro(superdial,SIP/pstn-spa3k-d1/133${speeddial},,m,,,1,,,,)
exten => 348,n,Macro(superdial,SIP/**8133${speeddial}@obitrunk,,m,,,1,,,,)
exten => 348,n,Macro(superdial,Datacard/datacard0/133${speeddial},,m,,,1,,,,)
exten => 348,n,Macro(superdial,Dongle/dongle0/133${speeddial},,m,,,1,,,,)
exten => 348,n,Hangup()

TOP

Important observation.
If I use the superdial macro in two asterisk machines, both machines allows superdial function. i.e. when the first asterisk passes to the second asterisk, the second one will also do superdial functions if this dialplan exists.

TOP

回復 58# 角色


    這個superdial 使用2 條 trunks,用SIP 和IAX,後者非常重要!

TOP

这个真的不错,真的学不少的东西。

角色

TOP

My new failover as follow

[CallingRule_UKCall]
exten => _44.,1,Macro(superdial,SIP/0${EXTEN:2}@pstn-spa3kuk-d1,,m,,,1,,,,)
exten => _44.,n,Macro(superdial,IAX2/ip01/90${EXTEN:2},,m,,,1,,,,)
exten => _44.,n,Hangup()

TOP

Mine is almost the same as following:

exten => 330,1,Macro(trunkdial-failover-0.3a,DAHDI/g0/1878200,SIP/**81878200@obitalk,,)

TOP

回復 54# bubblestar


    I use something like this for failover in speeddial

exten = 345,1,Macro(trunkdial-failover-0.3a,SIP/98765432@hkbn2b,SIP/98765432@pstn-spa3k-d1,hkbn2b,pstn-spa3k-d1)

TOP

Me too.

I'm thinking whether we can failover using more trunks in this respect.

TOP

回復 52# bubblestar


However, this is for normal dialing. For speed dial, you need other ways to deal with failover. I can only use 2 trunks per the default macro available from asterisk.

TOP

本帖最後由 bubblestar 於 2011-4-28 10:36 編輯

回復 49# 角色


   
In fact, I have similar settings as ckleea C-Hing.  One of the advantages is that we can failover to a NUMBER of trunks instead of only one spare trunk even you just have one single PSTN for outbound.  Of course, it will be more flexible if you have two or more on hand.

An efficient and less memory in dialing prefix is our another prime concern.  How painful you are if you have to memorize and differentiate 6 or 7 or more dialing prefix for just making a single call.

Super Dial is very suitable and especially for those people, like you, who has to make frequent calls to different areas.

SUPER!!!

TOP

There are other under considerations
1. Using other trunks e.g. H323 provided by other friends, sip trunk by other users
In this case, I need to hide the caller I'd
2. For IDD calling, choose the cheapest according to time,
3. Control number of concurrent calls per trunk

As suggested by Bubblestar Ching, simplify the code to remember for a certain function

TOP

回復 49# 角色


    It is five only. The reason behind is to test every possibility of outgoing call

TOP

回復 47# ckleea

My God! You have nine outbound trunks to make a Hong Kong PSTN call. Is there any failures found at the present moment?


YH

TOP

返回列表