Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3012 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20050407/ca86b531/smime.bin
On Thursday 07 April 2005 3:19 pm, Jan Johansson wrote:> Is it possible (How complicated is it?) to do this; > > Call comes in, connects to IVR > > IVR plays the usual "please type your order number, finish with pound" > > Then I would like to query a MSSQL database server, looking up the "Status" > column from a row where ordernr = the entered order number. > > Depending on the result of the lookup, play one of two messages ("Yes, > ready for pickup" or "No, your order is not ready"). > > Can someone clue me in on which docs I should start with? Or is there an > example of this somewhere?Very simple. AGI. Write a custom AGI program (any language) to do the MSSQL query. AGI can control playback of audio, etc. See http://www.voip-info.org/wiki-Asterisk+AGI. Cheers & HTH - -josiah -- Josiah Bryan IT Coordinator Productive Concepts, Inc. jbryan@productiveconcepts.com (765) 964-6009, ext. 224
Similar to my post about using a DB for authentication, you can use the Read app to 1 - Play a recoding which asks for digits 2 - Indicate which variable to assign entered digits to 3 - Set the max length for the digits. Once this function is called, the digits entered by the caller are stored in a variable, the next line of your IVR can pass that variable to an AGI app. Using any executable app such as Perl, PHP, etc. you can write a script that reads in the variable passed, dive into a database, pull out the status, then have asterisk play a different sound file based on the status using either a specific AGI command, or using the AGI command "exec" to run an asterisk command. See: http://www.voip-info.org/wiki-Asterisk+AGI <http://www.voip-info.org/wiki-Asterisk+AGI> for more info. Hope that points you in the right direction. Steve -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com]On Behalf Of Jan Johansson Sent: Thursday, April 07, 2005 2:19 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [Asterisk-Users] Database lookups? Is it possible (How complicated is it?) to do this; Call comes in, connects to IVR IVR plays the usual "please type your order number, finish with pound" Then I would like to query a MSSQL database server, looking up the "Status" column from a row where ordernr = the entered order number. Depending on the result of the lookup, play one of two messages ("Yes, ready for pickup" or "No, your order is not ready"). Can someone clue me in on which docs I should start with? Or is there an example of this somewhere? -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 5904 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20050407/7ddc18bd/winmail.bin
Jan Johansson wrote:> Is it possible (How complicated is it?) to do this; > IVR plays the usual ?please type your order number, finish with pound?> Then I would like to query a MSSQL database server, looking up the > ?Status? column from a row where ordernr = the entered order number.> Depending on the result of the lookup, play one of two messages (?Yes, > ready for pickup? or ?No, your order is not ready?).> Can someone clue me in on which docs I should start with? Or is there an > example of this somewhere?If Perl is your thing then take a look at: http://ruk.ca/code/amazon.pl This is a script which plays a prompt message, accepts a number (in this case an ISBN), does a lookup based on that data, then plays a response. If you can hack the database lookup part yourself, then this script should give you a framework for what you need. Steve
>Very simple. AGI. Write a custom AGI program (any language) to do the MSSQL>query. AGI can control playback of audio, etc. See >http://www.voip-info.org/wiki-Asterisk+AGI.Thanks! This could be ... fun :) -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3012 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20050409/d532bba6/smime.bin