Hello, list 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? THanks in advance, here my script: ---------------------------------------------------------------------------------------------- require 'socket' local host = "127.0.0.1" local port = 8021 function set_hold(uuid) local conn = socket.connect(host, port) if (conn) then local cmd = "bgapi uuid_broadcast " .. uuid .. " /opt/freeswitch/sounds/es/dm/dm-promo-recharge-hold.G729 aleg"; freeswitch.consoleLog("info", "CMD: " .. cmd .. "\n") conn:send(string.format("auth ClueCon\r\n\r\n%s\r\n\r\nexit\r\n\r\n", cmd)) line, err = conn:receive() while (not err) do if (line ~= nil) then freeswitch.consoleLog("info", "SCKT: " .. line .. "\n") end line, err = conn:receive() end conn:close() else debug.notice("Error posting to server: " .. host .. ":" .. port) end end function sleep(n) os.execute("sleep " .. tonumber(n)) end session:answer() session:sleep(500); uuid = session:get_uuid(); freeswitch.consoleLog("info", "UUID: " .. uuid .. "\n"); api = freeswitch.API(); set_hold(uuid); freeswitch.consoleLog("info", " - - - RETURNED - - -\n"); for i=1,50 do if not session:ready() then break end sleep(1); end if session:ready() then api:executeString("uuid_break" .. uuid); end freeswitch.consoleLog("info", " - - - FINNISH COUNTING - - -\n"); session:hangup(); ----------------------------------------------------------------------------------
are you running a lua script on the session and then trying to connect to event socket on the same server just to send it a command you can already do with a freeswitch.API object ? On Sun, Sep 18, 2011 at 2:48 PM, Luis Jimenez <ljjimenez@gmail.com> wrote:
Hello, list
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?
THanks in advance, here my script:
----------------------------------------------------------------------------------------------
require 'socket' local host = "127.0.0.1" local port = 8021
function set_hold(uuid) local conn = socket.connect(host, port)
if (conn) then local cmd = "bgapi uuid_broadcast " .. uuid .. " /opt/freeswitch/sounds/es/dm/dm-promo-recharge-hold.G729 aleg"; freeswitch.consoleLog("info", "CMD: " .. cmd .. "\n") conn:send(string.format("auth ClueCon\r\n\r\n%s\r\n\r\nexit\r\n\r\n", cmd)) line, err = conn:receive() while (not err) do if (line ~= nil) then freeswitch.consoleLog("info", "SCKT: " .. line .. "\n") end line, err = conn:receive() end conn:close() else debug.notice("Error posting to server: " .. host .. ":" .. port) end end
function sleep(n) os.execute("sleep " .. tonumber(n)) end
session:answer() session:sleep(500); uuid = session:get_uuid(); freeswitch.consoleLog("info", "UUID: " .. uuid .. "\n");
api = freeswitch.API();
set_hold(uuid); freeswitch.consoleLog("info", " - - - RETURNED - - -\n");
for i=1,50 do if not session:ready() then break end sleep(1); end
if session:ready() then api:executeString("uuid_break" .. uuid); end freeswitch.consoleLog("info", " - - - FINNISH COUNTING - - -\n");
session:hangup();
----------------------------------------------------------------------------------
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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
I did it that way because I tried thru the api, but got the same results Luis Jimenez -----Original Message----- From: Anthony Minessale <anthony.minessale@gmail.com> Sender: freeswitch-users-bounces@lists.freeswitch.org Date: Mon, 19 Sep 2011 10:24:32 To: FreeSWITCH Users Help<freeswitch-users@lists.freeswitch.org> Reply-To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> Subject: Re: [Freeswitch-users] uuid_broadcast not working are you running a lua script on the session and then trying to connect to event socket on the same server just to send it a command you can already do with a freeswitch.API object ? On Sun, Sep 18, 2011 at 2:48 PM, Luis Jimenez <ljjimenez@gmail.com> wrote:
Hello, list
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?
THanks in advance, here my script:
----------------------------------------------------------------------------------------------
require 'socket' local host = "127.0.0.1" local port = 8021
function set_hold(uuid) local conn = socket.connect(host, port)
if (conn) then local cmd = "bgapi uuid_broadcast " .. uuid .. " /opt/freeswitch/sounds/es/dm/dm-promo-recharge-hold.G729 aleg"; freeswitch.consoleLog("info", "CMD: " .. cmd .. "\n") conn:send(string.format("auth ClueCon\r\n\r\n%s\r\n\r\nexit\r\n\r\n", cmd)) line, err = conn:receive() while (not err) do if (line ~= nil) then freeswitch.consoleLog("info", "SCKT: " .. line .. "\n") end line, err = conn:receive() end conn:close() else debug.notice("Error posting to server: " .. host .. ":" .. port) end end
function sleep(n) os.execute("sleep " .. tonumber(n)) end
session:answer() session:sleep(500); uuid = session:get_uuid(); freeswitch.consoleLog("info", "UUID: " .. uuid .. "\n");
api = freeswitch.API();
set_hold(uuid); freeswitch.consoleLog("info", " - - - RETURNED - - -\n");
for i=1,50 do if not session:ready() then break end sleep(1); end
if session:ready() then api:executeString("uuid_break" .. uuid); end freeswitch.consoleLog("info", " - - - FINNISH COUNTING - - -\n");
session:hangup();
----------------------------------------------------------------------------------
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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900 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
When playing a native file you should not specify the extension. Apart from that, I have too little information based on such a vague account. You would probably want to check your console logs at debug level. On Mon, Sep 19, 2011 at 1:25 PM, <ljjimenez@gmail.com> wrote:
I did it that way because I tried thru the api, but got the same results
Luis Jimenez
-----Original Message----- From: Anthony Minessale <anthony.minessale@gmail.com> Sender: freeswitch-users-bounces@lists.freeswitch.org Date: Mon, 19 Sep 2011 10:24:32 To: FreeSWITCH Users Help<freeswitch-users@lists.freeswitch.org> Reply-To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> Subject: Re: [Freeswitch-users] uuid_broadcast not working
are you running a lua script on the session and then trying to connect to event socket on the same server just to send it a command you can already do with a freeswitch.API object ?
On Sun, Sep 18, 2011 at 2:48 PM, Luis Jimenez <ljjimenez@gmail.com> wrote:
Hello, list
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?
THanks in advance, here my script:
----------------------------------------------------------------------------------------------
require 'socket' local host = "127.0.0.1" local port = 8021
function set_hold(uuid) local conn = socket.connect(host, port)
if (conn) then local cmd = "bgapi uuid_broadcast " .. uuid .. " /opt/freeswitch/sounds/es/dm/dm-promo-recharge-hold.G729 aleg"; freeswitch.consoleLog("info", "CMD: " .. cmd .. "\n") conn:send(string.format("auth ClueCon\r\n\r\n%s\r\n\r\nexit\r\n\r\n", cmd)) line, err = conn:receive() while (not err) do if (line ~= nil) then freeswitch.consoleLog("info", "SCKT: " .. line .. "\n") end line, err = conn:receive() end conn:close() else debug.notice("Error posting to server: " .. host .. ":" .. port) end end
function sleep(n) os.execute("sleep " .. tonumber(n)) end
session:answer() session:sleep(500); uuid = session:get_uuid(); freeswitch.consoleLog("info", "UUID: " .. uuid .. "\n");
api = freeswitch.API();
set_hold(uuid); freeswitch.consoleLog("info", " - - - RETURNED - - -\n");
for i=1,50 do if not session:ready() then break end sleep(1); end
if session:ready() then api:executeString("uuid_break" .. uuid); end freeswitch.consoleLog("info", " - - - FINNISH COUNTING - - -\n");
session:hangup();
----------------------------------------------------------------------------------
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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
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
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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
Hello Anthony, i am trying to put the caller to listen background music, while the script continue sending a SMS using curl, the duration of this process (send SMS) is about 4 secs. Can you advice me on how to resolve this? Thanks in advance. Luis Jimenez On Mon, Sep 19, 2011 at 4:38 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
When playing a native file you should not specify the extension. Apart from that, I have too little information based on such a vague account.
You would probably want to check your console logs at debug level.
On Mon, Sep 19, 2011 at 1:25 PM, <ljjimenez@gmail.com> wrote:
I did it that way because I tried thru the api, but got the same results
Luis Jimenez
-----Original Message----- From: Anthony Minessale <anthony.minessale@gmail.com> Sender: freeswitch-users-bounces@lists.freeswitch.org Date: Mon, 19 Sep 2011 10:24:32 To: FreeSWITCH Users Help<freeswitch-users@lists.freeswitch.org> Reply-To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> Subject: Re: [Freeswitch-users] uuid_broadcast not working
are you running a lua script on the session and then trying to connect to event socket on the same server just to send it a command you can already do with a freeswitch.API object ?
On Sun, Sep 18, 2011 at 2:48 PM, Luis Jimenez <ljjimenez@gmail.com> wrote:
Hello, list
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?
THanks in advance, here my script:
require 'socket' local host = "127.0.0.1" local port = 8021
function set_hold(uuid) local conn = socket.connect(host, port)
if (conn) then local cmd = "bgapi uuid_broadcast " .. uuid .. " /opt/freeswitch/sounds/es/dm/dm-promo-recharge-hold.G729 aleg"; freeswitch.consoleLog("info", "CMD: " .. cmd .. "\n") conn:send(string.format("auth ClueCon\r\n\r\n%s\r\n\r\nexit\r\n\r\n", cmd)) line, err = conn:receive() while (not err) do if (line ~= nil) then freeswitch.consoleLog("info", "SCKT: "
..
line .. "\n") end line, err = conn:receive() end conn:close() else debug.notice("Error posting to server: " .. host .. ":" .. port) end end
function sleep(n) os.execute("sleep " .. tonumber(n)) end
session:answer() session:sleep(500); uuid = session:get_uuid(); freeswitch.consoleLog("info", "UUID: " .. uuid .. "\n");
api = freeswitch.API();
set_hold(uuid); freeswitch.consoleLog("info", " - - - RETURNED - - -\n");
for i=1,50 do if not session:ready() then break end sleep(1); end
if session:ready() then api:executeString("uuid_break" .. uuid); end freeswitch.consoleLog("info", " - - - FINNISH COUNTING - - -\n");
session:hangup();
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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
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
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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
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
participants (3)
-
Anthony Minessale
-
ljjimenez@gmail.com
-
Luis Jimenez