[asterisk-users] trixbox + agi
Tom Vile
tvile at baldwintechsolutions.com
Tue Nov 14 22:04:53 MST 2006
On 11/14/06, Tim Uckun <timuckun at gmail.com> wrote:
>
> On 11/15/06, blackwater dev <blackwaterdev at gmail.com> wrote:
> > I need to write an app which takes a phone call, asks for the user to
> input
> > a number and then queries a db via a webservice and reads the results a
> row
> > at a time back to the caller. First, is this beyond Asterisk? Second,
> can
> > I do this if I use the Trixbox implementation? Third, any good
> tutorials on
> > doing just this?
>
> There are numerous AGI toolkits in different languages. I have just
> started fooling around with RAGI which is integrated with ruby on
> rails. From my experiments so far it seems to work OK.
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
I do this currently but dont know how to allow additional rows to be read
back. It only reads the first one then stops. Any insight on how to have
it loop to get addtional rows would be great. Also I was wondering how to
get DTMF Digits to translate in to possible matches for LastName to query my
database like the Directory CMD does.
[custom-lookup]
exten => s,1,Cepstral(Please enter your eye dee Number, followed by the
pound key now.)
exten => s,2,Read(ID)
exten => s,3,MYSQL(Connect connid localhost contacts XXXXXXXX contacts)
exten => s,4,MYSQL(Query resultid ${connid} SELECT\
FirstName\,LastName\,HomePhone\ FROM\ contacts\ WHERE\ ContactID=\'${ID}\')
exten => s,5,MYSQL(Fetch foundRow ${resultid} var1 var2 var3) ; fetch row
exten => s,6,GotoIf($["${foundRow}" = "1"]?7:9) ;
exten => s,7,Cepstral(The Phone number for ${var1} ${var2} is, ${var3}.)
exten => s,8,Goto(s,10)
exten => s,9,Cepstral(No match found. Goodbye) ; End loop if
exten => s,10,MYSQL(Clear ${resultid})
exten => s,11,MYSQL(Disconnect ${connid})
If you need more help with the above let me know.
Tom Vile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20061114/a0e7ff9b/attachment.htm
More information about the asterisk-users
mailing list