Thanks Chris and Mike for the great ideas.<br> <br> Richard<br><br><b><i>"Chris A. Icide" <chris@netgeeks.net></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Or you could skip the overhead associated with an AGI and use the<br>dialplan command availabe after installing asterisk-addons MYSQL.<br><br>exten => _X.,1,Read(PO-NUMBER,enter-yr-po-num)<br>exten => _X.,2,MYSQL(Connect connid <dbhost> <dbuser> <dbpass> <dbname>)<br>exten => _X.,3,MYSQL(Query resultid ${connid} SELECT balance FROM<br>account-payables WHERE po_num=${PO-NUMBER})<br>exten => _X.,4,MYSQL(Fetch fetch ${resultid} AMOUNT-DUE)<br>exten => _X.,5,MYSQL(Clear ${resultid})<br><br>Of course you will want to put in place all the error traps and when<br>using this function I always have a check in my hangup routine to make<br>sure I close the open mysql connection. So at the end of the above<br>dialplan, you should have
the value you want in the AMOUNT-DUE variable.<br><br>-Chris<br><br>Mike Pollitt wrote:<br>><br>> Hi Richard –<br>><br>> What you want is AGI:<br>> http://www.voip-info.org/tiki-index.php?page=Asterisk+AGI<br>><br>> You could write a perl script to read the PO number from stdin and<br>> spit back the balance (or whatever). To read the PO number from the<br>> user, use the Read() dialplan application. To play back the balance,<br>> you could use SayDigits() (but there’s probably a more elegant<br>> solution specifically for speaking amounts of money).<br>><br>> ------------------------------------------------------------------------<br>><br>> *From:* asterisk-users-bounces@lists.digium.com<br>> [mailto:asterisk-users-bounces@lists.digium.com] *On Behalf Of<br>> *Richard Reina<br>> *Sent:* Friday, 24 February 2006 9:34 AM<br>> *To:* asterisk-users@lists.digium.com<br>> *Subject:* [Asterisk-Users] How to query a table from the
keypad?<br>><br>> I am trying to give users the option to query our accts. payable<br>> database by supplying their PO number. I able to write queries via<br>> perl->DBI->mysql but have no idea how to get * to do it from the IVR.<br>> Is this possible? Can anyone point me in the right direction for help<br>> or examples?<br>><br>> Thanks,<br>><br>> Richard<br>><br>> ------------------------------------------------------------------------<br>><br>><br>> What are the most popular cars? Find out at Yahoo! Autos<br>> <http: //us.rd.yahoo.com/evt="38382/_ylc=X3oDMTEzNWFva2Y2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDMmF1dG9z/*http:/autos.yahoo.com/newcars/popular/thisweek.html%20%0d%0a"><br>><br>><br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________<br>> --Bandwidth and Colocation provided by Easynews.com --<br>><br>> Asterisk-Users
mailing list<br>> To UNSUBSCRIBE or update options visit:<br>> http://lists.digium.com/mailman/listinfo/asterisk-users<br>> <br><br><br>_______________________________________________<br>--Bandwidth and Colocation provided by Easynews.com --<br><br>Asterisk-Users mailing list<br>To UNSUBSCRIBE or update options visit:<br> http://lists.digium.com/mailman/listinfo/asterisk-users<br></http:></dbname></dbpass></dbuser></dbhost></blockquote><br><p>
                <hr size=1> Yahoo! Mail<br>
<a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=38867/*http://photomail.mail.yahoo.com">Use Photomail</a> to share photos without annoying attachments.