<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><tt>Hi Gordon,<br>
        <br>
        Note that </tt><tt>$var(rule_attrs_pvar) is populated only
        after do_routing() is done successful and only if passed as
        parameter on the right position (see the function prototype). Do
        you have something like that in your script ?<br>
        <br>
        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></pre>
      On 08.06.2014 22:23, Gordon Sims wrote:<br>
    </div>
    <blockquote cite="mid:CFBA1E70.170CE%25GSims@Nexepe.com" type="cite">
      <div>Hello Bogdan-Andrei,</div>
      <div><br>
      </div>
      <div>I&#8217;ve looked over the link and tried to piece it into the
        config. &nbsp;Unfortunately I could not get it to log to the
        database.</div>
      <div><br>
      </div>
      <div>Here is the opensips.cfg file:</div>
      <div><br>
      </div>
      <div>
        <div>#### ACCounting module</div>
        <div>loadmodule "acc.so"</div>
        <div>/* what special events should be accounted ? */</div>
        <div>modparam("acc", "early_media", 0)</div>
        <div>modparam("acc", "report_cancels", 0)</div>
        <div>/* by default we do not adjust the direct of the sequential
          requests.</div>
        <div>&nbsp; &nbsp;if you enable this parameter, be sure the enable
          "append_fromtag"</div>
        <div>&nbsp; &nbsp;in "rr" module */</div>
        <div>modparam("acc", "detect_direction", 0)</div>
        <div>modparam("acc", "cdr_flag", "ACC_CDR")</div>
        <div>#modparam("acc", "failed_transaction_flag", "ACC_FAILED")</div>
        <div>/* account triggers (flags) */</div>
        <div>modparam("acc", "db_flag", "ACC_DO")</div>
        <div>modparam("acc", "db_url",</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; <a class="moz-txt-link-rfc2396E" href="mailto:mysql://randomuser:p4ssw0rd@10.0.9.23/sip_gate">"mysql://randomuser:p4ssw0rd@10.0.9.23/sip_gate"</a>) #
          CUSTOMIZE ME</div>
        <div>modparam("acc", "db_extra", "from_uri=$fU; to_uri=$tU;
          attrs=$var(rule_attrs_pvar)") &nbsp;#Extra data</div>
      </div>
      <div>&#8230;</div>
      <div><br>
      </div>
      <div>
        <div>route{</div>
        <div><br>
        </div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; if (method == "INVITE") {</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; create_dialog();</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setflag(ACC_CDR);</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setflag(ACC_DO); # do accounting ...</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; record_route();</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xlog("INBOUND
          CALL,$dd,$ru,$ci,$fn,$fu,$var(rule_attrs_pvar)");</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; route(10);</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
      </div>
      <div><br>
      </div>
      <div>I also tried to put it into the xlog to see if I could find
        it in there and no such luck. &nbsp;I know I&#8217;m obviously doing
        something wrong, but not sure what. &nbsp;At this point I&#8217;m gong
        cross eyed looking at the code.</div>
      <div><br>
      </div>
      <div>If you have any additional advice, would be much appreciated.</div>
      <div><br>
      </div>
      <div>Thanks,</div>
      <div><br>
      </div>
      <div>Gordon</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div><br>
      </div>
      <span id="OLK_SRC_BODY_SECTION">
        <div style="font-family:Calibri; font-size:11pt;
          text-align:left; color:black; BORDER-BOTTOM: medium none;
          BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT:
          0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid;
          BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span
            style="font-weight:bold">From: </span> Bogdan-Andrei Iancu
          &lt;<a moz-do-not-send="true"
            href="mailto:bogdan@opensips.org">bogdan@opensips.org</a>&gt;<br>
          <span style="font-weight:bold">Reply-To: </span> OpenSIPS
          users mailling list &lt;<a moz-do-not-send="true"
            href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&gt;<br>
          <span style="font-weight:bold">Date: </span> Sun, 8 Jun 2014
          17:45:35 +0300<br>
          <span style="font-weight:bold">To: </span> OpenSIPS users
          mailling list &lt;<a moz-do-not-send="true"
            href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&gt;,
          Gordon Sims &lt;<a moz-do-not-send="true"
            href="mailto:gsims94@gmail.com">gsims94@gmail.com</a>&gt;<br>
          <span style="font-weight:bold">Subject: </span> Re:
          [OpenSIPS-Users] Adding extra information into the acc table
          based on dr_rules<br>
        </div>
        <div><br>
        </div>
        <div>
          <meta http-equiv="Content-Type" content="text/html;
            charset=ISO-8859-1">
          <div bgcolor="#FFFFFF" text="#000000">
            <div class="moz-cite-prefix"><tt>Hi Gordon,<br>
                <br>
                Instead of adding a new column to the dr_rules, I
                suggest to use the "attrs" column of that table. It is
                not used by the actual routing engine, its only purpose
                is to allow the user to attach custom data to the rules.
                So add your ID into the attrs columns - when the rule is
                match, the attrs value will be available into script
                into a variable (see <a moz-do-not-send="true"
                  class="moz-txt-link-freetext"
href="http://www.opensips.org/html/docs/modules/1.11.x/drouting.html#id294716">http://www.opensips.org/html/docs/modules/1.11.x/drouting.html#id294716</a>,
                rule_attrs_pvar parameter).<br>
                <br>
                Once you loaded into a variable, via db_extra you can
                push it to the acc table.<br>
                <br>
                Regards,<br>
              </tt>
              <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
              On 08.06.2014 15:35, Gordon Sims wrote:<br>
            </div>
            <blockquote cite="mid:CFB9C2CD.1708C%25gsims94@gmail.com"
              type="cite">
              <div><font face="Calibri,sans-serif">First off, I would
                  like to thank&nbsp;</font>Razvan for my&nbsp;cdr accounting
                issue and using db_extra. &nbsp;Was exactly what I was
                looking for.</div>
              <div><br>
              </div>
              <div>Now I&#8217;m getting stumped on adding in extra
                information into the acc table. &nbsp;I&#8217;ve added in another
                field to both my dr_rules and acc tables called
                account_id (int 6). &nbsp;What I would like to do is when the
                call comes in, based on the destination, is to take the
                account_id information from the &nbsp;dr_rules table and
                insert that same value into the acc table. &nbsp;I&#8217;ve looked
                at avpops module, but not finding anything definitive
                that would do what I&#8217;ve looking for. &nbsp;I hope I&#8217;m not the
                only one that is trying to do this. &nbsp;I&#8217;m looking for a
                working example on how to accomplish this one.</div>
              <div><br>
              </div>
              <div>Thanks in advance,</div>
              <div><br>
              </div>
              <div>Gordon&nbsp;</div>
              <br>
              <fieldset class="mimeAttachmentHeader"></fieldset>
              <br>
              <pre wrap="">_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><a moz-do-not-send="true" 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>
          </div>
        </div>
        _______________________________________________
        Users mailing list
        <a moz-do-not-send="true" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
        <a moz-do-not-send="true"
          href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
      </span>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
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>