You would set a dialplan variable from inside your AGI.

In PHPAGI it might be something this:

$agi->set_variable("CUST_ID", $cust_id);

Then in your dialplan after your script runs you can use the variable like any 
other.

You can also get dialplan variables AND functions:

$tmp = $agi->get_var("VMCOUNT(1234@accounting)");
$vmcount = $tmp["data"];

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of bilal ghayyad
Sent: Saturday, March 10, 2012 3:27 PM
To: [email protected]
Subject: [asterisk-users] AGI and retreiving data, how to use this data in 
extensions.conf

Hi All;

I know that I can use the AGI to call (run) a script (php or python or any 
other kind of scripts), but the question is:

If I have information that I need to build a decision in the extensions.conf 
based on it, and these informations can be obtained using this script, so how I 
will read these informations? What is the method to read it from the database 
and store it in a variable that I can use it in the extensions.conf to do 
proper call routing? How?


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

Reply via email to