Synopsis:
Filter the string to include only the allowed characters
Description:
FILTER(<allowed-chars>,<string>) – Asterisk 1.6 and later
FILTER(<allowed-chars>|<string>) – Asterisk 1.4
Notes
- *CLI> show function FILTER
Return value
Returns the resulting string.
Examples
exten => s,1,Set(foo=${FILTER(0-9,${cdrnum})}) – Asterisk 1.6 and later
exten => s,1,Set(foo=${FILTER(0123456789|${cdrnum})}) – Asterisk 1.4
Note: ISDN (Q.931) only permits ASCII characters (more precisely: the IA5 character set) as CallerID name.
Starting with Asterisk 1.6.0, FILTER permits the use of a range, as well as hexadecimal (specified as \xNN), octal (specified as \0NNN), and the usual control characters (\t, \r, and \n). A literal dash may be used either by prefixing it with a backslash or by encoding it in hexadecimal (\x2d) or octal (\055). A literal comma can likewise be encoded as \x2C or \054.