Created
December 19, 2018 14:33
-
-
Save ambiorixg12/e486d9f036915bb51e04d4e2471ae1ae to your computer and use it in GitHub Desktop.
Checking CID against a DB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[cidlookup] | |
exten=>_x.,1,Noop( checking the callerid ${CALLERID(num)}) | |
same=>n,Set(__cid=${SHELL(mysql --user=root --password='12340' --skip-column-names dialer -e 'select dnc_phone from dnc where dnc_phone="${CALLERID(num)}" limit 0,1 ')}) | |
same=>n,Noop( result ${cid:0:1}) | |
same => n,GotoIf($["${CALLERID(num)}"="${cid:0:-1}"]?allow:disallow) | |
same=>n(allow),Playback(demo-thanks) | |
same=>n,Hangup() | |
same=>n(disallow),Playback(im-sorry) | |
same=>n,Hangup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment