<div dir="ltr">Thanks for the quick reply Carlos. Really appreciate it.<div><br></div><div>Thanks,</div><div><br></div><div>--- Jayesh</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jul 20, 2013 at 9:13 PM, Carlos Ruiz Díaz <span dir="ltr"><<a href="mailto:carlos.ruizdiaz@gmail.com" target="_blank">carlos.ruizdiaz@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The lack of values in some of the standard pseudo variables is a limitation of the dialog module which does not provide  the necessary information in the event route block in cases when the call is forced to end.<div>

<br></div><div>You can calculate the duration using:</div><div><br></div><div><div><i> $var(duration)  = $TS - $dlg(start_ts);</i></div><div><i><br></i></div><div>Regards,</div><div>Carlos</div>
<div><br></div></div><div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Sat, Jul 20, 2013 at 2:07 AM, Jayesh Nambiar <span dir="ltr"><<a href="mailto:jayesh1017@gmail.com" target="_blank">jayesh1017@gmail.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hello,<div>Is there a straight forward way of getting the duration of the call in cnxcc-call-shutdown event. The $DLG_lifetime returns NULL as the dialog does not exist. I dont get the value of $DLG_lifetime even in dialog:end event when the call ends through cnxcc module. Even the cdr flag of acc module doesn't get the duration and it logs, invalid values !!</div>


<div>Currently, I am storing the timestamp in htable when the call is answered and then subtract it from the current timestamp in the cnxcc:shutdown event route to get the duration. Something like this:</div><div><br></div>


<div><div>onreply_route[MANAGE_REPLY] {</div><div>    xdbg("incoming reply\n");</div><div> </div><div>    if(status=="200") {</div><div>        $sht(ts=>$ci) = $Ts;</div><div>    }</div><div>}</div>


</div><div><br></div><div><div>event_route[cnxcc:call-shutdown] {</div><div>    </div><div>    $var(duration) = $TS-$sht(ts=>$ci);</div><div>    sht_rm_name_re("ts=>$ci");</div><div>    </div><div>    xlog("L_INFO", "Duration of call was $var(duration)");</div>


</div><div>}</div><div><br></div><div><br></div><div>Any more correct way of doing this would be very helpful.</div><div><br></div><div>Thanks,</div><div><br></div><div>--- Jayesh</div></div>
<br></div></div>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Carlos<div><a href="http://caruizdiaz.com" target="_blank">http://caruizdiaz.com</a></div><div>+595981146623</div>

</font></span></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>