Based on this test it is not clear that the issue is with the event route 
params, as you have not verified that the acc_extra field’s new value is 
actually set. If it is not set properly then the event route param will not 
show it properly, which is an issue but a different issue. 😊

So can you try logging the value after you change it in HANDLE_INVITE?

Ben Newlin

From: Users <[email protected]> on behalf of Alexander Perkins 
<[email protected]>
Date: Thursday, June 6, 2024 at 10:18 AM
To: Bogdan-Andrei Iancu <[email protected]>
Cc: OpenSIPS users mailling list <[email protected]>
Subject: Re: [OpenSIPS-Users] E_ACC_EVENT Question
 EXTERNAL EMAIL - Please use caution with links and attachments

________________________________
Hi Bogdan.  We tried the approach that Ben brought up, but we still do not get 
any values in the event hook.  For example (much more simplified cfg script 
below),

modparam("acc","extra_fields","evi: src_ip -> source_ip; dst_ip -> 
destination_ip)

route
{
     do_accounting("evi", "cdr|missed|failed");
     $acc_extra(dst_ip) = "Bogdan is awesome!";
     xlog("L_INFO","***src_ip: $acc_extra(dst_ip)");  ## I see this value in 
the log as Bogdan is Awesome!, which is correct.
     route(HANDLE_INVITE);
}

route [HANDLE_INVITE]
{
        $acc_extra(dst_ip) = "8.8.8.8";
}

event_route [E_ACC_EVENT]
{
        #log on entry
        xlog("L_INFO","entered event_route\n");
        xlog("L_INFO","Destination IP: $param(destination_ip); ## I see this 
value in the log as Bogdan is Awesome!, which is not correct.. Expecting to see 
8.8.8.8
}

When I look at the logs, I see the value is set correctly from the route block. 
 But I don't see it correct from the event block.

What am I missing?

Thank you,
Alex



On Wed, Jun 5, 2024 at 11:33 AM Bogdan-Andrei Iancu 
<[email protected]<mailto:[email protected]>> wrote:
Hi Alexander.

When you say "they don't seem to populate correctly", you mean they are NULL 
val, or wrong value?

Regards,


Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

  https://www.opensips-solutions.com<https://www.opensips-solutions.com>

  https://www.siphub.com<https://www.siphub.com>
On 04.06.2024 23:59, Alexander Perkins wrote:
Hi All. We are working on implementing the E_ACC_EVENT so we may use that for 
accounting purposes instead of the DB.  Now, most things appear to work as they 
should.  However, when we attempt to access the extra accounting fields, they 
don't seem to populate correctly (I've highlighted the extra variables).  Here 
is the config:

modparam("acc","extra_fields","evi: src_ip -> source_ip; dst_ip -> 
destination_ip)

event_route [E_ACC_EVENT]
{
        #log on entry
        xlog("L_INFO","entered event_route\n");

        #Default Params
        $var(method) = $param(method);

        #Extra Params
        $var(src_ip) = $acc_extra(src_ip);

        $var(source_test) = $si;

        $var(dst_ip) = $acc_extra(dst_ip);

        #log vars to test
        xlog("L_INFO","heres the ER variable: $var(source_test) and 
$var(src_ip)\n");

}

What am I missing?  Can someone point me in the right direction?  Any help is 
really appreciated.

Thank you,
Alex Perkins



_______________________________________________

Users mailing list

[email protected]<mailto:[email protected]>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users>

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

Reply via email to