<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Hi Sebastian,</p>
<p><br>
</p>
<p>Thanks, that's what I would like to avoid =)</p>
<p><br>
</p>
<p>/Tobias</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> sr-users <sr-users-bounces@lists.sip-router.org> on behalf of Sebastian Damm <damm@sipgate.de><br>
<b>Sent:</b> Wednesday, January 25, 2017 9:47 AM<br>
<b>To:</b> Daniel-Constantin Mierla; Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] Event when acc is written?</font>
<div> </div>
</div>
<div>
<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 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 clear="all">
<div>Regards,</div>
<div>Sebastian</div>
<div class="gmail_signature"></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>