Re: [asterisk-users] IVR and MySQL

2007-08-16 Thread Jon Farmer
I write such apps all the time, i have written IVR
apps that talk to SQL Server (Sage500), MySQL, our
credit/debit card processing system.

Regards

Jon
 



--- Thiago Maluf [EMAIL PROTECTED] wrote:

 Hi Fabio,
 of course that you can.
 
 One way to do it is working with app MYSQL(), where
 you will put your sql as
 argumment.
 read more in

http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL
 
 good luck,
 Thiago Maluf Resende.
 
 2007/8/14, Fabio Ardeola [EMAIL PROTECTED]:
 
  Hi
 
  Does somebody know if I can save the answers made
 by
  the caller person on the IVR menu in a MySQL
 Database?
  If yes, can I save the CallerID as well?
 
  Thanks,
  Fabio
 
 
 
   


  Luggage? GPS? Comic books?
  Check out fitting gifts for grads at Yahoo! Search
 

http://search.yahoo.com/search?fr=oni_on_mailp=graduation+giftscs=bz
 
  ___
  --Bandwidth and Colocation Provided by
 http://www.api-digital.com--
 
  asterisk-users mailing list
  To UNSUBSCRIBE or update options visit:


http://lists.digium.com/mailman/listinfo/asterisk-users
 
 
 
 
 -- 


 THIAGO MALUF RESENDE
 Consultor Voip e Programador WEB (Voip Developer and
 Web Developer)
 Tel: +55 21 86042100
 e-mail: [EMAIL PROTECTED]
  ___
 --Bandwidth and Colocation Provided by
 http://www.api-digital.com--
 
 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
   
http://lists.digium.com/mailman/listinfo/asterisk-users





  ___
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] IVR and MySQL

2007-08-16 Thread Jon Schøpzinsky
Another way to do this, is to use the func_odbc library. Its very good for 
production use, on larger sites.
We use it on all of our asterisk servers, and it works great.


Venlig Hilsen/Kind Regards
Jon Leren Schøpzinsky
Solution Engineer
Dansk Erhvervs-Telefon A/S
tlf: +45 88200336
mob: +45 31206709

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Atis
Sent: 14. august 2007 14:14
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] IVR and MySQL

On 8/14/07, Thiago Maluf [EMAIL PROTECTED] wrote:
 Hi Fabio,
 of course that you can.

 One way to do it is working with app MYSQL(), where you will put your sql as
 argumment.
 read more in
 http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL

That's possible, but i wouldn't recommend on large production system.
Using MySQL you would need to connect and disconnect all the time, and
it takes resources.. I would suggest to append that info to CDR
userfield (if you are storing your CDR in MySQL), and run periodically
some script that extracts them. Of course it's more complex, but that
would be my way.

Regards,
Atis

-- 
Atis Lezdins,
IT Responsible of BEST Riga,
[EMAIL PROTECTED]
ICQ: 142239285
Skype: atis.lezdins
Cell Phone: +371 28806004 [Tele2, Latvia]
Work phone: +1 800 7502835 [Toll free, USA]
?BEST? - www.BEST.eu.org

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] IVR and MySQL

2007-08-16 Thread Andreas Sikkema
  One way to do it is working with app MYSQL(), where you 
 will put your sql as
  argumment.
  read more in
  http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL
 
 That's possible, but i wouldn't recommend on large production system.
 Using MySQL you would need to connect and disconnect all the time, and
 it takes resources.. I would suggest to append that info to CDR
 userfield (if you are storing your CDR in MySQL), and run periodically
 some script that extracts them. Of course it's more complex, but that
 would be my way.

Using MYSQL() (or equivalent) heavily in the dialingplan is IMHO the 
nicest way of doing things like this. You can do lots of simultaneous 
calls before getting into trouble. 

Appending stuff to the CDR userfield is just plain ugly and asking for 
trouble (are you sure you can always separate the different values?).

