I was just about to respond when I saw that you figured it out. I banged my head for a few days on this one till I used print_r to figure out how to use it.
I just want to ask something about the code you posted:
Where do you want to save the variable you want to get?On what database?
Actually im having a problem on passing a variable coming from asterisk (the callerID) to the sugarCRM, which is web based application, I need it as a key in selecting data in mysql database of sugarCRM, to pop up the detail when someone’s calling asterisk…but i cant pass data from asterisk to sugarCRM, maybe you can help me on this matter.
Any help will be appreciated…!!!
Hope you can help me on my thesis…
So your mygetvar.agi is inside the folder /var/lib/asterisk/agi-bin?
This is your code in
mygetvar.agi :
require (‘phpagi.php’);
$agi = new AGI();
$myvar = $agi->get_variable(‘vartest’);
…
…
…
So do you have a script after the code you have posted mygetvar.agi that inserting the data you retrieve in the asterisk externsions.conf like
mysql_query(“INSERT $myvar[data] INTO database”);
after the $myvar = $agi->get_variable(‘vartest’); or something ?
is it possible?
Like inserting the data to SugarCRM mysql database you retrieve in asterisk?
is it possible?
You can help me alot if i can INSERT data came from asterisk to the database of sugarCRM, because I need the data came from asterisk to search some information about the caller…I need it to have a key to compare in Selecting data, like the callerID…
So i will put the sql scripts on /var/lib/asterisk/agi-bin/ then my scripts?
So i have to set up the connection of my database in sugar, for opening the database and have some query on my agi?
If you dont mind, can you send me some of your scripts in your agi-bin that is using sql scripts and accesing some database? I really need someone who can guide me on this…I really appreciate your help…
When some one call, all i need to do is update the database of my sugar or something like inserting the the caller ID of the caller then have a pop up of his data?Am i right?
Can you guide me on what to do like giving me some steps on what to do first?
I will really appreciate your help…Please help me on my thesis…
Do you now what is the best way to use when you want to pop up a data to the SugarCRM when someones calling the asterisk?
Can you share it with me? By the way my email add is avs.ceriola@gmail.com…If want to send some codes that i have ask you, i forgot it to post in my last reply.
I will really appreciate your help tarekhoury!!!Please help me on this…
well i dunno about the SugarCRM, when i want to insert for example the callerID in a database, i do a simple php DB connection then run mysql_query and insert that CallerID to the wanted database, if what you are asking for is how to do the connection and the query then here is a very simple example :
Thanks for the reply, i actually implemented some mysql procedures, like connecting to the database…And it works in localhost…
But i have something to ask, can i connect to the database of an online site, like connecting on online database in using phpagi codes? like mysql_connect(‘online database path’, “root”, “”);?
Actually i havent tried it in online cuz im using my localhost as a database…