[asterisk-users] blacklist/V* - using wildcard

Joseph syscon780 at gmail.com
Sat Apr 6 16:15:04 CDT 2013


On 04/06/13 14:38, Doug Lytle wrote:
>Joseph wrote:
>> exten => s,4,GotoIf($["${CALLERIDNUM}" = "V4*"]?blacklisted,s,1
>
>I don't believe so, you'd have to assign a variable to the first 2
>characters and test that variable for V4.  i.e.
>
>exten => s,1,Set(goaway=${CALLERID(number):0:2})
>exten => s,n,GotoIf($["${goaway}" = "V4" ]?blacklisted,s,1)
>exten => s,n,continue on with your normal processing
>
>[blacklisted]
>
>exten => s,1,Set(CDR(userfield)=Blacklisted)
>exten => s,n,Zapateller(answer)
>exten => s,n,Hangup(2)
>
>
>Doug

Thank you! Yes, this is working :-/ 

So if the: "Set(goaway=${CALLERID(number):0:2})" limits the caller ID string to 2-characters, isn't it?
If I set it to 10-characters: ...${CALLERID(number):0:10} can I test it for the first two characters only "V4" or it has to be string 10-characters long?

-- 
Joseph



More information about the asterisk-users mailing list