Hi,<br><br><div class="im">On Tue, Sep 13, 2011 at 8:46 AM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
just to be sure, you used flag 2 for missed calls, right? I can see it set in onreply_route.<br></blockquote></div><div><br><br>Yes,
I've used #!define FLT_ACCMISSED 2 and setflag(FLT_ACCMISSED) for
missed calls. I checked the flag in onreply_route and failure route and
they are properly set. <br>
<br> </div><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
That means the flags are ok now, the issue seems to be in other place.
You don't set any of the accounting flags in request route block, isn't
it? I mean, the first accounting flag (like accounting answered calls or
missed calls) is set in failure route. If so, the acc does not register
itself for a tm callback that is used for handling accounting events.<br>
</blockquote></div><div><br><br>Actually, I do set other accounting flags in following routes:<br><br>#!define FLT_ACC 1<br>#!define FLT_ACCMISSED 2<br>#!define FLT_ACCFAILED 3<br><br>#MAIN ROUTE<div class="im"><br> if (is_method("INVITE")) setflag(FLT_ACC); <br>
<br></div><div class="im">route[WITHINDLG] {<br> if (has_totag()) {<br></div> if (loose_route()) {<br> if (is_method("BYE")) {<div class="im"><br> setflag(FLT_ACC); # do accounting ...<br>
setflag(FLT_ACCFAILED); # ... even if the transaction fails<br> }<br> .....<br><br></div>route[LOCATION] {<br> # only for people who don't have multiple contacts (no serial forking, not used in reported scenario)<div class="im">
<br>
if ( is_method("INVITE") && !(isflagset(FLT_USRPREF))) setflag(FLT_ACCMISSED);<br>}<br><br></div>#called only for serial forked calls<br>failure_route[FAIL_FORK] {<br> .....<br> # if second branch set flag<br>
setflag(FLT_ACCMISSED);<br> t_flush_flags();<br> ....<br> # if 3rd branch (voicemail) reset flag<br> resetflag(FLT_ACCMISSED);<br> t_flush_flags();<br>
....<br>}<br><br><br>Now that you've mentioned it, I've
removed all other setflag() functions and kept only the ones in
FAIL_FORK failure route. There is still no logging of the second branch.
<br><br> </div><div class="im">
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Try to set acc flag for writing to syslog in route {...}, you can reset
it in failure route or onreply_route. Of course, this as an workaround
for now, I will look for a proper solution in case this is the problem.<br></blockquote>
</div><br><br>I'm not sure I can implement needed logic this way. I
don't want to account 1st branch. If I set FLT_ACCMISSED flag in route
{...} and reset it in on_reply and failure route, it will be too late,
the missed call will already be accounted. Or, I'm missing something?<br>
<br>Cheers<br><font color="#888888">Ozren<br><br></font><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 9/12/11 3:29 PM, Ozren Lapcevic wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I have attached log file. I have single onreply_route[REPLY_ONE] used for all replies. Grep "REPLY_ONE, FLAGS" to find where the flags are printed. Grep "FAIL FORK" for logs from failure route.<br>
<br>
Let me know if you need anything else.<br>
<br>
Cheers<br>
Ozren<br>
</blockquote>
<br></div><div><div></div><div class="h5">
-- <br>
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
Kamailio Advanced Training, Oct 10-13, Berlin: <a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a><br>
<a href="http://linkedin.com/in/miconda" target="_blank">http://linkedin.com/in/miconda</a> -- <a href="http://twitter.com/miconda" target="_blank">http://twitter.com/miconda</a><br>
<br>
</div></div></blockquote></div><br>