Re: [Freeswitch-users] api_hangup_hook and bash
I'm pretty sure that this is doable. Could you give us a hint as to what arguments you want to send? For example, do you have one or more channel variables you'd like to pass to the shell script? -MC Sent from my iPhone On Dec 23, 2008, at 6:25 PM, Jason White <jason@jasonjgw.net> wrote:
Frank @ Impact <frank@impactfax.com> wrote:
Can this command be used to run a bash script?
Based on information at the wiki, this should be possible; use the system command. http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_system
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
All I am passing into the script is the recording file name. I tried using the system command right after the bridge command but before a hangup command. Thusly, <action application="bridge" data="${enum_auto_route}"/> <action application="system" data="/root/procrecording.sh $${base_dir}/recordings/12-26-11_10_23_55555555_444444444_1.wav"/> <action application="hangup"/> The problem I am seeing is that sometimes this script gets run and sometimes it does not. I think it has to do maybe with which end hangs up the phone. But I cannot seem to nail it down just yet... -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael S Collins I'm pretty sure that this is doable. Could you give us a hint as to what arguments you want to send? For example, do you have one or more channel variables you'd like to pass to the shell script? -MC
I have confirmed that this system call does not fire if the calling party hangs up the phone first. Is there a way to get the script to fire regardless of who hangs up first? -F -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Frank @ Impact <action application="bridge" data="${enum_auto_route}"/> <action application="system" data="/root/procrecording.sh $${base_dir}/recordings/12-26-11_10_23_55555555_444444444_1.wav"/> <action application="hangup"/> The problem I am seeing is that sometimes this script gets run and sometimes it does not. I think it has to do maybe with which end hangs up the phone. But I cannot seem to nail it down just yet...
I also tried this without success. This will not fire at all regardless of who hangs up. <action application="set" data="api_hangup_hook=system /root/test.sh $${base_dir}/recordings/9000_1.wav"/> <action application="bridge" data="${enum_auto_route}"/> -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Frank @ Impact -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Frank @ Impact <action application="bridge" data="${enum_auto_route}"/> <action application="system" data="/root/procrecording.sh $${base_dir}/recordings/12-26-11_10_23_55555555_444444444_1.wav"/> <action application="hangup"/> The problem I am seeing is that sometimes this script gets run and sometimes it does not. I think it has to do maybe with which end hangs up the phone. But I cannot seem to nail it down just yet...
Frank, I'm going to check this out as soon as I can get my test system back on line. Thanks. -MC P.S. - what FS version and OS version are you on? I test with latest trunk and CentOS 5.2 On Fri, Dec 26, 2008 at 11:57 AM, Frank @ Impact <frank@impactfax.com>wrote:
I also tried this without success. This will not fire at all regardless of who hangs up.
<action application="set" data="api_hangup_hook=system /root/test.sh $${base_dir}/recordings/9000_1.wav"/> <action application="bridge" data="${enum_auto_route}"/>
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Frank @ Impact
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Frank @ Impact
<action application="bridge" data="${enum_auto_route}"/> <action application="system" data="/root/procrecording.sh $${base_dir}/recordings/12-26-11_10_23_55555555_444444444_1.wav"/> <action application="hangup"/>
The problem I am seeing is that sometimes this script gets run and sometimes it does not. I think it has to do maybe with which end hangs up the phone. But I cannot seem to nail it down just yet...
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
This should work, is there any debug output at hangup that would indicate why it doesn't run? Mike On Dec 26, 2008, at 2:57 PM, Frank @ Impact wrote:
I also tried this without success. This will not fire at all regardless of who hangs up.
<action application="set" data="api_hangup_hook=system /root/test.sh $${base_dir}/recordings/9000_1.wav"/> <action application="bridge" data="${enum_auto_route}"/>
This is correct, if the a leg hangs up it will not continue to run the dialplan actions. On Dec 26, 2008, at 11:57 AM, Frank @ Impact wrote:
I have confirmed that this system call does not fire if the calling party hangs up the phone first. Is there a way to get the script to fire regardless of who hangs up first?
-F
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Frank @ Impact
<action application="bridge" data="${enum_auto_route}"/> <action application="system" data="/root/procrecording.sh $${base_dir}/recordings/12-26-11_10_23_55555555_444444444_1.wav"/> <action application="hangup"/>
The problem I am seeing is that sometimes this script gets run and sometimes it does not. I think it has to do maybe with which end hangs up the phone. But I cannot seem to nail it down just yet...
I also tried to add this <action application="set" data="hangup_after_bridge=false"/> to keep the dialplan process on a-leg hangup. But that did not work either. Svn 10960 is what I am testing. -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Jerris This is correct, if the a leg hangs up it will not continue to run the dialplan actions.
There is no way to make the dialplan continue to run when you hang up the a leg, that is correct. Mike On Dec 26, 2008, at 3:20 PM, Frank @ Impact wrote:
I also tried to add this
<action application="set" data="hangup_after_bridge=false"/>
to keep the dialplan process on a-leg hangup. But that did not work either.
Svn 10960 is what I am testing.
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Jerris
This is correct, if the a leg hangs up it will not continue to run the dialplan actions.
participants (4)
-
Frank @ Impact
-
Michael Collins
-
Michael Jerris
-
Michael S Collins