I personally use phpagi 2.14 with CW... I might have done some small
changes..
Here is a diff of my phpagi... but it far from been a CW only phpogi
clean (you see the agi_ variable need to be renamed, I`ve only done
ogi_callerid)... Since eit GPL, we might do a clean version for CW,
since I know alot of people want to use OGI.
Marc O.
--- phpagi.php 2005-05-26 19:09:57.000000000 -0400
+++ ../../phpagi.php 2007-11-26 14:30:05.000000000 -0500
@@ -34,8 +34,8 @@
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR .
'phpagi-asmanager.php');
}
- define('AST_CONFIG_DIR', '/etc/asterisk/');
- define('AST_SPOOL_DIR', '/var/spool/asterisk/');
+ define('AST_CONFIG_DIR', '/opt/cw/etc/');
+ define('AST_SPOOL_DIR', '/opt/cw/var/spool/');
define('AST_TMP_DIR', AST_SPOOL_DIR . '/tmp/');
define('DEFAULT_PHPAGI_CONFIG', AST_CONFIG_DIR . '/phpagi.conf');
@@ -76,7 +76,7 @@
* agi_language - current language
* agi_type - channel type (SIP, ZAP, IAX, ...)
* agi_uniqueid - unique id based on unix time
- * agi_callerid - callerID string
+ * ogi_callerid - callerID string
* agi_dnid - dialed number id
* agi_rdnis - referring DNIS number
* agi_context - current context
@@ -188,7 +188,7 @@
}
// open audio if eagi detected
- if($this->request['agi_enhanced'] == '1.0')
+ if($this->request['ogi_enhanced'] == '1.0')
{
if(file_exists('/proc/' . getmypid() . '/fd/3'))
$this->audio = fopen('/proc/' . getmypid() . '/fd/3', 'r');
@@ -382,7 +382,11 @@
{
return $this->evaluate("GET VARIABLE $variable");
}
-
+ function get_variabledata($variable)
+ {
+ $tmp = $this->get_variable($variable);
+ return $tmp['data'];
+ }
/**
* Hangup the specified channel. If no channel name is given, hang
up the current channel.
*
@@ -1202,7 +1206,7 @@
function parse_callerid($callerid=NULL)
{
if(is_null($callerid))
- $callerid = $this->request['agi_callerid'];
+ $callerid = $this->request['ogi_callerid'];
$ret = array('name'=>'', 'protocol'=>'', 'username'=>'',
'host'=>'', 'port'=>'');
$callerid = trim($callerid);
@@ -1325,7 +1329,9 @@
fclose($fp);
}
- shell_exec("{$this->config['cepstral']['swift']} -p
audio/channels=1,audio/sampling-rate=$frequency $voice -o $fname.wav -f
$fname.txt");
+// shell_exec("{$this->config['cepstral']['swift']} -p
audio/channels=1,audio/sampling-rate=$frequency -n $voice -o $fname.wav
-e utf-8 -f $fname.txt");
+ shell_exec("{$this->config['cepstral']['swift']} -p
audio/channels=1,audio/sampling-rate=$frequency $voice -o $fname.wav -e
utf-8 \"".addslashes($text)."\"");
+
}
// stream it
@@ -1336,7 +1342,6 @@
foreach(glob($this->config['phpagi']['tempdir'] .
DIRECTORY_SEPARATOR . 'swift_*') as $file)
if(filemtime($file) < $delete)
unlink($file);
-
return $ret;
}
Wolfgang Liegel wrote:
>
> Unfortunately this does not help. As I already mentioned I would like
> to use PHP (_not_ perl).
>
>
>
> Regards,
>
> Wolfgang
>
>
>
> ------------------------------------------------------------------------
>
> *Von:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *Im Auftrag von *Tusar
> *Gesendet:* Donnerstag, 29. November 2007 15:08
> *An:* [EMAIL PROTECTED]
> *Betreff:* Re: [Callweaver-users] OGI in PHP
>
>
>
> Hi,
>
> This may help ..
> http://wojia.be/index.php?q=openpbx_org_and_ogi
>
> Regards,
> ..Tusar..
>
> On Nov 29, 2007 7:33 PM, Wolfgang Liegel < [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> > I've done this with perl-AGI with 2 or 3 search-and-replace operations.
>
> I know, it's not very difficult to port perl AGI Scripts to OGI.
> But I need to use PHP scripts because they depend on a webservices PHP
> library I'd like to use. I also don't want to rewrite the whole PHP
> script in perl (including the WS library).
> Has anyone already implemented OGI scripts written in PHP?
> Regards,
> Wolfgang
>
>
>
> _______________________________________________
> Callweaver-users mailing list
> [email protected] <mailto:[email protected]>
> http://lists.callweaver.org/mailman/listinfo/callweaver-users
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Callweaver-users mailing list
> [email protected]
> http://lists.callweaver.org/mailman/listinfo/callweaver-users
>
_______________________________________________
Callweaver-users mailing list
[email protected]
http://lists.callweaver.org/mailman/listinfo/callweaver-users