-- 
Andreas Sikkema

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] IVR and MySQL

2007-08-16 Thread Atis
On 8/16/07, Andreas Sikkema [EMAIL PROTECTED] wrote:
 Using MYSQL() (or equivalent) heavily in the dialingplan is IMHO the
 nicest way of doing things like this. You can do lots of simultaneous
 calls before getting into trouble.

Well, it is simple, but creates a LOT of load. Plus, if you might run
in troubles, if you forget to do disconnect at some point (or lot of
calls get's hanged up without disconnecting from MySQL).


 Appending stuff to the CDR userfield is just plain ugly and asking for
 trouble (are you sure you can always separate the different values?).

Well, for me it is working excellently. Plus you get all the info
already binded to call. I use # as separator - i don't have values
that may contain it (and it's quite distinguishable when browsing DB)

Regards,
Atis


-- 
Atis Lezdins,
IT Responsible of BEST Riga,
[EMAIL PROTECTED]
ICQ: 142239285
Skype: atis.lezdins
Cell Phone: +371 28806004 [Tele2, Latvia]
Work phone: +1 800 7502835 [Toll free, USA]
?BEST? - www.BEST.eu.org

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] IVR and MySQL

2007-08-14 Thread Fabio Ardeola
Hi

Does somebody know if I can save the answers made by
the caller person on the IVR menu in a MySQL Database?
If yes, can I save the CallerID as well?

Thanks,
Fabio


  

Luggage? GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mailp=graduation+giftscs=bz

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] IVR and MySQL

2007-08-14 Thread Thiago Maluf
Hi Fabio,
of course that you can.

One way to do it is working with app MYSQL(), where you will put your sql as
argumment.
read more in http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL

good luck,
Thiago Maluf Resende.

2007/8/14, Fabio Ardeola [EMAIL PROTECTED]:

 Hi

 Does somebody know if I can save the answers made by
 the caller person on the IVR menu in a MySQL Database?
 If yes, can I save the CallerID as well?

 Thanks,
 Fabio



   
 
 Luggage? GPS? Comic books?
 Check out fitting gifts for grads at Yahoo! Search
 http://search.yahoo.com/search?fr=oni_on_mailp=graduation+giftscs=bz

 ___
 --Bandwidth and Colocation Provided by http://www.api-digital.com--

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users




-- 

THIAGO MALUF RESENDE
Consultor Voip e Programador WEB (Voip Developer and Web Developer)
Tel: +55 21 86042100
e-mail: [EMAIL PROTECTED]
___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] IVR and MySQL

2007-08-14 Thread Atis
On 8/14/07, Thiago Maluf [EMAIL PROTECTED] wrote:
 Hi Fabio,
 of course that you can.

 One way to do it is working with app MYSQL(), where you will put your sql as
 argumment.
 read more in
 http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL

That's possible, but i wouldn't recommend on large production system.
Using MySQL you would need to connect and disconnect all the time, and
it takes resources.. I would suggest to append that info to CDR
userfield (if you are storing your CDR in MySQL), and run periodically
some script that extracts them. Of course it's more complex, but that
would be my way.

Regards,
Atis

-- 
Atis Lezdins,
IT Responsible of BEST Riga,
[EMAIL PROTECTED]
ICQ: 142239285
Skype: atis.lezdins
Cell Phone: +371 28806004 [Tele2, Latvia]
Work phone: +1 800 7502835 [Toll free, USA]
?BEST? - www.BEST.eu.org

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] IVR and MySQL

2007-08-14 Thread James FitzGibbon
On 8/14/07, Atis [EMAIL PROTECTED] wrote:

 That's possible, but i wouldn't recommend on large production system.
 Using MySQL you would need to connect and disconnect all the time, and
 it takes resources.. I would suggest to append that info to CDR
 userfield (if you are storing your CDR in MySQL), and run periodically
 some script that extracts them. Of course it's more complex, but that
 would be my way.


