Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] How to balance traffic between 2 gateways ?


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
atis at iq-labs.net
Guest





PostPosted: Thu Feb 07, 2008 11:00 am    Post subject: [asterisk-users] How to balance traffic between 2 gateways ? Reply with quote

On 2/7/08, Olivier <oza-4h07 at myamail.com> wrote:
Quote:
Hi,

Is it possible and safe to split or balance outgoing calls to 2 different
sip-to-tdm voice gateways ?

I need 5 E1 ports and the boxes have 4 ports each.
Setup would be :

PSTN --<1xE1>-- Gateway1 ---<2xE1>---- PBX ---- TDM phones
|
LAN ------------------ Asterisk ----- SIP
Phones
|
PSTN --<1xE1>-- Gateway2 ---<1xE1>---- PBX ---- TDM Phones

Regards


Sure:

context dial-out {
_X. => {
if ("${GROUP_COUNT(gw2)}">"${GROUP_COUNT(gw1)}") {
Set(OUTBOUND_GROUP=gw1)
Dial(SIP/${EXTEN}@gw1)
} else {
Set(OUTBOUND_GROUP=gw2)
Dial(SIP/${EXTEN}@gw2)
}
}
}

Regards,
Atis

--
Atis Lezdins
VoIP Developer,
IQ Labs Inc.
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Work phone: +1 800 7502835
Back to top
anthonyf at rockynet.com
Guest





PostPosted: Thu Feb 07, 2008 1:27 pm    Post subject: [asterisk-users] How to balance traffic between 2 gateways ? Reply with quote

Atis Lezdins wrote:
Quote:
On 2/7/08, Olivier <oza-4h07 at myamail.com> wrote:

Quote:
Hi,

Is it possible and safe to split or balance outgoing calls to 2 different
sip-to-tdm voice gateways ?

I need 5 E1 ports and the boxes have 4 ports each.
Setup would be :

PSTN --<1xE1>-- Gateway1 ---<2xE1>---- PBX ---- TDM phones
|
LAN ------------------ Asterisk ----- SIP
Phones
|
PSTN --<1xE1>-- Gateway2 ---<1xE1>---- PBX ---- TDM Phones

Regards



Sure:

context dial-out {
_X. => {
if ("${GROUP_COUNT(gw2)}">"${GROUP_COUNT(gw1)}") {
Set(OUTBOUND_GROUP=gw1)
Dial(SIP/${EXTEN}@gw1)
} else {
Set(OUTBOUND_GROUP=gw2)
Dial(SIP/${EXTEN}@gw2)
}
}
}

Regards,
Atis


Old variable syntax but this flips which gateway is used with every
call, and fails over to the other line in the event of any negative
status return, of course it could be cleaner, if both gateways where
down this would make an infinite loop.

[macro-lb]
; ${ARG1} - PhoneNumber
exten => s,1,GotoIf($["${LOADBALANCE}" = "0"]?5)
exten => s,2,SetGlobalVar(LOADBALANCE=0)
exten => s,3,Dial(${TRUNK_DENVER}/${ARG1})
exten => s,4,Goto(s,6)
exten => s,5,SetGlobalVar(LOADBALANCE=1)
exten => s,6,Dial(${TRUNK_DENVER2}/${ARG1})
exten => s,7,Goto(s,3)

--
Thank you and have a wonderful day,

Anthony Francis
Rockynet VOIP
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services