[asterisk-users] Channel kept busy when creating ssh tunnel via AGI
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? TIA Giorgio Incantalupo ___ --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
Re: [asterisk-users] Channel kept busy when creating ssh tunnel via AGI
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
Re: [asterisk-users] Channel kept busy when creating ssh tunnel via AGI
On 06:25, Wed 20 Sep 06, BJ Weschke wrote: 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. Or if you want to go dirty: run an agi that looks lik this: #!/bin/sh /path/to/my/actual/script exit 0 -- Michiel van Baak [EMAIL PROTECTED] http://michiel.vanbaak.eu GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x71C946BD Why is it drug addicts and computer afficionados are both called users? ___ --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