Call Routing Help

i need one help i have total 3 sip gsm gateway/ those are like GW1 /GW2 and GW3
i want to send call those 3 device equally with single prefix i mean to say i want to send call with 0 prioroty so those device call pass with single prefix equally now if i make single prefix than first hit call to gw1 then gw2 then gw3 but i want to pass call randomly can any one help me about it please

context from-server {
_01X. => {
Dial(SIP/GW1/${EXTEN});
Dial(SIP/GW2/${EXTEN});
Dial(SIP/GW3/${EXTEN});

            Hangup();
            }

}

now i passed call like this on extenstions.ael i want to send call randomly with 3 device

Use the RANDOM function, in a switch, or you could use nested random statements.

Note very few people use AEL and I had to do some looking up, which I might have got wrong.

AEL is great fun! Here are some examples using random key word in AEL.

TIL switch has a pattern.

random != equal – but it is probably ‘good enough.’

Increment with modulo (or an if statement) may be another avenue.

Also, what to do if a gateway is busy?

you can set dialplan like this with function RAND:
exten => s, n, Set(randgw=${RAND(1,2,3)})

and then ExecIf() …

The OP is using AEL, so whilst one probably could use ExecIF, it would be mixing to different ways of coding conditional execution.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.