While executing a shell script from the dial plan it is consuming much time to execute that script.How can i overcome this problem in reducing execution time of shell script when used in dial plan.IanThank you for the reply that worked for me and I have one more doubt.
On Thu, May 8, 2014 at 7:35 PM, Ian McMaster <ian.mcmaster@gmail.com> wrote:
Nikhitha,You are using 'sed' to print the first line (head -1), which will include a line return.This will work:Create a shell script "getplayfile.sh" and in your dialplan use:data="RESULT=${system getplayfile.sh}"The shell script can use tr to strip out the end of line as follows:sed -n 1p /nfs/th/play/${uuid} | tr "\n" "\0"On Thu, May 8, 2014 at 6:55 AM, Nikhitha T <nikhitha.voxta@gmail.com> wrote:
_________________________________________________________________________In freeswitch as I am setting the variable like this
<action application="set" data="RESULT=${system sed -n 1p /nfs/th/play/${uuid}}" inline="true"/>
Here i am trying to assign the wav file path to the variable,but here the problem is it is getting assigned as
2014-05-08 13:34:56.659049 [DEBUG] mod_dptools.c:1402 sofia/internal/1002@192.168.0.106 SET [RESULT]=[/usr/local/freeswitch/sounds/en/us/callie/directory/8000/dir-for_prev.wav
]
The variable RESULT is not being set properly,The closing square bracket is coming to the new line as it should be in the same line immediately after the path.So while playing the wav file it is showing the error as
2014-05-08 13:34:56.679046 [ERR] switch_core_file.c:150 Invalid file format [wav
] for [/usr/local/freeswitch/sounds/en/us/callie/directory/8000/dir-for_prev.wav
]!Can anyone help me in solving this issue.Thanks in advance
--
Thanks & Regards
---------------------------------
Nikhitha
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
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
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
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
--
Thanks & Regards
---------------------------------
Nikhitha
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
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