Asterisk EAGI: Difference between revisions

From voipsupport
Jump to navigation Jump to search
(Created page with "==FreePBX Patch needed to be able to use EAGI== <pre>--- extensions.class.original.php 2016-06-18 19:23:14.009320154 +0200 +++ extensions.class.php 2016-06-18 15:54:11.273444...")
 
No edit summary
Line 15: Line 15:
  function output() {
  function output() {
  return "DeadAGI(".$this->data.")";</pre>
  return "DeadAGI(".$this->data.")";</pre>
==PHPAGI patch to the version distributed in FreePBX to be able to open audio stream==
<pre>--- phpagi.dist.php 2016-06-19 09:07:55.475372158 +0200
+++ phpagi.php 2016-06-19 09:46:12.734317454 +0200
@@ -173,10 +173,10 @@
      // open audio if eagi detected
      if($this->request['agi_enhanced'] == '1.0')
      {
-        if(file_exists('/proc/' . getmypid() . '/fd/3'))
+ if (array_search('php',stream_get_wrappers())!==FALSE)
        {
          // this should work on linux
-          $this->audio = fopen('/proc/' . getmypid() . '/fd/3', 'r');
+          $this->audio = fopen('php://fd/' . AUDIO_FILENO, 'r');
        }
        elseif(file_exists('/dev/fd/3'))
        {</pre>

Revision as of 18:42, 19 June 2016

FreePBX Patch needed to be able to use EAGI

--- extensions.class.original.php	2016-06-18 19:23:14.009320154 +0200
+++ extensions.class.php	2016-06-18 15:54:11.273444005 +0200
@@ -1251,6 +1251,11 @@
 		return "AGI(".$this->data.")";
 	}
 }
+class ext_eagi extends extension {
+	function output() {
+		return "EAGI(".$this->data.")";
+	}
+}
 class ext_deadagi extends extension {
 	function output() {
 		return "DeadAGI(".$this->data.")";

PHPAGI patch to the version distributed in FreePBX to be able to open audio stream

--- phpagi.dist.php	2016-06-19 09:07:55.475372158 +0200
+++ phpagi.php	2016-06-19 09:46:12.734317454 +0200
@@ -173,10 +173,10 @@
       // open audio if eagi detected
       if($this->request['agi_enhanced'] == '1.0')
       {
-        if(file_exists('/proc/' . getmypid() . '/fd/3'))
+	if (array_search('php',stream_get_wrappers())!==FALSE)
         {
           // this should work on linux
-          $this->audio = fopen('/proc/' . getmypid() . '/fd/3', 'r');
+          $this->audio = fopen('php://fd/' . AUDIO_FILENO, 'r');
         }
         elseif(file_exists('/dev/fd/3'))
         {