<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 25/01/2017 09:47, Sebastian Damm
wrote:<br>
</div>
<blockquote
cite="mid:CABkWSFxA4qtFUWf_tDRwdscQGX156fK5s4-LKcAfdZNKxJwYCg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">Hi,</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Jan 25, 2017 at 9:26 AM,
Daniel-Constantin Mierla <span dir="ltr"><<a
moz-do-not-send="true" 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">To some
extent you may be able to do it in configuration file by
replacing the acc default behaviour with sqlops. The
records are written by mysql when 200ok is received (which
can be caught via an onreply_route) or a final negative
response is handled (which can be caught via a
failure_route). There you can use acc_db_request() to
write the record to database and then sqlops to retrieve
the ID. Just an idea by now, but it seems to be doable ...</blockquote>
</div>
<br>
Be careful with own-built accounting. We did this on a system
once, and you really have to make sure you account the correct
reply. For instance if the call is forked by kamailio, you
might get a 486 from one device and later a 200 OK from the
other one. If you only take the first reply, you might end up
with wrong call state. <br>
<br>
</div>
</div>
</blockquote>
That's why the recommended way above for negative responses was to
use failure_route, not onreply_route like for 200ok.<br>
<br>
Cheers,<br>
Daniel<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - May 8-10, 2017 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
</body>
</html>