Hi All, I have the following simple Lua script answer a inbound call then dial another number and bridge the call. Is there any way to get the call duration or billing sec using the session:getVariable( ); -- answer the call session:answer(); -- sleep a second session:sleep(1000); -- Initiate an outbound call obSession = freeswitch.Session("sofia/gateway/voipms/14165555555",session) obSession:execute("sched_hangup","+60 alloted_timeout"); -- bride the call freeswitch.bridge(session, obSession); -- hangup session:hangup(); Thank you Lloyd
Unfortunately all "interesting" billing-related channel variables are set after the lua script execution, when channel enters REPORTING state. To access those variables I execute separate lua script using mod_cdr_csv, it allows to invoke lua script. On Monday 15 March 2010, Aloysius Lloyd wrote:
Hi All,
I have the following simple Lua script answer a inbound call then dial another number and bridge the call.
Is there any way to get the call duration or billing sec using the
session:getVariable( );
-- answer the call session:answer();
-- sleep a second session:sleep(1000);
-- Initiate an outbound call obSession = freeswitch.Session("sofia/gateway/voipms/14165555555",session)
obSession:execute("sched_hangup","+60 alloted_timeout");
-- bride the call freeswitch.bridge(session, obSession);
-- hangup session:hangup();
Thank you Lloyd
How to execute another lua script when channel enter the REPORTING state? What are the channel variable names? Thanks Lloyd On Mon, Mar 15, 2010 at 9:56 AM, Sergey Okhapkin <sos@sokhapkin.dyndns.org>wrote:
Unfortunately all "interesting" billing-related channel variables are set after the lua script execution, when channel enters REPORTING state. To access those variables I execute separate lua script using mod_cdr_csv, it allows to invoke lua script.
On Monday 15 March 2010, Aloysius Lloyd wrote:
Hi All,
I have the following simple Lua script answer a inbound call then dial another number and bridge the call.
Is there any way to get the call duration or billing sec using the
session:getVariable( );
-- answer the call session:answer();
-- sleep a second session:sleep(1000);
-- Initiate an outbound call obSession = freeswitch.Session("sofia/gateway/voipms/14165555555",session)
obSession:execute("sched_hangup","+60 alloted_timeout");
-- bride the call freeswitch.bridge(session, obSession);
-- hangup session:hangup();
Thank you Lloyd
_______________________________________________ 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
cdr_csv.conf.xml: <param name="default-template" value="lua"/> <templates> <template name="lua">${lua(onhangup.lua)}</template> All variables described at http://wiki.freeswitch.org/wiki/Mod_cdr_csv are accessible from that lua script. On Monday 15 March 2010, Aloysius Lloyd wrote:
How to execute another lua script when channel enter the REPORTING state?
What are the channel variable names?
Thanks Lloyd
On Mon, Mar 15, 2010 at 9:56 AM, Sergey Okhapkin
<sos@sokhapkin.dyndns.org>wrote:
Unfortunately all "interesting" billing-related channel variables are set after the lua script execution, when channel enters REPORTING state. To access those variables I execute separate lua script using mod_cdr_csv, it allows to invoke lua script.
On Monday 15 March 2010, Aloysius Lloyd wrote:
Hi All,
I have the following simple Lua script answer a inbound call then dial another number and bridge the call.
Is there any way to get the call duration or billing sec using the
session:getVariable( );
-- answer the call session:answer();
-- sleep a second session:sleep(1000);
-- Initiate an outbound call obSession =
freeswitch.Session("sofia/gateway/voipms/14165555555",session)
obSession:execute("sched_hangup","+60 alloted_timeout");
-- bride the call freeswitch.bridge(session, obSession);
-- hangup session:hangup();
Thank you Lloyd
_______________________________________________ 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
How to trigger this template from the main script ? or Does this automatically trigger when finish the first script complete? Thanks Lloyd On Mon, Mar 15, 2010 at 10:48 AM, Sergey Okhapkin <sos@sokhapkin.dyndns.org>wrote:
cdr_csv.conf.xml:
<param name="default-template" value="lua"/> <templates> <template name="lua">${lua(onhangup.lua)}</template>
All variables described at http://wiki.freeswitch.org/wiki/Mod_cdr_csv are accessible from that lua script.
On Monday 15 March 2010, Aloysius Lloyd wrote:
How to execute another lua script when channel enter the REPORTING state?
What are the channel variable names?
Thanks Lloyd
On Mon, Mar 15, 2010 at 9:56 AM, Sergey Okhapkin
<sos@sokhapkin.dyndns.org>wrote:
Unfortunately all "interesting" billing-related channel variables are set after the lua script execution, when channel enters REPORTING state. To access those variables I execute separate lua script using mod_cdr_csv, it allows to invoke lua script.
On Monday 15 March 2010, Aloysius Lloyd wrote:
Hi All,
I have the following simple Lua script answer a inbound call then dial another number and bridge the call.
Is there any way to get the call duration or billing sec using the
session:getVariable( );
-- answer the call session:answer();
-- sleep a second session:sleep(1000);
-- Initiate an outbound call obSession =
freeswitch.Session("sofia/gateway/voipms/14165555555",session)
obSession:execute("sched_hangup","+60 alloted_timeout");
-- bride the call freeswitch.bridge(session, obSession);
-- hangup session:hangup();
Thank you Lloyd
_______________________________________________ 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
That script will be executed automatically when call ends. You can set some channel variables in the main lua script and access those variables from hangup lua script if you need to pass the information to the hangup script. On Monday 15 March 2010, Aloysius Lloyd wrote:
How to trigger this template from the main script ? or Does this automatically trigger when finish the first script complete?
Thanks Lloyd
On Mon, Mar 15, 2010 at 10:48 AM, Sergey Okhapkin
<sos@sokhapkin.dyndns.org>wrote:
cdr_csv.conf.xml:
<param name="default-template" value="lua"/> <templates> <template name="lua">${lua(onhangup.lua)}</template>
All variables described at http://wiki.freeswitch.org/wiki/Mod_cdr_csv are accessible from that lua script.
On Monday 15 March 2010, Aloysius Lloyd wrote:
How to execute another lua script when channel enter the REPORTING state?
What are the channel variable names?
Thanks Lloyd
On Mon, Mar 15, 2010 at 9:56 AM, Sergey Okhapkin
<sos@sokhapkin.dyndns.org>wrote:
Unfortunately all "interesting" billing-related channel variables are
set
after the lua script execution, when channel enters REPORTING state. To access those variables I execute separate lua script using mod_cdr_csv, it allows to invoke lua script.
On Monday 15 March 2010, Aloysius Lloyd wrote:
Hi All,
I have the following simple Lua script answer a inbound call then
dial
another number and bridge the call.
Is there any way to get the call duration or billing sec using the
session:getVariable( );
-- answer the call session:answer();
-- sleep a second session:sleep(1000);
-- Initiate an outbound call obSession =
freeswitch.Session("sofia/gateway/voipms/14165555555",session)
obSession:execute("sched_hangup","+60 alloted_timeout");
-- bride the call freeswitch.bridge(session, obSession);
-- hangup session:hangup();
Thank you Lloyd
_______________________________________________ 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
How to control the default-template. I do not want to run all the time when call hangup. I want only when I need for some hangup information.. Thanks Lloyd On Mon, Mar 15, 2010 at 11:02 AM, Sergey Okhapkin <sos@sokhapkin.dyndns.org>wrote:
That script will be executed automatically when call ends. You can set some channel variables in the main lua script and access those variables from hangup lua script if you need to pass the information to the hangup script.
On Monday 15 March 2010, Aloysius Lloyd wrote:
How to trigger this template from the main script ? or Does this automatically trigger when finish the first script complete?
Thanks Lloyd
On Mon, Mar 15, 2010 at 10:48 AM, Sergey Okhapkin
<sos@sokhapkin.dyndns.org>wrote:
cdr_csv.conf.xml:
<param name="default-template" value="lua"/> <templates> <template name="lua">${lua(onhangup.lua)}</template>
All variables described at http://wiki.freeswitch.org/wiki/Mod_cdr_csv are accessible from that lua script.
On Monday 15 March 2010, Aloysius Lloyd wrote:
How to execute another lua script when channel enter the REPORTING state?
What are the channel variable names?
Thanks Lloyd
On Mon, Mar 15, 2010 at 9:56 AM, Sergey Okhapkin
<sos@sokhapkin.dyndns.org>wrote:
Unfortunately all "interesting" billing-related channel variables are
set
after the lua script execution, when channel enters REPORTING state. To access those variables I execute separate lua script using mod_cdr_csv, it allows to invoke lua script.
On Monday 15 March 2010, Aloysius Lloyd wrote:
Hi All,
I have the following simple Lua script answer a inbound call then
dial
another number and bridge the call.
Is there any way to get the call duration or billing sec using the
session:getVariable( );
-- answer the call session:answer();
-- sleep a second session:sleep(1000);
-- Initiate an outbound call obSession =
freeswitch.Session("sofia/gateway/voipms/14165555555",session)
obSession:execute("sched_hangup","+60 alloted_timeout");
-- bride the call freeswitch.bridge(session, obSession);
-- hangup session:hangup();
Thank you Lloyd
_______________________________________________ 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
On Mon, Mar 15, 2010 at 10:50 AM, Aloysius Lloyd <lloyd.aloysius@gmail.com>wrote:
How to control the default-template. I do not want to run all the time when call hangup. I want only when I need for some hangup information..
Thanks Lloyd
I don't know that you can selectively run or not run a script at hangup time. However, since Lua is so lightweight it probably would be fine just to run it at each hangup. -MC
I would like to do some Database insert and update operations , Not for all the calls only the calls originating from a particular script. On Mon, Mar 15, 2010 at 5:15 PM, Michael Collins <msc@freeswitch.org> wrote:
On Mon, Mar 15, 2010 at 10:50 AM, Aloysius Lloyd <lloyd.aloysius@gmail.com
wrote:
How to control the default-template. I do not want to run all the time when call hangup. I want only when I need for some hangup information..
Thanks Lloyd
I don't know that you can selectively run or not run a script at hangup time. However, since Lua is so lightweight it probably would be fine just to run it at each hangup. -MC
_______________________________________________ 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
Lloyd, if you need to run different Lua scripts depending on some variables (or entirely skip the cdr), try my implementation. Documentation is in very embryonic state. You could get the overview from blog.buta-tech.com. Warning! all code snapshots on that page are obsolete! Latetest svn trunk is at http://nazim@svn.freeswitch.org/svn/freeswitch/trunk/contrib/nazim Regards, Nazim On 03/16/2010 01:38 AM, Aloysius Lloyd wrote:
I would like to do some Database insert and update operations , Not for all the calls only the calls originating from a particular script.
On Mon, Mar 15, 2010 at 5:15 PM, Michael Collins <msc@freeswitch.org <mailto:msc@freeswitch.org>> wrote:
On Mon, Mar 15, 2010 at 10:50 AM, Aloysius Lloyd <lloyd.aloysius@gmail.com <mailto:lloyd.aloysius@gmail.com>> wrote:
How to control the default-template. I do not want to run all the time when call hangup. I want only when I need for some hangup information..
Thanks Lloyd
I don't know that you can selectively run or not run a script at hangup time. However, since Lua is so lightweight it probably would be fine just to run it at each hangup. -MC
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto: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
Using event consumer immediately after session:hangup -- uuid = session.uuid session:hangup for e in (function() return con:pop(1) end) do -- psudo code -- if e.uuid == uuid and e.event_type == reporting then .... end note this is not safe since you may miss the event before you do con:pop, then maybe you can try non-blocking con:pop() ... not tested, just an idea. Anyway, doing inline bill is not recommended. 2010/3/15 Aloysius Lloyd <lloyd.aloysius@gmail.com>:
Hi All, I have the following simple Lua script answer a inbound call then dial another number and bridge the call. Is there any way to get the call duration or billing sec using the session:getVariable( );
-- answer the call session:answer(); -- sleep a second session:sleep(1000); -- Initiate an outbound call obSession = freeswitch.Session("sofia/gateway/voipms/14165555555",session) obSession:execute("sched_hangup","+60 alloted_timeout"); -- bride the call freeswitch.bridge(session, obSession); -- hangup session:hangup();
Thank you Lloyd _______________________________________________ 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 (5)
-
Aloysius Lloyd
-
Michael Collins
-
Nazim Agabekov
-
Sergey Okhapkin
-
Seven Du