I'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"><<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;">
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'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><div><div></div><div class="h5">
On Thu, Jun 11, 2009 at 10:08 AM, David <<a href="http://kamailio.org" target="_blank">kamailio.org</a> <<a href="http://kamailio.org" target="_blank">http://kamailio.org</a>>@<a href="http://spam.lublink.net" target="_blank">spam.lublink.net</a> <<a href="http://spam.lublink.net" target="_blank">http://spam.lublink.net</a>>> 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 'BYE' 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'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<br>
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<br>
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<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'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> <mailto:<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a>><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>