[asterisk-users] my "blacklist" is not working

Joseph syscon780 at gmail.com
Wed Apr 10 11:35:24 CDT 2013


On 04/10/13 08:29, Matthew Jordan wrote:
>On 04/09/2013 09:14 PM, Joseph wrote:
>> On 04/09/13 19:27, Joseph wrote:
>>>
>>> exten => 4,n,Set(goaway=${CALLERID(number):0:2})
>>> exten => 4,n,GotoIf($["${goaway}" = "V4" ]?blacklisted,s,1)
>>> exten => 4,n,GotoIf($["${goaway}" = "V3" ]?blacklisted,s,1)
>>>
>>> But the first line suppose to compare the caller "ID" to the one in
>>> database and jump to "blacklisted,s,1" context.
>>
>> The reason it wasn't working as I had in database: "Manitoba" and the
>> caller id this time was: "Manitoba " there was a space after the last
>> letter, that is why it wasn't working.
>> Is there a way to counter/eliminate or do wildcard for "space"?
>>
>
>Instead of doing an explicit comparison, you could always use a regular
>expression to perform the matching:
>
>https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Function_REGEX
>
>Matt
>
>-- 
>Matthew Jordan
>Digium, Inc. | Engineering Manager
>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
>Check us out at: http://digium.com & http://asterisk.org

Thank you Matt for the pointer.
I need your help with it, how can I incorporate it into the dial plan?

In my case:
exten => 4,1,Set(goaway=${REGEX("[Manitora ]"  ${CALLERID(number))})
should return "1" if the caller id is "Manitoba" or "Manitoba "

What is next?

-- 
Joseph



More information about the asterisk-users mailing list