[Home]

Summary:ASTERISK-02516: STREAM FILE and GET DATA not work in current cvs
Reporter:erik123 (erik123)Labels:
Date Opened:2004-10-10 11:31:27Date Closed:2011-06-07 14:10:12
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:STREAM FILE and GET DATA not work in current cvs
the sound not lisen and * ignore this command but checked for sintacsis :(
but in extensions.conf f.e. background(....) play normal
and in agi _write_(exec background ....) work too.
Please help!!!

****** ADDITIONAL INFORMATION ******

#!/usr/bin/php -q
<?php
ob_implicit_flush(true);
set_time_limit(0);
$in = fopen("php://stdin","r");
$out = fopen("php://stdout","w");
$stdlog = fopen("/var/log/asterisk/my_agi.log", "w");

// toggle debugging output (more verbose)
$debug = false;


// Do function definitions before we start the main loop
function _read_() {
  global $in, $debug;
  $input = str_replace("\n", "", fgets($in, 4096));
  echo "VERBOSE \"read: $input\"\n";
  return $input;
}

function _errlog_($line) {
  global $err;
  echo "VERBOSE \"$line\"\n";
}

function _write_($line) {
  global $debug, $out;
//   echo "VERBOSE \"write: $line\"\n";
//   echo $line."\n";
    $nline=$line."\n";
    fwrite($out,$nline);
    fflush($out);
}
// main program

// parse agi headers into array
while ($env=_read_()) {
  $s = explode(": ",$env);
  $agivar[$s[0]] = trim($s[1]);
  if (($env == "") || ($env == "\n")) {
    break;
  }
}
_read_();
_write_("STREAM FILE transfer \"\"");
$inpdigits=_read_();
_errlog_("digit : ".$inpdigits);
_read_();
_read_();
_read_();
fclose($in);
fclose($out);

exit;
?>

at * ( agi debug )
-- Executing Answer("SIP/192.168.0.10-081420a0", "") in new stack
   -- Executing AGI("SIP/192.168.0.10-081420a0", "/tmp/ramdisk0/voice_test1.php") in new stack
......
......
AGI Tx >> 200 result=1
AGI Rx << VERBOSE "read: 200 result=1"
 /tmp/ramdisk0/voice_test1.php: read: 200 result=1
AGI Tx >> 200 result=1
AGI Rx << STREAM FILE transfer ""
Oct 10 17:29:55 DEBUG[1106204352]: rtp.c:1175 ast_rtp_write: Ooh, format changed from UNKN to ALAW
AGI Rx << VERBOSE "read: 200 result=1"
 /tmp/ramdisk0/voice_test1.php: read: 200 result=1
AGI Tx >> 200 result=1
AGI Rx << VERBOSE "digit : 200 result=1"
 /tmp/ramdisk0/voice_test1.php: digit : 200 result=1
AGI Tx >> 200 result=1
AGI Rx << VERBOSE "read: 200 result=1"
 /tmp/ramdisk0/voice_test1.php: read: 200 result=1
AGI Tx >> 200 result=1
AGI Rx << VERBOSE "read: 200 result=1"
 /tmp/ramdisk0/voice_test1.php: read: 200 result=1
AGI Tx >> 200 result=1
AGI Rx << VERBOSE "read: 200 result=1"
 /tmp/ramdisk0/voice_test1.php: read: 200 result=1
AGI Tx >> 200 result=1
....
....

extensions.conf
exten => 123,1,answer
exten => 123,2,agi,/tmp/ramdisk0/voice_test1.php
exten => 123,3,hangup

Comments:By: Mark Spencer (markster) 2004-10-10 11:59:46

You're not sending carriage returns except in your "verbose" calls.  Do not use the bug tracker for technical support, only for real bugs.  I suggest #asterisk, the asterisk-dev mailing list for free support, or digium support if you want to pay money.