[Freeswitch-users] LUA Call duration or Billing Sec

Sergey Okhapkin sos at sokhapkin.dyndns.org
Mon Mar 15 07:48:34 PDT 2010


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 at 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 at lists.freeswitch.org
> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> > http://www.freeswitch.org
> 





More information about the FreeSWITCH-users mailing list