Hello, list<br><br>I have this lua script, i try to put music to the aleg while do another task, but it is not working (not audio at all), any advice on what am doing wrong?<br><br>THanks in advance, here my script:<br><br>
----------------------------------------------------------------------------------------------<br><br>require &#39;socket&#39;<br>local host = &quot;127.0.0.1&quot;<br>local port = 8021<br><br>function set_hold(uuid)<br>    local conn = socket.connect(host, port)<br>
<br>    if (conn) then<br>        local cmd = &quot;bgapi uuid_broadcast &quot; .. uuid .. &quot; /opt/freeswitch/sounds/es/dm/dm-promo-recharge-hold.G729 aleg&quot;;<br>        freeswitch.consoleLog(&quot;info&quot;, &quot;CMD: &quot; .. cmd .. &quot;\n&quot;)<br>
        conn:send(string.format(&quot;auth ClueCon\r\n\r\n%s\r\n\r\nexit\r\n\r\n&quot;, cmd))<br>        line, err = conn:receive()<br>        while (not err) do<br>            if (line ~= nil) then freeswitch.consoleLog(&quot;info&quot;, &quot;SCKT: &quot; .. line .. &quot;\n&quot;) end<br>
            line, err = conn:receive()<br>        end<br>        conn:close()<br>    else<br>        debug.notice(&quot;Error posting to server: &quot; .. host .. &quot;:&quot; .. port)<br>    end<br>end<br><br>function sleep(n)<br>
   os.execute(&quot;sleep &quot; .. tonumber(n))<br>end<br><br>session:answer()<br>session:sleep(500);<br>uuid = session:get_uuid();<br>freeswitch.consoleLog(&quot;info&quot;, &quot;UUID: &quot; .. uuid .. &quot;\n&quot;);<br>
<br>api = freeswitch.API();<br><br>set_hold(uuid);<br>freeswitch.consoleLog(&quot;info&quot;, &quot; - - - RETURNED - - -\n&quot;);<br><br><br>for i=1,50 do<br>    if not session:ready() then break end<br>    sleep(1);<br>
end<br><br>if session:ready() then api:executeString(&quot;uuid_break&quot; .. uuid); end<br>freeswitch.consoleLog(&quot;info&quot;, &quot; - - - FINNISH COUNTING - - -\n&quot;);<br><br>session:hangup();<br><br>----------------------------------------------------------------------------------<br>
<br>