how to start phpAgi

joe072

Joined
Jul 24, 2009
Messages
3
Likes
0
Points
0
#1
I have a problem programming phpAGI where I try to enter the value from the id of my customers, and the result form of the bill that the answer's id is my customers. I've tried to run what was at the address www.voip-info.org/wiki/view/Asterisk+AGI+php
but no way at all. Explanation please?
 

haamed

Joined
Jul 23, 2007
Messages
251
Likes
0
Points
0
#2
Hi my Friend,
you didn't say the problem clearly, but i think you couldn't run your PHP script even !
for running php program as agi you know these notes:

1) put your .php file in /var/lib/asterisk/agi-bin/ with 777 permission.

2) use phpagi.php as require in your file, here is a sample code:

#!/usr/bin/php -q
<?php
require('phpagi.php');
error_reporting(E_ALL);
$agi = new AGI();
//Answer the Channel
$agi->answer();
//Play Sound File that is in /var/lib/asterisk/sounds
$agi-> stream_file('welcome');
//get Data from caller
$id = $agi->get_data('beep', 4000, 6);
$id = $id['result'];

?>

if your problem is something else please let me know,

Goodluck
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,914
Messages
130,919
Members
17,590
Latest member
johneldc90
Top