D.37. FILTER()

FILTER(erlaubte Zeichen,String)
Filtert den String, sodass nur noch die erlaubten Zeichen im Rückgabewert vorkommen.
; nur die Zeichen 0123456789 in ${cdrnum} zulassen:
exten => 123,1,Set(foo=${FILTER(0123456789,${cdrnum})})
Asterisk-Versionen:
        |     |        | 1.4 |————————| 1.6 |————————
Interner Hilfetext zu dieser Funktion in Asterisk 1.4:
  -= Info about function 'FILTER' =-

[Syntax]
FILTER(<allowed-chars>|<string>)

[Synopsis]
Filter the string to include only the allowed characters

[Description]
Not available
Differenz des internen Hilfetexts von Asterisk 1.2 zu 1.4:
— in Asterisk 1.2 nicht vorhanden —
Differenz des internen Hilfetexts von Asterisk 1.4 zu 1.6:
--- in Asterisk 1.4
+++ in Asterisk 1.6
@@ -1,10 +1,15 @@
     -= Info about function 'FILTER' =-

   [Syntax]
-  FILTER(<allowed-chars>|<string>)
+  FILTER(<allowed-chars>,<string>)

   [Synopsis]
   Filter the string to include only the allowed characters

   [Description]
-  Not available
+  Permits all characters listed in <allowed-chars>, filtering all others out.
+  In addition to literally listing the characters, you may also use ranges of
+  characters (delimited by a '-'), as well as hexadecimal characters started
+  with a \x (i.e. \x20) and octal characters started with \0 (i.e. \040).
+  Also, \t, \n, and \r are recognized.  If you want a literal '-' character,
+  simply prefix it with a '\'