Re: [Asterisk-java-users] sayalpha doesn't stop if any of the given DTMF number are received on the
Brought to you by:
srt
From: Martin S. <ma...@be...> - 2007-03-14 15:10:38
|
Hi Jesus, I had to change your sample because isNumber is not something I had imported/defined. I used this: public char readID(String ma) throws AgiException { char[] maAr =3D ma.toCharArray(); char res =3D ' '; int i =3D 0; while ((i < maAr.length) && (!Character.isDigit(res))) { System.out.println("loop index: " + i); res =3D sayAlpha("" + maAr[i], "0123456789"); i++; } return res; } When I ran it with a large digit string, such as: System.out.println(readID(java.lang.Math.PI+"")); My output when I hit 9 in after a bit is: loop index 0 loop index 1 loop index 2 9 This is what I expected. Perhaps you aren't catching an exception being thrown, or Asterisk isn't getting your digits correctly? I would expect sayAlpha delegates most of what it does to Asterisk, and that Asterisk isn't correctly picking up your DTMF. I believe you can play with those settings and relax the requirements. Best, Martin |