[asterisk-users] Gotoif Question

Danny Nicholas danny at debsinc.com
Thu Feb 4 11:26:32 CST 2010


That's my "dial plan" lesson for today.

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Barry Miller
Sent: Thursday, February 04, 2010 10:46 AM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: 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 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

-- 
_____________________________________________________________________
-- 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




More information about the asterisk-users mailing list