[Asterisk-java-cvs] CVS: asterisk-java/src/java/net/sf/asterisk/fastagi AbstractAGIScript.java,1.8,1
Brought to you by:
srt
From: Stefan R. <sr...@us...> - 2005-04-06 16:48:05
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31170/src/java/net/sf/asterisk/fastagi Modified Files: AbstractAGIScript.java Log Message: Added SayAlphaCommand which is available in latest CVS HEAD Index: AbstractAGIScript.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/AbstractAGIScript.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -p -r1.8 -r1.9 --- AbstractAGIScript.java 12 Mar 2005 09:56:50 -0000 1.8 +++ AbstractAGIScript.java 6 Apr 2005 16:47:27 -0000 1.9 @@ -21,6 +21,7 @@ import net.sf.asterisk.fastagi.command.C import net.sf.asterisk.fastagi.command.ExecCommand; import net.sf.asterisk.fastagi.command.GetVariableCommand; import net.sf.asterisk.fastagi.command.HangupCommand; +import net.sf.asterisk.fastagi.command.SayAlphaCommand; import net.sf.asterisk.fastagi.command.SayDigitsCommand; import net.sf.asterisk.fastagi.command.SayNumberCommand; import net.sf.asterisk.fastagi.command.SayPhoneticCommand; @@ -327,6 +328,35 @@ public abstract class AbstractAGIScript } /** + * Says the given character string. + * + * @param text the text to say. + */ + protected void sayAlpha(AGIChannel channel, String text) + throws AGIException + { + channel.sendCommand(new SayAlphaCommand(text)); + } + + /** + * Says the given character string, returning early if any of + * the given DTMF number are received on the channel. + * + * @param text the text to say. + * @param escapeDigits a String containing the DTMF digits that allow the + * user to escape. + * @return the DTMF digit pressed or 0x0 if none was pressed. + */ + protected char sayAlpha(AGIChannel channel, String text, + String escapeDigits) throws AGIException + { + AGIReply reply; + + reply = channel.sendCommand(new SayAlphaCommand(text)); + return reply.getResultCodeAsChar(); + } + + /** * Says the given character string with phonetics. * * @param time the time to say in seconds since 00:00:00 on January 1, 1970. |