<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Edwin,<br>
      <br>
      First, can you send me a script snapshot (off list) that produces
      the CRITICAL message ? (and the "opensips -V")<br>
      <br>
      Now, how you should do it is:<br>
    </tt><br>
    <pre class="programlisting"># 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);
        ......
}
</pre>
    <tt><br>
      Have you read
      <a class="moz-txt-link-freetext" href="http://www.opensips.org/Documentation/Tutorials-Advanced-Accounting">http://www.opensips.org/Documentation/Tutorials-Advanced-Accounting</a>
      ?<br>
      <br>
      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.<br>
      <br>
      Nevertheless, feedback is welcome ;)<br>
      <br>
      Best regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  <a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>

OpenSIPS Bootcamp 2017, Houston, US
  <a class="moz-txt-link-freetext" href="http://opensips.org/training/OpenSIPS_Bootcamp_2017.html">http://opensips.org/training/OpenSIPS_Bootcamp_2017.html</a>
</pre>
    <div class="moz-cite-prefix">On 06/06/2017 09:04 PM, Edwin wrote:<br>
    </div>
    <blockquote cite="mid:1496772246640-7607626.post@n2.nabble.com"
      type="cite">
      <pre wrap="">
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: <a class="moz-txt-link-freetext" href="http://opensips-open-sip-server.1449251.n2.nabble.com/acc-extra-fields-tp7607614p7607626.html">http://opensips-open-sip-server.1449251.n2.nabble.com/acc-extra-fields-tp7607614p7607626.html</a>
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>