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'll have the CDR "closed" 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 class="gmail_quote">On Thu, Jun 11, 2009 at 10:08 AM, David <span dir="ltr"><<a href="http://kamailio.org">kamailio.org</a>@<a href="http://spam.lublink.net">spam.lublink.net</a>></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;">Hi,<br>
<br>
I am using Kamailio as my ACC, Dispatcher, far end nat and 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 join between the INVITEs, CANCELs, and BYEs I am able to get what seems like accurate call detail records.<br>
<br>
The trouble is that every so often a BYE does not make it back to my server. In my simulation this morning, I simply unplugged ( electric ) the two phones that were having a pleasant conversation. Now I have asterisk that thinks the call is still running and I have Kamailio which has no ending 'BYE' message. For the most part this is not a big deal, but when I can a cellular phone in European countries, my provider thinks I am still talking. At 30 cents a minute, that's a lot.<br>
<br>
Here are some snippets from my code :<br>
<br>
loadmodule("dialog.so")<br>
loadmodule("acc.so")<br>
loadmodule("sst.so")<br>
<br>
modparam("acc", "early_media", 1)<br>
modparam("acc", "report_ack", 1)<br>
modparam("acc", "report_cancels", 1)<br>
modparam("acc", "failed_transaction_flag", 3)<br>
modparam("acc", "log_flag", 1)<br>
modparam("acc", "log_missed_flag", 2)<br>
modparam("acc", "db_flag", 1)<br>
modparam("acc", "db_missed_flag", 2)<br>
# There is also a parameter for the DB, but I can't give you my password<br>
modparam("acc", "db_url", "some://valid:url@to/db")<br>
<br>
# Note $avp(i:10) always ends up being 14400 ( less than the value on the help page )<br>
modparam("dialog", "timeout_avp", "$avp(i:10)")<br>
modparam("sst", "timeout_avp", "$avp(i:10)")<br>
modparam("sst", "sst_flag", 5)<br>
<br>
<br>
<br>
Relevant snippets from my routing :<br>
<br>
if ( has_totag()) {<br>
if ( loose_route() ) {<br>
if ( is_method("CANCEL|BYE") {<br>
setflag(1);<br>
setflag(3);<br>
<br>
}<br>
}<br>
<br>
# Routing of INVITEs<br>
setflag(2)<br>
if ( !is_method("ACK"))<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 only for RTP Stuff.<br>
<br>
On reply route checks if rtpproxy is needed, if it is it is activated. failure_route checks if rtpproxy was activated and if it was deactives it. The only other code in the failure route is 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 need resources freed up from Asterisk, RTP Proxy, and Kamailio Dialog, and I need the call to be canceled with my provider and I need for my ACC to recieve some indication as to when the call ended. Obviously it won't be exact to the second, but I kind of thought that the SIP Session Timers would notice the phone was 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>
<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><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>
</blockquote></div><br>