<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<small>Hello all,<br>
<br>
Head’s up for major changes in how to use the accounting module.
The<br>
flag-based triggering of accounting showed its limitations,
especially now,<br>
in relation to the async processing. Accounting became something
really<br>
complex, too complex to be controlled only by simply setting and
resetting<br>
flags - we need a way to actually perform also actions (accounting
related)<br>
during the script execution.<br>
<br>
So, we need something more controllable, more flexible and more
usable<br>
and clear.<br>
<br>
In OpenSIPS 2.2, the accounting flags have now been replaced with
two new<br>
functions: do_accounting and drop_accounting. By using these
functions,<br>
you can all accounting scenarios in all the possible ways as
before - you<br>
can arm and disarm accounting, whenever you want, the same way you
used<br>
the flags before.<br>
<br>
The do_accounting() has 3 parameters. The first parameter
represents the<br>
accounting type(db, evi, aaa, diam, log). The types have to be
separated<br>
by ‘|’. The second parameter stands for the accounting flags, what
kind<br>
of accounting you want to do, we called it flags(cdr, missed,
failed).<br>
The failed flag replaces the old failed_transaction_flag. If you
set the<br>
cdr flag, dialog module has to be loaded in order to be able to
match the<br>
Invite with the Bye. The third parameter stands for the table name
and it<br>
replaces the old table_name_avp, which now have been removed.<br>
<br>
Drop_accounting() has the same parameters as do_accounting
excluding<br>
the table name. If you call the function without any arguments
accounting<br>
is stopped. If you use only the first argument, accounting for the
given<br>
type shall be stopped. If both arguments are used and you stop
all<br>
accounting types(cdr, missed,failed) normal accounting will still
be enabled.<br>
<br>
For usage examples, see online documentation:<br>
[0]
<a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/2.2.x/acc#do_accouting">http://www.opensips.org/html/docs/modules/2.2.x/acc#do_accouting</a><br>
[1]<a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/2.2.x/acc#drop_accouting">http://www.opensips.org/html/docs/modules/2.2.x/acc#drop_accouting</a><br>
<br>
<br>
Regards,</small><br>
<pre class="moz-signature" cols="72">--
Ionut Ionita
OpenSIPS Developer</pre>
</body>
</html>