Page 1 of 1

multiple SIP accounts - first full, take next

PostPosted: Fri Oct 09, 2009 11:22 am
by phil_discount
Hello Guys,

i've got two SIP accounts.
one campaign should use both accounts, is one account full (10 lines), the other SIP account should be used.

any idea or a kind?

thanks
regards
Philip

PostPosted: Mon Oct 12, 2009 3:33 am
by phil_discount
for all which have a similiar problem:

i made a asterisk database entry:

Code: Select all
database put sipvar anzahl SIP1


for each call i change the db entry.
before a call is placed, asterisk checks the db entry and decides which sip account to use.

Code: Select all
exten => _99996.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _99996.,2,Set(WERT=${DB(sipvar/anzahl)})
exten => _99996.,3,GoToIf($[${WERT}=SIP1]?4:8)
exten => _99996.,4,Set(DB(sipvar/anzahl)=SIP2)
exten => _99996.,5,NoOp("SIP 1 DIALING")
exten => _99996.,6,Dial(${PROVIDER2}/${EXTEN:5},35,tTo)
exten => _99996.,7,Hangup
exten => _99996.,8,Set(DB(sipvar/anzahl)=SIP1)
exten => _99996.,9,NoOp("SIP 2 DIALING")
exten => _99996.,10,Dial(${PROVIDER1}/${EXTEN:5},35,tTo)
exten => _99996.,11,Hangup


Regards
Philip