If the data you wish to store is more complex than stuffing in the CDR
userfield would allow, you can always call out to an AGI which can write the
data to whatever file format you want for later loading into a database.

If you used FastAGI and a pre-forking AGI server model, you could even take
the database connection hit when the AGI server starts.  The per-call cost
would then be the cost to establish the socket connection to the AGI server
from Asterisk, the cost to perform the SQL inserts over an established
database connection, plus whatever other calculation or transformation you
needed to do before doing the insert.

That architecture would hold up under a fairly large load.  Perl's
Asterisk::FastAGI framework lets you specify the number of pre-forked
children to launch, plus you can tell each child to exit (spawning a
replacement for the pool) after processing a certain number of
transactions.  It's very similar to the Apache prefork model.

-- 
j.
___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] IVR and MySQL

2007-08-14 Thread Fabio Ardeola
James / Atis / Thiago

Let say that the user entry during the call is a
reference number of a house to rent. Would be possible
to check if the reference number is a valid entry on
the MySQL database and then base on its answer define
the next menu item on the IVR menu.

Thanks,
Fabio


--- James FitzGibbon [EMAIL PROTECTED]
wrote:

 On 8/14/07, Atis [EMAIL PROTECTED] wrote:
 
  That's possible, but i wouldn't recommend on large
 production system.
  Using MySQL you would need to connect and
 disconnect all the time, and
  it takes resources.. I would suggest to append
 that info to CDR
  userfield (if you are storing your CDR in MySQL),
 and run periodically
  some script that extracts them. Of course it's
 more complex, but that
  would be my way.
 
 
 If the data you wish to store is more complex than
 stuffing in the CDR
 userfield would allow, you can always call out to an
 AGI which can write the
 data to whatever file format you want for later
 loading into a database.
 
 If you used FastAGI and a pre-forking AGI server
 model, you could even take
 the database connection hit when the AGI server
 starts.  The per-call cost
 would then be the cost to establish the socket
 connection to the AGI server
 from Asterisk, the cost to perform the SQL inserts
 over an established
 database connection, plus whatever other calculation
 or transformation you
 needed to do before doing the insert.
 
 That architecture would hold up under a fairly large
 load.  Perl's
 Asterisk::FastAGI framework lets you specify the
 number of pre-forked
 children to launch, plus you can tell each child to
 exit (spawning a
 replacement for the pool) after processing a certain
 number of
 transactions.  It's very similar to the Apache
 prefork model.
 
 -- 
 j.
  ___
 --Bandwidth and Colocation Provided by
 http://www.api-digital.com--
 
 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
   
http://lists.digium.com/mailman/listinfo/asterisk-users



  

Park yourself in front of a world of choices in alternative vehicles. Visit the 
Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/ 

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] IVR and MySQL

2007-08-14 Thread James FitzGibbon
On 8/14/07, Fabio Ardeola [EMAIL PROTECTED] wrote:


 Let say that the user entry during the call is a
 reference number of a house to rent. Would be possible
 to check if the reference number is a valid entry on
 the MySQL database and then base on its answer define
 the next menu item on the IVR menu.


If you want to do something like that, you can either use the MYSQL function
(with the attendant issues of connecting/reconnecting/etc.) or put all of
the functionality in an AGI script.  Since AGI can both receive information
from and send commands to Asterisk, you can do pretty much anything you can
code.  There are programming frameworks for AGI for Perl, PHP, Java, and you
could even do it in shellscript if you want.  The communication channel
between Asterisk and the script is stdin/stdout, so you're not restricted at
all.

Using AGI does make the the integrity of your system depend on an external
component (i.e. if you're using FastAGI and the agi server goes down, your
calls will just return immediately to the dialplan), but when you need to do
something that doesn't fit intuitively into the Asterisk dialplan, I find
it's the way to go.

-- 
j.
___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users