<div dir="ltr">Hi Sam,<div><br></div><div>you should be more verbose what you currently doing. There a many ways to call an lua script in FS (in the dialplan, as startup-script, as dialplan-binding etc).<br><br>Sounds like you want to fetch some kind of billing informations.<br>
<div class="gmail_extra"><br><div class="gmail_quote">2013/8/17 Sami Montour <span dir="ltr">&lt;<a href="mailto:smontour@verizon.net" target="_blank">smontour@verizon.net</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal">I am using Mod lua for call processing on the FreeSwitch. I would like to wait for some events such as CHANNEL_ANSWER and CHANNEL_HANGUP  in order to get the answer time and hangup time. Basically, something like<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Wait for event CHANNEL_ANSWER or CHANNEL_HANGUP<u></u><u></u></p><p class="MsoNormal">If (event_name = “CHANNEL_ANSWER”) then answer_timestamp = getHeader(“Caller-Channel-Answered-Time”) <u></u><u></u></p>
<p class="MsoNormal">If (event_name = “CHANNEL_HANGUP”) then hangup_timestamp = getHeader(“Event-Date-Timestamp”)<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">The session:getState() described in module lua gets the call state but not the channel state. For instance, ‘CS_EXECUTE’ is the channel state when it is executing a dialplan not when the call is answered. <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Is there a way to wait for channel events such as CHANNEL_ANSWER and CHANNEL_HANGUP in order to retrieve answer and hangup timestamps for a call?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Any input is very much appreciated.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thanks.<u></u><u></u></p><p class="MsoNormal">
<u></u> <u></u></p><p class="MsoNormal">Sam<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p></div></div><br></blockquote></div><br clear="all"><div><br></div>-- <br>Mit freundlichen Grüßen<br>*Karsten Horsmann*<br>

</div></div></div>