<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="RIGHT: auto"><SPAN style="RIGHT: auto">The channel variables for this purpose seems to be </SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">{duration, billsec, answersec, flow_billsec, mduration, billmsec, answermsec, uduration, billusec, answerusec}</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">see: source code "switch_channel.c";</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">and wiki document on categories: channel variables</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">see: <A href="http://wiki.freeswitch.com/index.php?title=Category:Variable&from=Variable+billmsec">http://wiki.freeswitch.com/index.php?title=Category:Variable&from=Variable+billmsec</A> </SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">However, when I tried to access these channel variables from Lua script or dialplan, their values are always "nil" or empty. </SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">-- dialplan:</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">{</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"> <action application="answer"/></SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"><SPAN style="RIGHT: auto" class=tab> ........</SPAN></SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"> <action application="log" data="INFO billsec: ${billsec}; billmsec: ${billmsec}"/> <BR> <action application="sleep" data="2000"/> <BR> <action application="hangup"/> </SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">}</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"><VAR id=yui-ie-cursor></VAR></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">-- Lua script:</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">2011-12-10 13:39:55.609375 [ERR] mod_lua.cpp:191 C:\c4dev\freeswitch\Release\scr<BR>ipts/test1.lua:60: attempt to concatenate global 'ctsec' (a nil value)<BR>stack traceback:<BR> C:\c4dev\freeswitch\Release\scripts/test1.lua:60: in main chunk</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">see:</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">{</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">session:answer()</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">.........</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">ctsec = session:getVariable('billsec')<BR>ctmsec = session:getVariable('billmsec')<BR>freeswitch.consoleLog("INFO","***** Call-Time: sec=" .. ctsec .. "\n")<BR>freeswitch.consoleLog("INFO","***** Call-Time: msec=" .. ctmsec .. "\n")</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">session:hangup()</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">}</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><BR style="RIGHT: auto"></div>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT size=2 face=Arial>
<DIV style="BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; PADDING-BOTTOM: 0px; LINE-HEIGHT: 0; MARGIN: 5px 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; FONT-SIZE: 0px; BORDER-TOP: #ccc 1px solid; BORDER-RIGHT: #ccc 1px solid; PADDING-TOP: 0px" class=hr readonly="true" contenteditable="false"></DIV><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> curriegrad2004 <curriegrad2004@gmail.com><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> <BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Wednesday, November 30, 2011 11:15 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [Freeswitch-users] Question Answertime variable?<BR></FONT><BR>billseconds or bill_msec would be the one to turn to.<BR><BR>On Wed, Nov 30, 2011 at 4:22 AM, Thomas Hoellriegel <<A href="mailto:admin@blindi.net"
ymailto="mailto:admin@blindi.net">admin@blindi.net</A>> wrote:<BR>> Hi all,<BR>> Is there a possibility to determine the caller time for a channel at<BR>> the end of a call?<BR>><BR>> For example: in asterisk exists a variable:<BR>> ${ANSWEREDTIME}<BR>> I like to store the Answertime in a Database for example:<BR>> Dailly minutes to call a Cellphone.<BR>> Can your help plese?<BR>> Thanks.<BR>><BR>><BR>> ---------------<BR>> Du kannst mich jederzeit kostenlos per Festnetz erreichen unter:<BR>> http://www.blindi.net/callback<BR>> homepage: http://www.blindi.net<BR>> blinde-misc mailingliste für blinde. anmeldung unter:<BR>> http://www.blindi.net/mailman/listinfo/blinde-misc<BR>><BR>> _________________________________________________________________________<BR>> Professional FreeSWITCH Consulting Services:<BR>> <A href="mailto:consulting@freeswitch.org"
ymailto="mailto:consulting@freeswitch.org">consulting@freeswitch.org</A><BR>> http://www.freeswitchsolutions.com<BR>><BR>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR>> http://www.cudatel.com<BR>><BR>> Official FreeSWITCH Sites<BR>> http://www.freeswitch.org<BR>> http://wiki.freeswitch.org<BR>> http://www.cluecon.com<BR>><BR>> FreeSWITCH-users mailing list<BR>> <A href="mailto:FreeSWITCH-users@lists.freeswitch.org" ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</A><BR>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<BR>> UNSUBSCRIBE:<A href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target=_blank>http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR>> <A href="http://www.freeswitch.org/"
target=_blank>http://www.freeswitch.org</A><BR>><BR><BR>_________________________________________________________________________<BR>Professional FreeSWITCH Consulting Services:<BR><A href="mailto:consulting@freeswitch.org" ymailto="mailto:consulting@freeswitch.org">consulting@freeswitch.org</A><BR><A href="http://www.freeswitchsolutions.com/" target=_blank>http://www.freeswitchsolutions.com</A><BR><BR>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR><A href="http://www.cudatel.com/" target=_blank>http://www.cudatel.com</A><BR><BR>Official FreeSWITCH Sites<BR><A href="http://www.freeswitch.org/" target=_blank>http://www.freeswitch.org</A><BR><A href="http://wiki.freeswitch.org/" target=_blank>http://wiki.freeswitch.org</A><BR><A href="http://www.cluecon.com/" target=_blank>http://www.cluecon.com</A><BR><BR>FreeSWITCH-users mailing list<BR><A href="mailto:FreeSWITCH-users@lists.freeswitch.org"
ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</A><BR><A href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target=_blank>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>UNSUBSCRIBE:<A href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target=_blank>http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR><A href="http://www.freeswitch.org/" target=_blank>http://www.freeswitch.org</A><BR><BR><BR></DIV></DIV></div></body></html>