[Asterisk-Users] Play Dialtone - get digits

B. J. Bomar bbomar at fngi.net
Thu Jul 28 13:15:53 MST 2005


Here is a crude hack, but it requires the user to press # at the end.

exten => s,1,Playtones(dial)
exten => s,2,Read(1stnumber,,1)
exten => s,3,StopPlaytones
exten => s,4,Read(restofnumber)
exten => s,5,SetVar(totalnumber=${1stnumber}${restofnumber})

Hope that helps.

B. J.



 

-----Original Message-----
From: Peter Svensson [mailto:psvasterisk at psv.nu] 
Sent: Thursday, July 21, 2005 1:37
To: Ed Greenberg; Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [Asterisk-Users] Play Dialtone - get digits

On Wed, 20 Jul 2005, Ed Greenberg wrote:

> I'd like to write a snippet of dialtone that plays dialtone and collects a

> specific number of digits into a variable.
> 
> Sort of like READ but with a generated dialtone.
> 
> Naturally, I want the dialtone to stop playing after the first digit.
> 
> I can't find this anywhere.
> 
> Only thing I can think of is a no-password DISA. Is this the correct 
> method? Is there a better one?

DISA would proably work, though it may be a hassle since the call will be
sent into the disa context. Another option is to use READ with a
filecontaining a recording of the dialtone.

Peter







More information about the asterisk-users mailing list