<div dir="ltr">My assumption, because of the use of &#39;sed&#39;, is that the name of the wav file is in the contents of the file /nfs/th/play/${uuid}.<div>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).</div>
<div>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.</div><div><br></div><div>Ian.</div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Thu, May 8, 2014 at 4:00 PM, Sean Devoy <span dir="ltr">&lt;<a href="mailto:sdevoy@bizfocused.com" target="_blank">sdevoy@bizfocused.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">OK, I might be missing something, but why not just use:<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue">&lt;</span><span style="font-size:9.5pt;font-family:Consolas;color:#a31515">action</span><span style="font-size:9.5pt;font-family:Consolas;color:blue">
</span><span style="font-size:9.5pt;font-family:Consolas;color:red">application</span><span style="font-size:9.5pt;font-family:Consolas;color:blue">=</span><span style="font-size:9.5pt;font-family:Consolas">&quot;<span style="color:blue">set</span>&quot;<span style="color:blue">
</span><span style="color:red">data</span><span style="color:blue">=</span>&quot;<span style="color:blue">RESULT=/nfs/th/play/${uuid}</span>&quot;<span style="color:blue">
</span><span style="color:red">inline</span><span style="color:blue">=</span>&quot;<span style="color:blue">true</span>&quot;<span style="color:blue">/&gt;<u></u><u></u></span></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">It produced this in my test:<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas">[RESULT]=[/nfs/th/play/f44e2a8e-274d-4d71-807c-c02e62e85efc]<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas">Sean<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>]
<b>On Behalf Of </b>Ian McMaster<br>
<b>Sent:</b> Thursday, May 08, 2014 10:06 AM<br>
<b>To:</b> FreeSWITCH Users Help<br>
<b>Subject:</b> Re: [Freeswitch-users] Set command is not working with the variable value in freeswitch<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Nikhitha,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">You are using &#39;sed&#39; to print the first line (head -1), which will include a line return.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">This will work:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Create a shell script &quot;getplayfile.sh&quot; and in your dialplan use:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"> data=&quot;RESULT=${system getplayfile.sh}&quot;</span></b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">The shell script can use tr to strip out the end of line as follows:</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">sed -n 1p /nfs/th/play/${uuid} | tr &quot;\n&quot; &quot;\0&quot;</span><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Thu, May 8, 2014 at 6:55 AM, Nikhitha T &lt;<a href="mailto:nikhitha.voxta@gmail.com" target="_blank">nikhitha.voxta@gmail.com</a>&gt; wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">In freeswitch as I am setting the variable like this
<br>
<br>
<b>&lt;action application=&quot;set&quot; data=&quot;RESULT=${system sed -n 1p /nfs/th/play/${uuid}}&quot; inline=&quot;true&quot;/&gt;</b><br>
<br>
 Here i am trying to assign the wav file path to the variable,but here the problem is it is getting assigned as
<br>
<b><br>
2014-05-08 13:34:56.659049 [DEBUG] mod_dptools.c:1402 sofia/internal/<a href="mailto:1002@192.168.0.106" target="_blank">1002@192.168.0.106</a> SET [RESULT]=[/usr/local/freeswitch/sounds/en/us/callie/directory/8000/dir-for_prev.wav<br>

<br>
]</b><br>
<br>
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<br>
<br>
<b>2014-05-08 13:34:56.679046 [ERR] switch_core_file.c:150 Invalid file format [wav<br>
<br>
] for [/usr/local/freeswitch/sounds/en/us/callie/directory/8000/dir-for_prev.wav<br>
<br>
]!</b><u></u><u></u></p>
<p>Can anyone help me in solving this issue.Thanks in advance<u></u><u></u></p>
<p class="MsoNormal"><span style="color:#888888"><br>
<br clear="all">
<br>
<span>-- </span><br>
<span>Thanks &amp; Regards</span><br>
<span>---------------------------------</span><br>
<span>Nikhitha</span></span><u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>

<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>