Hello,
I’m trying to make an extension to check for the 1st digit on the Caller ID, so I can decide what the origin is and send it to a point or another based on previous decisions that do not matter for the issue.
So far, I’ve got this:
902918092 => {
NoOP(Entering the system);
Answer();
Playback(bienvenida);
Read(DIGITOS,15,2,10);
NoOP(The A number is ${CALLERID(num)});
if("${CALLERID(num)}"=""){
Playback(goodbye);
Hangup();
}
//else NoOP(Origen Oculto, no puede llamar);
//TODO informar sobre el numero oculto.
if("${CALLERID(num)}:0:2"="9"){
goto DISA902_Fijo,${DIGITOS},inicio;
}
if("${CALLERID(num)}0:2"="6"){
goto DISA902_Movil,${DIGITOS},inicio;
}
if("${CALLERID(num)}:0:2"="8"){
goto DISA902_Fijo,${DIGITOS},inicio;
}
However, it is not working at all.
Been doing some research and tried all of the possible syntaxes with " and : and everything, got no luck.
Also tried some debugging old way, and setted up a variable that would have the value ${CALLERID(num)}:0:2, however, no matter what the numbers before and after the : are, the variable is always 0, hence the Gotos are not being used and the calls get terminated.
Could I get any help?
Thanks!