[Freeswitch-users] Set command is not working with the variable value in freeswitch

Sean Devoy sdevoy at bizfocused.com
Fri May 9 15:20:44 MSD 2014


Oh, you are most probably correct. That explains a lot to me.  In my own case, that is close to the name of my recording files directly, so I ran the wrong direction (as usual).

From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Ian McMaster
Sent: Thursday, May 08, 2014 5:30 PM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] Set command is not working with the variable value in freeswitch

My assumption, because of the use of 'sed', is that the name of the wav file is in the contents of the file /nfs/th/play/${uuid}.
So the playfile must be extracted from the file.  There are many ways to do this, but a simple way is sed (or head, cat, etc).
This could be something like a TTS utility creating a dynamic voice file, and the name of the file gets put into a unique file on the nfs mount.

Ian.

On Thu, May 8, 2014 at 4:00 PM, Sean Devoy <sdevoy at bizfocused.com<mailto:sdevoy at bizfocused.com>> wrote:
OK, I might be missing something, but why not just use:
<action application="set" data="RESULT=/nfs/th/play/${uuid}" inline="true"/>

It produced this in my test:
[RESULT]=[/nfs/th/play/f44e2a8e-274d-4d71-807c-c02e62e85efc]

Sean


From: freeswitch-users-bounces at lists.freeswitch.org<mailto:freeswitch-users-bounces at lists.freeswitch.org> [mailto:freeswitch-users-bounces at lists.freeswitch.org<mailto:freeswitch-users-bounces at lists.freeswitch.org>] On Behalf Of Ian McMaster
Sent: Thursday, May 08, 2014 10:06 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] Set command is not working with the variable value in freeswitch

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 at gmail.com<mailto:nikhitha.voxta at 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 at 192.168.0.106<mailto:1002 at 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 at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com




Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at 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 at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com




Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140509/40c32aeb/attachment.html 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list