Asterisk func filter

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.

See also


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.

See also


Created by: murf, Last modification: Tue 01 of Jun, 2010 (22:54 UTC) by JustRumours
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+