[Freeswitch-users] Question Answertime variable? billsec is not available

Michael Collins msc at freeswitch.org
Wed Dec 14 03:38:31 MSK 2011


Are you trying to access these before the channel hangup is complete? If so
then yes, they will always be empty. They are not populated until the call
actually ends. Are you doing a hangup hook in Lua or something else?

-MC

On Fri, Dec 9, 2011 at 10:03 PM, king2kin <xing2kin at yahoo.com> wrote:

> The channel variables for this purpose seems to be
> {duration, billsec, answersec, flow_billsec, mduration, billmsec,
> answermsec, uduration, billusec, answerusec}
> see: source code "switch_channel.c";
> and wiki document on categories: channel variables
> see:
> http://wiki.freeswitch.com/index.php?title=Category:Variable&from=Variable+billmsec
>
>
> However, when I tried to access these channel variables from Lua script or
> dialplan, their values are always "nil" or empty.
>
> -- dialplan:
> {
>    <action application="answer"/>
>     ........
>    <action application="log" data="INFO billsec: ${billsec}; billmsec:
> ${billmsec}"/>
>    <action application="sleep" data="2000"/>
>    <action application="hangup"/>
> }
>
> -- Lua script:
> 2011-12-10 13:39:55.609375 [ERR] mod_lua.cpp:191
> C:\c4dev\freeswitch\Release\scr
> ipts/test1.lua:60: attempt to concatenate global 'ctsec' (a nil value)
> stack traceback:
>         C:\c4dev\freeswitch\Release\scripts/test1.lua:60: in main chunk
>
> see:
> {
> session:answer()
> .........
> ctsec = session:getVariable('billsec')
> ctmsec = session:getVariable('billmsec')
> freeswitch.consoleLog("INFO","***** Call-Time: sec=" .. ctsec .. "\n")
> freeswitch.consoleLog("INFO","***** Call-Time: msec=" .. ctmsec .. "\n")
> session:hangup()
> }
>
>
>  *From:* curriegrad2004 <curriegrad2004 at gmail.com>
> *To:* FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
> *Sent:* Wednesday, November 30, 2011 11:15 PM
> *Subject:* Re: [Freeswitch-users] Question Answertime variable?
>
> billseconds or bill_msec would be the one to turn to.
>
> On Wed, Nov 30, 2011 at 4:22 AM, Thomas Hoellriegel <admin at blindi.net>
> wrote:
> > Hi all,
> > Is there a possibility to determine the caller time for a channel at
> > the end of a call?
> >
> > For example: in asterisk exists a variable:
> > ${ANSWEREDTIME}
> > I like to store the Answertime in a Database for example:
> > Dailly minutes to call a Cellphone.
> > Can your help plese?
> > Thanks.
> >
> >
> > ---------------
> > Du kannst mich jederzeit kostenlos per Festnetz erreichen unter:
> > http://www.blindi.net/callback
> > homepage: http://www.blindi.net
> > blinde-misc mailingliste für blinde. anmeldung unter:
> > http://www.blindi.net/mailman/listinfo/blinde-misc
> >
> > _________________________________________________________________________
> > Professional FreeSWITCH Consulting Services:
> > consulting at freeswitch.org
> > http://www.freeswitchsolutions.com
> >
> > 
> > 
> >
> > Official FreeSWITCH Sites
> > http://www.freeswitch.org
> > http://wiki.freeswitch.org
> > http://www.cluecon.com
> >
> > 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
> >
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> 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
>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20111213/c0a30ec4/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list