]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix FILTER() examples to work in 1.4
authorTim Ringenbach <tim.ringenbach@gmail.com>
Tue, 4 May 2010 17:40:59 +0000 (17:40 +0000)
committerTim Ringenbach <tim.ringenbach@gmail.com>
Tue, 4 May 2010 17:40:59 +0000 (17:40 +0000)
Review: https://reviewboard.asterisk.org/r/644/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@260887 65c4cc65-6c06-0410-ace0-fbb531ad65f3

README-SERIOUSLY.bestpractices.txt

index 0e2af3b4a407635a5b515fedb3a6f52b43970eb4..60381c242ca58735f02d30a3a498fd8bee1d40b0 100644 (file)
@@ -121,7 +121,7 @@ we will accept to just numbers. Our example would then change to something like:
 
 [incoming]
 exten => _X.,1,Verbose(2,Incoming call to extension ${EXTEN})
-exten => _X.,n,Dial(SIP/${FILTER(0-9,${EXTEN})})
+exten => _X.,n,Dial(SIP/${FILTER(0123456789,${EXTEN})})
 exten => _X.,n,Hangup()
 
 Note how we've wrapped the ${EXTEN} channel variable with the FILTER() function
@@ -135,7 +135,7 @@ necessary, and to handle error checking in a separate location.
 
 [incoming]
 exten => _X.,1,Verbose(2,Incoming call to extension ${EXTEN})
-exten => _X.,n,Set(SAFE_EXTEN=${FILTER(0-9,${EXTEN})})
+exten => _X.,n,Set(SAFE_EXTEN=${FILTER(0123456789,${EXTEN})})
 exten => _X.,n,Dial(SIP/${SAFE_EXTEN})
 exten => _X.,n,Hangup()
 
@@ -146,7 +146,7 @@ passed back by FILTER(), and to fail the call if things do not match.
 
 [incoming]
 exten => _X.,1,Verbose(2,Incoming call to extension ${EXTEN})
-exten => _X.,n,Set(SAFE_EXTEN=${FILTER(0-9,${EXTEN})})
+exten => _X.,n,Set(SAFE_EXTEN=${FILTER(0123456789,${EXTEN})})
 exten => _X.,n,GotoIf($[${EXTEN} != ${SAFE_EXTEN}]?error,1)
 exten => _X.,n,Dial(SIP/${SAFE_EXTEN})
 exten => _X.,n,Hangup()
@@ -161,7 +161,7 @@ we're expecting to get a SIP URI for dialing.
 
 [incoming]
 exten => _[0-9a-zA-Z].,1,Verbose(2,Incoming call to extension ${EXTEN})
-exten => _[0-9a-zA-Z].,n,Dial(SIP/${FILTER(.@0-9a-zA-Z,${EXTEN})
+exten => _[0-9a-zA-Z].,n,Dial(SIP/${FILTER(.@0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,${EXTEN})
 exten => _[0-9a-zA-Z].,n,Hangup()
 
 Of course the FILTER() function doesn't check the formatting of the incoming