On 9/20/06, Giorgio Incantalupo <[EMAIL PROTECTED]> wrote:
Hi,
I have a problem with Asterisk AGI command.
I wrote a script which  launches a shell command.
If I launch a normal command for example like "ll > /tmp/tmp.txt", the
AGI command launches the shell commands and then exits.

The problem is when I launch THIS command to create an ssh tunnel in
background:
*ssh -f -N -l asterisk -R 2050:localhost:22 192.168.0.1*

The tunnel command above works well if launched via shell but if I
launch it using the AGI script, it opens the tunnel but leaves a (SIP or
ZAP) channel  in use (I checked it typing SIP/ZAP SHOW CHANNELS).
The channel closes only when I kill the tunnel process. After killing
the process Asterisk console shows:

-- AGI Script tunnel.py completed, returning 0

Is there anybody who knows why the channel remains busy?


The intent of an AGI script is to have a script/executable that
interacts with the channel. As such, the channel will hang around
waiting for input from, providing feedback to, and the eventual
completion of such script/executable.

If you don't want such behavior, you might want to take a look at
monitoring a specific channel event in the Asterisk manager and then
starting off your script upon the receipt of such an event through the
manager.

--
Bird's The Word Technologies, Inc.
http://www.btwtech.com/
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to