IF command with three conditions

buben
Joined: Tue 25 of Aug, 2015

IF command with three conditions

Posted:Tue 25 of Aug, 2015 (13:51 UTC)
Hello all,

do you know how to make IF command which will compare caller ID and if it start with 1 then add prefix 123, if 2 then prefix 234 and if it start with digit 3 then add prefix 345? For two option 1 and 2 it is easy but how to and third option?


exten => _0.,3,Set(suffix=${IF($[ ${CALLERID(num):0:1} = 1]?123:234)})    
exten => _0.,4,Set(CALLERID(num)=${suffix}${CALLERID(num)})    


Thank you in advance