Hi Gang, I'm working on a lumenvox app and am having "fun" with the Gotoif's on speech/DTMF recognition. If you're using DTMF to enter a number instead of speech to enter a numeric value, the engine will often return a "confidence score" of 1000 instead of 1-999. Therefore this Gotoif fails: exten => s,n,GotoIf($["${SPEECH_SCORE(0)}" <= "${THRESHOLD}"]?:tag) ${THRESHOLD} was set to 850. If SPEECH_SCORE(0) <= 850 (1-850) fails 851-999 succeeds 1000 fails My workaround was this: exten => s,n,GotoIf($["${SPEECH_SCORE(0)}" = "1000"]?tag) exten => s,n,GotoIf($["${SPEECH_SCORE(0)}" <= "${THRESHOLD}"]?:tag) Is there a better way than using to Gotoif's per evaluation? Regards, Danny Nicholas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100204/b068abc1/attachment.htm
I think the quotes cause the values to be compared as strings, not numbers. The old shell programmer's trick (which allows for empty strings): exten => s,n,GotoIf($[0${SPEECH_SCORE(0)} <= 0${THRESHOLD}]?:tag) ought to cause a numeric comparison. -- Barry On Thu, Feb 04, 2010 at 09:42:18AM -0600, Danny Nicholas wrote:> Hi Gang, > > I'm working on a lumenvox app and am having "fun" with the > Gotoif's on speech/DTMF recognition. If you're using DTMF to enter a number > instead of speech to enter a numeric value, the engine will often return a > "confidence score" of 1000 instead of 1-999. Therefore this Gotoif fails: > > exten => s,n,GotoIf($["${SPEECH_SCORE(0)}" <= "${THRESHOLD}"]?:tag) > > > > ${THRESHOLD} was set to 850. > > If SPEECH_SCORE(0) <= 850 (1-850) fails > > 851-999 succeeds > > 1000 fails > > > > My workaround was this: > > exten => s,n,GotoIf($["${SPEECH_SCORE(0)}" = "1000"]?tag) > > exten => s,n,GotoIf($["${SPEECH_SCORE(0)}" <= "${THRESHOLD}"]?:tag) > > > > Is there a better way than using to Gotoif's per evaluation? > > > > Regards, > > > > Danny Nicholas > > >> -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
-- Antes de imprimir este mensaje piense bien si es necesario hacerlo: El medio ambiente es cosa de todos. -- AVISO LEGAL Este mensaje, dirigido solamente a su destinatario, es confidencial. Si lo ha recibido por error, CAJA DE GUADALAJARA le informa que su contenido es reservado y no se autoriza su lectura, copia ni uso. CAJA DE GUADALAJARA no garantiza la confidencialidad de los mensajes transmitidos por Internet y se reserva el derecho a ejercer las acciones legales que le correspondan contra todo tercero que acceda de forma ilegal al contenido de este mensaje y al de los ficheros contenidos en el mismo. --
C ----- Mensaje original ----- De: Barry Miller <asterisk-users at notanet.net> Para: 'Asterisk Users Mailing List - Non-Commercial Discussion' <asterisk-users at lists.digium.com> Enviado: Thu Feb 04 17:45:47 2010 Asunto: Re: [asterisk-users] Gotoif Question I think the quotes cause the values to be compared as strings, not numbers. The old shell programmer's trick (which allows for empty strings): exten => s,n,GotoIf($[0${SPEECH_SCORE(0)} <= 0${THRESHOLD}]?:tag) ought to cause a numeric comparison. -- Barry On Thu, Feb 04, 2010 at 09:42:18AM -0600, Danny Nicholas wrote:> Hi Gang, > > I'm working on a lumenvox app and am having "fun" with the > Gotoif's on speech/DTMF recognition. If you're using DTMF to enter anumber> instead of speech to enter a numeric value, the engine will often return a > "confidence score" of 1000 instead of 1-999. Therefore this Gotoif fails: > > exten => s,n,GotoIf($["${SPEECH_SCORE(0)}" <= "${THRESHOLD}"]?:tag) > > > > ${THRESHOLD} was set to 850. > > If SPEECH_SCORE(0) <= 850 (1-850) fails > > 851-999 succeeds > > 1000 fails > > > > My workaround was this: > > exten => s,n,GotoIf($["${SPEECH_SCORE(0)}" = "1000"]?tag) > > exten => s,n,GotoIf($["${SPEECH_SCORE(0)}" <= "${THRESHOLD}"]?:tag) > > > > Is there a better way than using to Gotoif's per evaluation? > > > > Regards, > > > > Danny Nicholas > > >> -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Antes de imprimir este mensaje piense bien si es necesario hacerlo: El medio ambiente es cosa de todos. -- AVISO LEGAL Este mensaje, dirigido solamente a su destinatario, es confidencial. Si lo ha recibido por error, CAJA DE GUADALAJARA le informa que su contenido es reservado y no se autoriza su lectura, copia ni uso. CAJA DE GUADALAJARA no garantiza la confidencialidad de los mensajes transmitidos por Internet y se reserva el derecho a ejercer las acciones legales que le correspondan contra todo tercero que acceda de forma ilegal al contenido de este mensaje y al de los ficheros contenidos en el mismo. --