[OpenSIPS-Users] acc extra_fields

Bogdan-Andrei Iancu bogdan at opensips.org
Wed Jun 7 07:53:06 EDT 2017

Hi Edwin,

First, can you send me a script snapshot (off list) that produces the 
CRITICAL message ? (and the "opensips -V")

Now, how you should do it is:

# put the $acc_extra(channel) content in "col_channel" DB column
modparam("acc", "extra_fields", "db: channel->col_channel")

if ( do_routing() ) {
         # populate the ACC variable with the DR output
	$acc_extra(channel) = $avp(channel);

Have you read 
http://www.opensips.org/Documentation/Tutorials-Advanced-Accounting ?

The old ACC approach (in using AVP) suffered from several problems due 
the nature of the AVPs (like multi-values, but cannot use NULL). Also, 
for many script writer was not clear when the actual value (from the 
AVP) is read by the ACC module (when the value is actually evaluated). 
So, we decided for a more rigorous and straight approach in terms of 
setting the ACC data.

Nevertheless, feedback is welcome ;)

Best regards,

Bogdan-Andrei Iancu
   OpenSIPS Founder and Developer

OpenSIPS Bootcamp 2017, Houston, US

On 06/06/2017 09:04 PM, Edwin wrote:
> Hi Bogdan,
> I use $avp's in i.a. 'avp_db_query' and 'store_dlg_value', and created extra
> fields for channel, a_number, b_number, subscriber_id. The channel is
> defined in drouting (modparam("drouting", "gw_id_avp", '$avp(channel)')).
> First I tried to swap all the $avp for $acc_extra, but 'auth_db' didn't
> appreciate this : "auth_db:parse_aaa_avps: malformed or non AVP
> $acc_extra(subscriber_id) AVP definition".
> Thereafter I tried to fill the $acc_extra with $avp values
> ($acc_extra(subscriber_id) = $avp(subscriber_id) before and after
> do_routing. This resulted in an critical error:
> "CRITICAL:core:pv_value_destroy: #012>>> pkg_free() on non-pkg ptr 0x807491
> - aborting!#012#012It seems you have hit a programming bug.#012"
> Then I wondered were to fill the $acc_extra(channel) variable, after
> do_routing?
> OK, I have to read some more documentation and do more testing, but my first
> impression is 'just keep it like it was, or at least also permit $avp's in
> the extra fields'.
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/acc-extra-fields-tp7607614p7607626.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170607/f9c6ad52/attachment-0001.html>

More information about the Users mailing list