Mark,

You can populate the $acc_extra() from whatever other variable or string operations. Most probably your issue is in other place, in regards to the acc logic.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com

On 4/17/20 1:40 PM, Mark Farmer wrote:
Thanks Bogdan, that's mostly working now.

My issue now is with passing that identifier into acc_extra() as a variable which does not seem to be working. Using xlog() I can see that the variable is populated right before calling acc_extra()

...
if (isflagset(PBX_PSTN) || isflagset(TPTY_PSTN)) {
                xlog("CUSTOM_LOG: Customer ID = $var(custID)");
                $acc_extra(customer_id) = $var(custID);
...
do_accounting("db","cdr");
}

Does acc_extra() not accept variables as input?

Thanks again!
Mark.




On Fri, 17 Apr 2020 at 09:15, Bogdan-Andrei Iancu <[email protected] <mailto:[email protected]>> wrote:

    Hey Mark,

    It is not nice, but you can do:

    $var(tmp) = $rU;
    $rU = $fU
    do_routing();
    $rU = $var(tmp);

    Regards,

    Bogdan-Andrei Iancu

    OpenSIPS Founder and Developer
       https://www.opensips-solutions.com

    On 4/17/20 11:13 AM, Mark Farmer wrote:
    Hi Bogdan, I will try to explain better.

    In rule_attrs I have a customer identifier which is used by acc
    to add the identifier into the CDR database.
    This works fine for calls from PSTN which are routed to another
    SIP gateway but calls from that gateway routed to PSTN can come
    from multiple customers and there is no way to identify which. So
    I'd like to match the incoming $fU to the rule that would match
    $rU in the from PSTN scenario in order to retrieve the rule_attrs
    (the customer identifier) from that rule.

    Does that make sense?

    Many thanks and regards
    Mark.




    On Thu, 16 Apr 2020 at 16:55, Bogdan-Andrei Iancu
    <[email protected] <mailto:[email protected]>> wrote:

        Hi Mark,

        What kind of matching you want to do between $fU and the dr
        prefixes ? You want to do the same as what drouting() does
        with $rU ?

        Regards,

        Bogdan-Andrei Iancu

        OpenSIPS Founder and Developer
           https://www.opensips-solutions.com

        On 4/16/20 6:14 PM, Mark Farmer wrote:
        Hi everyone

        I am looking for a way to compare $fU in INVITE to the
        matching drouting() prefix of another group and retrieve the
        rule_attrs from that rule.

        At the moment I am thinking I'll have to run a custom DB
        query so I have 2 questions:

        1. Is there a better way to do this?
        2. If not, what is the best way to run custom DB queries?

        I have been reading through the drouting() documentation but
        that hasn't helped.

        OpenSIPS 2.4.7

        Many thanks!
        Mark.


        _______________________________________________
        Users mailing list
        [email protected]  <mailto:[email protected]>
        http://lists.opensips.org/cgi-bin/mailman/listinfo/users



-- Mark Farmer
    [email protected] <mailto:[email protected]>



--
Mark Farmer
[email protected] <mailto:[email protected]>

_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to