<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&amp;from=Variable+billmsec">http://wiki.freeswitch.com/index.php?title=Category:Variable&amp;from=Variable+billmsec</A>&nbsp; </SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN>&nbsp;</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>&nbsp;</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">&nbsp;&nbsp; &lt;action application="answer"/&gt;</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"><SPAN style="RIGHT: auto" class=tab>&nbsp;&nbsp;&nbsp;&nbsp;........</SPAN></SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">&nbsp;&nbsp;&nbsp;&lt;action application="log" data="INFO billsec: ${billsec}; billmsec: ${billmsec}"/&gt;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&lt;action application="sleep" data="2000"/&gt;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&lt;action application="hangup"/&gt;&nbsp;&nbsp;</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>&nbsp;</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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\c4dev\freeswitch\Release\scripts/test1.lua:60: in main chunk</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN>&nbsp;</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>&nbsp;</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 &lt;curriegrad2004@gmail.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> FreeSWITCH Users Help &lt;freeswitch-users@lists.freeswitch.org&gt; <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 &lt;<A href="mailto:admin@blindi.net"
 ymailto="mailto:admin@blindi.net">admin@blindi.net</A>&gt; wrote:<BR>&gt; Hi all,<BR>&gt; Is there a possibility to determine the caller time for a channel at<BR>&gt; the end of a call?<BR>&gt;<BR>&gt; For example: in asterisk exists a variable:<BR>&gt; ${ANSWEREDTIME}<BR>&gt; I like to store the Answertime in a Database for example:<BR>&gt; Dailly minutes to call a Cellphone.<BR>&gt; Can your help plese?<BR>&gt; Thanks.<BR>&gt;<BR>&gt;<BR>&gt; ---------------<BR>&gt; Du kannst mich jederzeit kostenlos per Festnetz erreichen unter:<BR>&gt; http://www.blindi.net/callback<BR>&gt; homepage: http://www.blindi.net<BR>&gt; blinde-misc mailingliste für blinde. anmeldung unter:<BR>&gt; http://www.blindi.net/mailman/listinfo/blinde-misc<BR>&gt;<BR>&gt; _________________________________________________________________________<BR>&gt; Professional FreeSWITCH Consulting Services:<BR>&gt; <A href="mailto:consulting@freeswitch.org"
 ymailto="mailto:consulting@freeswitch.org">consulting@freeswitch.org</A><BR>&gt; http://www.freeswitchsolutions.com<BR>&gt;<BR>&gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR>&gt; http://www.cudatel.com<BR>&gt;<BR>&gt; Official FreeSWITCH Sites<BR>&gt; http://www.freeswitch.org<BR>&gt; http://wiki.freeswitch.org<BR>&gt; http://www.cluecon.com<BR>&gt;<BR>&gt; FreeSWITCH-users mailing list<BR>&gt; <A href="mailto:FreeSWITCH-users@lists.freeswitch.org" ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</A><BR>&gt; http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<BR>&gt; UNSUBSCRIBE:<A href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target=_blank>http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR>&gt; <A href="http://www.freeswitch.org/"
 target=_blank>http://www.freeswitch.org</A><BR>&gt;<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>