<div dir="ltr"><div>Sean,<br> <br></div>I may not use this <br><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue"><</span><span style="font-size:9.5pt;font-family:Consolas;color:rgb(163,21,21)">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">"<span style="color:blue">set</span>"<span style="color:blue">
</span><span style="color:red">data</span><span style="color:blue">=</span>"<span style="color:blue">RESULT=/nfs/th/play/${uuid}</span>"<span style="color:blue">
</span><span style="color:red">inline</span><span style="color:blue">=</span>"<span style="color:blue">true</span>"<span style="color:blue">/></span></span></p><p class="MsoNormal" style="text-autospace:none">
<br></p><p class="MsoNormal" style>Here the text file path is being stored in the variable.But what i want is to retrieve the first line of that text file that is the reason i am using sed command<br></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas"><span style="color:blue"></span></span></p><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 9, 2014 at 1:30 AM, Sean Devoy <span dir="ltr"><<a href="mailto:sdevoy@bizfocused.com" target="_blank">sdevoy@bizfocused.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";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"><</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">"<span style="color:blue">set</span>"<span style="color:blue">
</span><span style="color:red">data</span><span style="color:blue">=</span>"<span style="color:blue">RESULT=/nfs/th/play/${uuid}</span>"<span style="color:blue">
</span><span style="color:red">inline</span><span style="color:blue">=</span>"<span style="color:blue">true</span>"<span style="color:blue">/><u></u><u></u></span></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";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:"Verdana","sans-serif";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <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 'sed' 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 "getplayfile.sh" and in your dialplan use:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif""> data="RESULT=${system getplayfile.sh}"</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:"Arial","sans-serif"">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:"Arial","sans-serif"">sed -n 1p /nfs/th/play/${uuid} | tr "\n" "\0"</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 <<a href="mailto:nikhitha.voxta@gmail.com" target="_blank">nikhitha.voxta@gmail.com</a>> 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><action application="set" data="RESULT=${system sed -n 1p /nfs/th/play/${uuid}}" inline="true"/></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 & 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><br clear="all"><br>-- <br>Thanks & Regards<br>---------------------------------<br>Nikhitha<br>
</div>