Menu

BACKGROUND command

2005-02-28
2013-04-29
  • Mark Scheel

    Mark Scheel - 2005-02-28

    Can the background command be used with agi?

    I tried:

    $agi->agi_exec("BACKGROUND demo-instruct #") and it just skips the command during execution.

    In contrast this works fine:

    $agi->agi_exec("BACKGROUND demo-instruct #")

    If anyone has a code snippet including the get_dtmf or some command that captures the users input let me know.

    As far as I can tell this command is only available through mods to extensions.conf (not agi), but there appear to be perl agi modules that support background.

    I am not using the latest 2.0 code for phpagi.

     
    • Mark Scheel

      Mark Scheel - 2005-02-28

      Sorry typo'd the second (working) command instead of BACKGROUND it should say STREAM FILE.

       
    • Mark Scheel

      Mark Scheel - 2005-02-28

      I figured it out.  Turns out that you don't need background at all.

      This page got me started:

      http://asterisk.drunkcoder.com/agi.cgi

      It states that you can send a string of digits that can interrupt the file being streamed when using STREAM FILE.

      I modified my phpagi version's agi_text2wav function to send this parameter when it calls STREAM to play the wav file and then changed it to return a value (chr($res[result])) and it works.

      The talking is interrupted and I know what the user pressed. 

      Just out of curiosity could I have saved my self some time and used the 2.0 phpagi version in CVS?
      Does it have this feature?

      Thanks Matthew and crew for phpagi, its a nice framework for writing agi scripts in php.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.