Re: [asterisk-users] IVR: Dealing with database and returned variables

2012-03-08 Thread salaheddine elharit
Hi Bilal

in my case i use an IVR menu using asterisk 1.4 an i can store the number
of the customer in my database and after i can select
 the phone number and the date_time of calling i use mysql

you must change database login password with yours and also the name of
table

regards

exten = 500xx,1,Ringing()
exten = 500xx,n,Wait(4)
exten = 500xx,n,Goto(support,s,1)



[support]
exten = s,1,NoOp(User chose support option)
exten = s,n,MYSQL(Connect connid localhost database login password)
exten = s,n,MYSQL(Query resultid ${connid} INSERT\ INTO\ table\  SET\
callerid='${CALLERID(num)}'\, calldate=now())
exten = s,n,MYSQL(Clear ${resultid})
exten = s,n,MYSQL(Disconnect ${connid})
exten = s,n,Dial(SIP/224, 30)


2012/3/7 bilal ghayyad bilmar...@yahoo.com

 Hi All;

 If I need to build IVR using Asterisk (so I will read and write to
 database), until now from my reading, I can understand that the best way is
 to use AGI to call external script like php which will manipulate every
 thing, correct?

 Well, the returned values from this script that I can use it to route the
 call to the proper queue or Phone, how I can handle these returned values?
 Do I have to store it in the database? Well, how I will read it from
 database and use it in the extensions.conf?

 From the other side, is there any tool to have IVR script (let us say,
 studio programing) that can be used in Asterisk? Any advise in this way?

 Regards
 Bilal

 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

 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 --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

Re: [asterisk-users] IVR: Dealing with database and returned variables

2012-03-08 Thread Steve Edwards

On Wed, 7 Mar 2012, bilal ghayyad wrote:

If I need to build IVR using Asterisk (so I will read and write to 
database), until now from my reading, I can understand that the best way 
is to use AGI to call external script like php which will manipulate 
every thing, correct?


I have a strong aversion to cobbling up database access in dialplan. It's 
just ugly. An AGI is so much cleaner and flexible.


My personal preference is C, but that's my sharpest tool and being a 
compiled language is faster than scripting languages like PHP.


If PHP is your 'sharpest tool,' go with it. Unless you're cranking through 
a boat load of calls or working within tight hardware constraints you 
should be fine.


Well, the returned values from this script that I can use it to route 
the call to the proper queue or Phone, how I can handle these returned 
values? Do I have to store it in the database? Well, how I will read it 
from database and use it in the extensions.conf?


You can set channel variables within your AGI. I wrote a 'third party 
verification' system a couple of years ago. One of the AGIs 
('lookup-dnis') looks up the dialed number (DNIS) in the database and sets 
a couple hundred channel variables in the blink of an eye. The channel 
variables then control the flow of the script - what kind of questions are 
asked and what to do with the responses.


--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] IVR: Dealing with database and returned variables

2012-03-08 Thread gokulnath
http://adhearsion.com/ is cool if you are familiar with ruby programming
language.

On Thu, Mar 8, 2012 at 9:55 PM, Steve Edwards asterisk@sedwards.comwrote:

 On Wed, 7 Mar 2012, bilal ghayyad wrote:

  If I need to build IVR using Asterisk (so I will read and write to
 database), until now from my reading, I can understand that the best way is
 to use AGI to call external script like php which will manipulate every
 thing, correct?


 I have a strong aversion to cobbling up database access in dialplan. It's
 just ugly. An AGI is so much cleaner and flexible.

 My personal preference is C, but that's my sharpest tool and being a
 compiled language is faster than scripting languages like PHP.

 If PHP is your 'sharpest tool,' go with it. Unless you're cranking through
 a boat load of calls or working within tight hardware constraints you
 should be fine.


  Well, the returned values from this script that I can use it to route the
 call to the proper queue or Phone, how I can handle these returned values?
 Do I have to store it in the database? Well, how I will read it from
 database and use it in the extensions.conf?


 You can set channel variables within your AGI. I wrote a 'third party
 verification' system a couple of years ago. One of the AGIs ('lookup-dnis')
 looks up the dialed number (DNIS) in the database and sets a couple hundred
 channel variables in the blink of an eye. The channel variables then
 control the flow of the script - what kind of questions are asked and what
 to do with the responses.

 --
 Thanks in advance,
 --**--**
 -
 Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
 Newline  Fax: +1-760-731-3000


 --
 __**__**_
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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




-- 
Thanks  Regards
Gokulnath
@8129845320
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

[asterisk-users] IVR: Dealing with database and returned variables

2012-03-07 Thread bilal ghayyad
Hi All;

If I need to build IVR using Asterisk (so I will read and write to database), 
until now from my reading, I can understand that the best way is to use AGI to 
call external script like php which will manipulate every thing, correct?

Well, the returned values from this script that I can use it to route the call 
to the proper queue or Phone, how I can handle these returned values? Do I have 
to store it in the database? Well, how I will read it from database and use it 
in the extensions.conf?

From the other side, is there any tool to have IVR script (let us say, studio 
programing) that can be used in Asterisk? Any advise in this way?

Regards
Bilal

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


Re: [asterisk-users] IVR: Dealing with database and returned variables

2012-03-07 Thread DHAVAL INDRODIYA
hi you can look following for better implementation

http://phpagi.sourceforge.net/

in this you will find all your answer for get and set variable.

cheers
Dhaval

On Thu, Mar 8, 2012 at 3:11 AM, bilal ghayyad bilmar...@yahoo.com wrote:

 Hi All;

 If I need to build IVR using Asterisk (so I will read and write to
 database), until now from my reading, I can understand that the best way is
 to use AGI to call external script like php which will manipulate every
 thing, correct?

 Well, the returned values from this script that I can use it to route the
 call to the proper queue or Phone, how I can handle these returned values?
 Do I have to store it in the database? Well, how I will read it from
 database and use it in the extensions.conf?

 From the other side, is there any tool to have IVR script (let us say,
 studio programing) that can be used in Asterisk? Any advise in this way?

 Regards
 Bilal

 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

 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 --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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