I&#39;m hot sure I understood your last question. The trick is to let some RTP-aware device on the flow hangup the call. In the general section of your sip.conf (asterisk) you can config rtptimeout and rtpholdtimeout parameters to 30 seconds; if no RTP is coming for that period of time, the call will be dropped.<br>
<br><div class="gmail_quote">On Thu, Jun 11, 2009 at 1:05 PM, David <span dir="ltr">&lt;<a href="http://kamailio.org">kamailio.org</a>@<a href="http://spam.lublink.net">spam.lublink.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hey,<br>
<br>
Thanks for the answer. If I did not have Kamailio, how would I do this?<br>
<br>
David<br>
<br>
Uriel Rozenbaum wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
Hi David,<br>
<br>
Maybe you can set rtptimeout on Asterisk peer, so when no RTP is flowing, Asterisk will hang up the call and you&#39;ll have the CDR &quot;closed&quot; in Kamailio.<br>
<br>
Be sure your Kamailio is redundant, you can use heartbeat or something like that.<br>
<br>
Rgds,<br>
Uriel<br>
<br></div><div><div></div><div class="h5">
On Thu, Jun 11, 2009 at 10:08 AM, David &lt;<a href="http://kamailio.org" target="_blank">kamailio.org</a> &lt;<a href="http://kamailio.org" target="_blank">http://kamailio.org</a>&gt;@<a href="http://spam.lublink.net" target="_blank">spam.lublink.net</a> &lt;<a href="http://spam.lublink.net" target="_blank">http://spam.lublink.net</a>&gt;&gt; wrote:<br>

<br>
    Hi,<br>
<br>
    I am using Kamailio as my ACC, Dispatcher, far end nat and<br>
    presence server in front of a farm of asterisk boxes.<br>
<br>
    Most calls are being properly added into my acc table and using a<br>
    join between the INVITEs, CANCELs, and BYEs I am able to get what<br>
    seems like accurate call detail records.<br>
<br>
    The trouble is that every so often a BYE does not make it back to<br>
    my server. In my simulation this morning, I simply unplugged (<br>
    electric ) the two phones that were having a pleasant<br>
    conversation.  Now I have asterisk that thinks the call is still<br>
    running and I have Kamailio which has no ending &#39;BYE&#39; message. For<br>
    the most part this is not a big deal, but when I can a cellular<br>
    phone in European countries, my provider thinks I am still<br>
    talking. At 30 cents a minute, that&#39;s a lot.<br>
<br>
    Here are some snippets from my code :<br>
<br>
    loadmodule(&quot;dialog.so&quot;)<br>
    loadmodule(&quot;acc.so&quot;)<br>
    loadmodule(&quot;sst.so&quot;)<br>
<br>
    modparam(&quot;acc&quot;, &quot;early_media&quot;, 1)<br>
    modparam(&quot;acc&quot;, &quot;report_ack&quot;, 1)<br>
    modparam(&quot;acc&quot;, &quot;report_cancels&quot;, 1)<br>
    modparam(&quot;acc&quot;, &quot;failed_transaction_flag&quot;, 3)<br>
    modparam(&quot;acc&quot;, &quot;log_flag&quot;, 1)<br>
    modparam(&quot;acc&quot;, &quot;log_missed_flag&quot;, 2)<br>
    modparam(&quot;acc&quot;, &quot;db_flag&quot;, 1)<br>
    modparam(&quot;acc&quot;, &quot;db_missed_flag&quot;, 2)<br>
    # There is also a parameter for the DB, but I can&#39;t give you my<br>
    password<br>
    modparam(&quot;acc&quot;, &quot;db_url&quot;, &quot;some://valid:url@to/db&quot;)<br>
<br>
    # Note $avp(i:10) always ends up being 14400 ( less than the value<br>
    on the help page )<br>
    modparam(&quot;dialog&quot;, &quot;timeout_avp&quot;, &quot;$avp(i:10)&quot;)<br>
    modparam(&quot;sst&quot;, &quot;timeout_avp&quot;, &quot;$avp(i:10)&quot;)<br>
    modparam(&quot;sst&quot;, &quot;sst_flag&quot;, 5)<br>
<br>
<br>
<br>
    Relevant snippets from my routing :<br>
<br>
    if ( has_totag()) {<br>
    if ( loose_route() ) {<br>
     if ( is_method(&quot;CANCEL|BYE&quot;) {<br>
      setflag(1);<br>
      setflag(3);<br>
<br>
    }<br>
    }<br>
<br>
    # Routing of INVITEs<br>
    setflag(2)<br>
    if ( !is_method(&quot;ACK&quot;))<br>
    {<br>
     setflag(1);<br>
    }<br>
<br>
<br>
<br>
    setflag(4);<br>
<br>
    setflag(5);<br>
<br>
<br>
    For invites, I have a onreply_route and failure_route which I use<br>
     only for RTP Stuff.<br>
<br>
    On reply route checks if rtpproxy is needed, if it is it is<br>
    activated. failure_route checks if rtpproxy was activated and if<br>
    it was deactives it. The only other code in the failure route is<br>
    this :<br>
<br>
    if ( t_was_cancelled() ){<br>
    exit ;<br>
    }<br>
<br>
    So, the problem is, when phones do not send BYE, what do I do? I<br>
    need resources freed up from Asterisk, RTP Proxy, and Kamailio<br>
    Dialog, and I need the call to be canceled with my provider and I<br>
    need for my ACC to recieve some indication as to when the call<br>
    ended. Obviously it won&#39;t be exact to the second, but I kind of<br>
    thought that the SIP Session Timers would notice the phone was<br>
    gone and would generate a BYE or something?<br>
<br>
    What do I do?<br>
<br>
    Thanks,<br>
<br>
    David<br>
<br>
<br>
<br>
<br>
    _______________________________________________<br>
    Kamailio (OpenSER) - Users mailing list<br></div></div>
    <a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a> &lt;mailto:<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a>&gt;<div class="im"><br>
    <a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
    <a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
</div></blockquote>
<br>
</blockquote></div><br>