[SR-Users] Event when acc is written?

Daniel-Constantin Mierla miconda at gmail.com
Wed Jan 25 13:46:40 CET 2017



On 25/01/2017 09:47, Sebastian Damm wrote:
> Hi,
>
> On Wed, Jan 25, 2017 at 9:26 AM, Daniel-Constantin Mierla
> <miconda at gmail.com <mailto:miconda at gmail.com>> wrote:
>
>     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 ...
>
>
> 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. 
>
That's why the recommended way above for negative responses was to use
failure_route, not onreply_route like for 200ok.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20170125/9a8704b7/attachment.html>


More information about the sr-users mailing list