[OpenSIPS-Users] Compare $fU to drouting prefix

johan johan at democon.be
Fri Apr 17 11:12:29 EST 2020


and if doesn't accept a var then copy the var to an avp.


On 17/04/2020 12:40, 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 <bogdan at opensips.org 
> <mailto:bogdan at opensips.org>> 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
>>     <bogdan at opensips.org <mailto:bogdan at opensips.org>> 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
>>>         Users at lists.opensips.org  <mailto:Users at lists.opensips.org>
>>>         http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>>     -- 
>>     Mark Farmer
>>     farmorg at gmail.com <mailto:farmorg at gmail.com>
>
>
>
> -- 
> Mark Farmer
> farmorg at gmail.com <mailto:farmorg at gmail.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/20200417/bfde3a97/attachment-0001.html>


More information about the Users mailing list