[asterisk-users] Re: Is asterisk able to integrate with MS SQL

Steve Totaro stotaro at asteriskhelpdesk.com
Thu Nov 23 22:35:05 MST 2006


I went with FreeTDS to accomplish this at one point and it worked great 
in Dev (no call volume).  It seemed to work better than ODBC since it is 
speaking with M$ SQL natively rather than through an additional layer 
although there is much debate about this on the net.

We were doing a bunch of local perl agi stuff too and the box started 
crawling when we went live so we just went with FastAGI and a service 
running on a Windows box to listen and process the FastAGI stuff, query 
the M$ DB and return variables or do inserts.  This approach turned out 
to be lightning fast.  Multiple FastAGI services can run on the same box 
as long as they use different port numbers and are called by IP and port 
number in your dialplan.

For your app you could use many of the standard channel variables that 
are passed in FastAGI but not used (such as RDNIS in my case) to send 
the data you want to interact with your DB.  I have also read that in 
later versions of Asterisk, you can pass other variables but I have not 
really researched that since I do not need it (yet).

Also, if your app is never really going to see volume, then FreeTDS 
along with local AGIs should work just fine but I would still suggest 
what worked for me above.  Maybe others have a better way of doing it?  
I would love to hear from them.

Thanks,
Steve Totaro

Sharon Lim wrote:
> Yes, I have done it. I am able to connect using odbc. Now able to 
> write to ms sql and also retrieve in db. Now my next steps is I need 
> to write an app which takes a phone call, asks for the user to input a 
> number and then queries a MS SQL db and reads the results a row at a 
> time back to the caller.
>
> anyway got example or how to go about this? I am really refresh in 
> programming. thanks in advance!
>
> On 11/15/06, * Wes Baehr* <wbaehr at abilitybusiness.com 
> <mailto:wbaehr at abilitybusiness.com>> wrote:
>
>     Func_odbc (which is new in 1.4) was backported to 1.2. See
>     http://www.asterisk.org/func_odbc
>
>      
>
>     While it only will return one row (there are patches to make it
>     return multiple rows), it's very useful for our purposes. You set
>     up the function in func_odbc.conf, call it with
>     ${ODBC_FunctionName(arg1,arg2,…)} and it executes and returns the
>     specified data.
>
>      
>
>     --
>
>     Wes Baehr
>
>      
>
>      
>
>     ------------------------------------------------------------------------
>
>     *From:* asterisk-users-bounces at lists.digium.com
>     <mailto:asterisk-users-bounces at lists.digium.com>
>     [mailto:asterisk-users-bounces at lists.digium.com
>     <mailto:asterisk-users-bounces at lists.digium.com>] *On Behalf Of
>     *Bruce Reeves
>     *Sent:* Wednesday, November 15, 2006 7:56 AM
>     *To:* Asterisk Users Mailing List - Non-Commercial Discussion
>     *Subject:* Re: [asterisk-users] Re: Is asterisk able to integrate
>     with MS SQL
>
>      
>
>     I have an IVR for employees to enter certain information, like
>     employee number and such and then I pass that to a simple agi/php
>     script that build the query string and uses freetds. It took me a
>     while to get it working and reproduce it on several systems, but I
>     am rather new to Linux in general.
>
>     On 11/15/06, *Tony Mountifield* <tony at softins.clara.co.uk
>     <mailto:tony at softins.clara.co.uk>> wrote:
>
>     In article <
>     9bd3e43a0611141600i4cd6285cyda966079f88c3bb5 at mail.gmail.com
>     <mailto:9bd3e43a0611141600i4cd6285cyda966079f88c3bb5 at mail.gmail.com>>,
>     Sharon Lim < limleechin2005 at gmail.com
>     <mailto:limleechin2005 at gmail.com>> wrote:
>     > -=-=-=-=-=-
>     > -=-=-=-=-=-
>     >
>     > Thanks, will do more research on that part. By the way, Im trying
>     to do IVR
>     > where caller enter the pin the retrieve some information out of
>     the MS SQL.
>     > I am wondering, what is the constraints or how to go about it. As
>     per said
>     > MS SQL is about CDR. Now like i want to match and retrieve data
>     out of the
>     > DB through IVR. Any guidance?
>
>     I don't think there is any direct access to MS SQL via FreeTDS
>     from the
>     dialplan, but there are ODBC functions you could use. See this page:
>
>     http://www.voip-info.org/wiki/view/Asterisk+app_dbodbc
>
>     Alternatively, implement your IVR using AGI or the ExternalIVR
>     application
>     and then you can do what you like with the database.
>
>     See http://www.voip-info.org/wiki-Asterisk+AGI
>     and http://www.voip-info.org/wiki-Asterisk+cmd+ExternalIVR
>
>     Cheers
>     Tony
>     --
>     Tony Mountifield
>     Work: tony at softins.co.uk <mailto:tony at softins.co.uk> -
>     http://www.softins.co.uk <http://www.softins.co.uk>
>     Play: tony at mountifield.org <mailto:tony at mountifield.org> -
>     http://tony.mountifield.org
>     _______________________________________________
>     --Bandwidth and Colocation provided by Easynews.com
>     <http://Easynews.com> --
>
>     asterisk-users mailing list
>     To UNSUBSCRIBE or update options visit:
>        http://lists.digium.com/mailman/listinfo/asterisk-users
>     <http://lists.digium.com/mailman/listinfo/asterisk-users>
>
>
>
>
>     -- 
>     Bruce
>     Nortex Networks
>
>
>     _______________________________________________
>     --Bandwidth and Colocation provided by Easynews.com
>     <http://Easynews.com> --
>
>     asterisk-users mailing list
>     To UNSUBSCRIBE or update options visit:
>       http://lists.digium.com/mailman/listinfo/asterisk-users
>     <http://lists.digium.com/mailman/listinfo/asterisk-users>
>
>
>
>
>
> -- 
> Regards,
> Sharon Lim
>
> *Good memories are to be folded neatly and tucked away into the back 
> pocket *
> ------------------------------------------------------------------------
>
> _______________________________________________
> --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
>   



More information about the asterisk-users mailing list