Broken pipe error with phpagi script

Discussion in 'General' started by Dirk2099, Nov 26, 2010.

  1. Dirk2099

    Joined:
    Nov 24, 2010
    Messages:
    2
    Likes Received:
    0
    I am using elastix v2.0.3

    I keep getting pipe errors with any custom php script I try to execute except if I use the default php scripts in the agi-bin. But If I try to copy and paste the code from the wake-up.php script into my own test.php script I get a pipe error. But If I run the wake-up.php script normally it runs fine.

    If I put anything other than the execute path #!/usr/bin/php -q in the script I get a pipe error.
    even if I just put the <?php ?> tags in I get the error.
    Code:
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    My directories permissions are set correctly.

    Any help would be deeply appreciated.

    asterisk log
    Code:
    [Nov 24 22:01:52] VERBOSE[2814] pbx.c: -- Executing [#############@skype:1] Answer("SIP/skype02-00000000", "") in new stack
    [Nov 24 22:01:53] VERBOSE[2814] pbx.c: -- Executing [##############@skype:2] Playback("SIP/skype02-00000000", "digits/5") in new stack
    [Nov 24 22:01:53] VERBOSE[2814] file.c: -- <SIP/skype02-00000000> Playing 'digits/5.gsm' (language 'en')
    [Nov 24 22:01:54] VERBOSE[2814] pbx.c: -- Executing [#############@skype:3] AGI("SIP/skype02-00000000", "test.php") in new stack
    [Nov 24 22:01:54] VERBOSE[2814] res_agi.c: -- Launched AGI Script /var/lib/asterisk/agi-bin/test.php
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] ERROR[2814] utils.c: write() returned error: Broken pipe
    [Nov 24 22:01:54] VERBOSE[2814] res_agi.c: -- <SIP/skype02-00000000>AGI Script test.php completed, returning 0
    [Nov 24 22:01:54] VERBOSE[2814] pbx.c: -- Executing [###########@skype:4] Hangup("SIP/skype02-00000000", "") in new stack
    [Nov 24 22:01:54] VERBOSE[2814] pbx.c: == Spawn extension (skype, 16036144323, 4) exited non-zero on 'SIP/skype02-00000000'

    my test.php script
    Code:
    #!/usr/bin/php -q
    <?php
    error_reporting(E_ALL);
    set_time_limit(0);
    require('phpagi.php');
    $agi = new AGI();
    $agi->answer();
    sleep(3)
    $agi text2wave("Hello Derek, happy t day");
    $agi hangup();
    ?>
     

Share This Page