how can i pass the agi variables to php?
example
pass agi=caller id to a php code.
thanks in advance
how can i pass the agi variables to php?
example
pass agi=caller id to a php code.
thanks in advance
the wiki !
ive already done that.
[code]#!/usr/bin/php -q
<?php $stdin = fopen('php://stdin', 'r'); $stdout = fopen('php://stdout', 'w'); $stdlog = fopen('my_agi.log', 'w'); while (!feof($stdin)) { $temp = fgets($stdin); $temp = str_replace("\n","",$temp); $s = explode(":",$temp); $agivar[$s[0]] = trim($s[1]); if (($temp == "") || ($temp == "\n")) { break; } } $caller=$agivar[agi_calleridname]; fwrite(STDOUT, "$caller"); ?>[/code]
OUTPUT
RX >> 0ource
its not working… by the way im using ,iax, asterisk running in ubuntu 6.10.
pls be patient w/ me im a noob in asterisk
anyone who can help me solve this problem
is there something wrong with my php code?
i really really need help im stuck.
fixed i forgot to open i/o channel.
thanks anyway
What do you mean by i/o channel. Can you please show me the php script by now.
$stdin = fopen('php://stdin', 'r');
$stdout = fopen('php://stdout', 'w');
$stdlog = fopen('my_agi.log', 'w');
voip-info.org/wiki/view/Asterisk+AGI+php
silly me i skipped that step hehe
Please explain all the detailed steps…
i am unable to get the callerid
try this:
voip-info.org/wiki-Asterisk+AGI+php
thanks i was able to achieve after reading.