Phpagi problems

could someone maybe help me with these

  1. i tried using phpagi, $agi->text2wav(“test”); worked, could hear voice,
    but how could i use stream_file function, eg $agi->stream_file(‘mymessage.gsm’);
    File mymessage.gsm does not exist in any format
    File /tmp/mymessage.gsm does not exist in any format
    File /tmp/play.mp3 does not exist in any format
    File /tmp/_ha.wav does not exist in any format
    File /tmp/u.ulaw does not exist in any format
    File u.ulaw does not exist in any format
    what could be wrong, it can’t even play ulaw file ?
  2. i tried using dtmf.php, but it seems to never detect any dtmf tones, i only get some infinite “You entered” [end of sentence] loop.
    do i need to add some configuration to enable dtmf ?
    my current sip.conf has:
    ;dtmfmode = rfc2833 ; not set, because it seems to be default value. Default: rfc2833
    rfc2833compensate=yes
    i tried calling from voip phone as well gsm, detects nothing.

if you believe i’d be better to switch to some other library, tnx for suggestion.

Not sure about number 2 but I had the same problem with streamfile. Try streaming one of the build in asterisk sounds. It may work. If it does for me the problem was that I was recording the audio files all wrong. I need to recored them in mono channel, 8000khz. Once I did that they would play just fine when called with stream_file.

$agi->stream_file(’/var/lib/asterisk/sounds/mymessage.gsm’);

try that, or wherever your mymessage.gsm resides…

Try pass the file name to stream without the extension, so try

$agi->stream_file('mymessage');

instead of

$agi->stream_file('mymessage.gsm');

Cheers.

Marco Bruni
www.marcobruni.net