Upgrade 3CX to v18 and get it hosted free!

Asterisk func filter

Author image

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


Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.