(2 - user rating)

User Rating: 2 / 5

Star ActiveStar ActiveStar InactiveStar InactiveStar Inactive
 

HI i had found  it extreemlly hard trying limit outbounds channels in GoogleVoice since the channels doesnt offer counting.   So i decided to make it easier for everyone else :)

 

I have done my example using Global Variables.

 

 

 

exten => h,1,Set(GLOBAL(${thetrunk})=0)  ;  on hangup mark trunk not in use
exten => h,n,Verbose(0, getting staus Dialstatus ${DIALSTATUS}  priority ${goto} ${thetrunk} = ${${thetrunk}}     )

exten => _1NXXNXXXXXX,1,Set(GROUP()=This email address is being protected from spambots. You need JavaScript enabled to view it.)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = ""]?15:)

exten => _1NXXNXXXXXX,15,Set(goto=$[${PRIORITY} + 15])   ;  handles prioritys
exten => _1NXXNXXXXXX,n,Set(thetrunk=gv2)   ; sets trunk name
exten => _1NXXNXXXXXX,n,GotoIf($[${${thetrunk}}  > 0]?${goto})  ;   if trunk is in use go to next gv
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=1)   ;  trunk is marking inuse
exten => _1NXXNXXXXXX,n,Dial(Motif/This email address is being protected from spambots. You need JavaScript enabled to view it./${EXTEN}@voice.google.com,,r)  ;  yay dialing out
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=0)  ; if call failure mark trunk not in use
exten => _1NXXNXXXXXX,n,Verbose(0, getting staus ${DIALSTATUS} );
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "SUCCESS"]?hangup:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "FAILED"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "NOANSWER"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CANCEL"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "HANGUP"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "UNKNOWN"]?${goto}:)

exten => _1NXXNXXXXXX,30,Set(goto=$[${PRIORITY} + 20])
exten => _1NXXNXXXXXX,n,Set(thetrunk=gv3)  
exten => _1NXXNXXXXXX,n,GotoIf($[${${thetrunk}}  > 0]?${goto})
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=1)
exten => _1NXXNXXXXXX,n,Dial(Motif/gv3/${EXTEN}@voice.google.com,,r)
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=0)
exten => _1NXXNXXXXXX,n,Verbose(0, getting staus ${DIALSTATUS} );
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "SUCCESS"]?hangup:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "FAILED"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "NOANSWER"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CANCEL"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "HANGUP"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "UNKNOWN"]?${goto}:)