[asterisk-users] How to get ten-digit number?
Vincent
vincent.delporte at bigfoot.com
Fri Nov 9 06:07:04 CST 2007
Hello
Instead of using PrivacyManager, I'd rather use my own
dialplan to prompt the user for a ten-digit number if they called
while blocking CID.
This code does prompt the user, but
1) hangs up if the user didn't type the ten digits before the timeout
2) if the user did type the right number of digits, it still hangs up
instead of Returning and then jumping forth to the "cid" extension:
========
exten => 777,1,Set(CALLERIDNUM=${CALLERID(num)})
exten => 777,n,GosubIf($[${LEN(${CALLERIDNUM})} != 10 ]?nocid,1:cid,1)
;prompt user for 10-digit #, and Return to GosubIf()
exten =>
nocid,1,Read(CALLERIDNUM,/root/asterisk_sound_files/no_cid,10)
exten => nocid,n,Verbose(User typed ${CALLERIDNUM})
;Why does it hang up instead of jumping back to GosubIf?
exten => nocid,n,Return
exten => cid,1,Set(CALLERIDNAME = ${DB(cidname/${CALLERIDNUM})})
exten => cid,n,Background(/root/asterisk_sound_files/main_menu)
exten => cid,n,Set(SOFTWARE=${EXTEN})
exten => cid,n,Hangup
========
Does someone have some similar code that I could use?
Thank you.
More information about the asterisk-users
mailing list