On 11/14/06, <b class="gmail_sendername">Tim Uckun</b> <<a href="mailto:timuckun@gmail.com">timuckun@gmail.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 11/15/06, blackwater dev <<a href="mailto:blackwaterdev@gmail.com">blackwaterdev@gmail.com</a>> wrote:<br>> I need to write an app which takes a phone call, asks for the user to input<br>> a number and then queries a db via a webservice and reads the results a row
<br>> at a time back to the caller. First, is this beyond Asterisk? Second, can<br>> I do this if I use the Trixbox implementation? Third, any good tutorials on<br>> doing just this?<br><br>There are numerous AGI toolkits in different languages. I have just
<br>started fooling around with RAGI which is integrated with ruby on<br>rails. From my experiments so far it seems to work OK.<br>_______________________________________________<br>--Bandwidth and Colocation provided by
<a href="http://Easynews.com">Easynews.com</a> --<br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users
</a><br></blockquote></div><br>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.<br>
<br>
[custom-lookup]<br>
exten => s,1,Cepstral(Please enter your eye dee Number, followed by the pound key now.)<br>
exten => s,2,Read(ID)<br>
exten => s,3,MYSQL(Connect connid localhost contacts XXXXXXXX contacts)<br>
exten => s,4,MYSQL(Query resultid ${connid} SELECT\
FirstName\,LastName\,HomePhone\ FROM\ contacts\ WHERE\
ContactID=\'${ID}\')<br>
exten => s,5,MYSQL(Fetch foundRow ${resultid} var1 var2 var3) ; fetch row<br>
exten => s,6,GotoIf($["${foundRow}" = "1"]?7:9) ;<br>
exten => s,7,Cepstral(The Phone number for ${var1} ${var2} is, ${var3}.)<br>
exten => s,8,Goto(s,10)<br>
exten => s,9,Cepstral(No match found. Goodbye) ; End loop if<br>
exten => s,10,MYSQL(Clear ${resultid})<br>
exten => s,11,MYSQL(Disconnect ${connid})<br>
<br>
If you need more help with the above let me know.<br clear="all"><br>Tom Vile<br><br>