[asterisk-users] How to get ten-digit number?

Vincent vincent.delporte at bigfoot.com
Fri Nov 9 09:32:07 CST 2007


On Fri, 9 Nov 2007 06:56:11 -0600, Tilghman Lesher
<tilghman at mail.jeffandtilghman.com> wrote:
>Actually, it DOES return, but because you have no further instructions
>and since autofallthrough is set to "yes", it hangs up at that point.

OK, makes sense.

>> exten => 777,1,Set(CALLERIDNUM=${CALLERID(num)})
>> exten => 777,n,GosubIf($[${LEN(${CALLERIDNUM})} != 10 ]?nocid,1:cid,1)
>
>exten => 777,n,WaitExten(10)
>
>> ;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})
>> exten => nocid,n,Return

I'm not sure how to use WaitExten() : If the user blocked his CID, I
play a message asking him to type the ten digits, and once it's done,
either go back to GosubIf and then to the "cid" extension, or directly
from nocid to cid. Am I doing this wrong?

>This won't work, EXTEN is "cid" at this point.  If you want it continuous, use
>the Read application again.

Alright, I'll change this to get the user's choice in main_menu and
translate numbers into strings to tell which software they called for.

Thanks!




More information about the asterisk-users mailing list