[Kamailio-Devel] extra accounting from replies

Daniel-Constantin Mierla miconda at gmail.com
Thu Nov 20 19:36:28 CET 2008


Hello,

you can upload a feature request.

This looks to me like half-hack and has to be reviewed if the contexts 
of request and reply don't get messed up. I was looking for something 
else that fixes also this requirement, but not time to check properly 
the impact to contexts, see next...

I was playing with the idea of more generic approach. While the 
accounting of values from reply can be done now in Kamailio via AVPs (or 
$var(...) in some cases) set in onreply_route plus onreply_avp_mode, and 
of course, some more script lines, in particular cases I needed to 
access reply attributes in failure_route or request attributes in 
onreply_route.

My first thought was to add to TM module two new PV classes:
- $req(PV) to be used in onreply_route to access attributes from the 
request of the transaction
- $rpl(PV) to be used in failure_route to access attributes from the reply

To solve what you pointed, one has to account $rpl(PV), because acc 
event is done on a transaction callback.

PV will be another valid PV name (e.g., $ru, $hdr(...)), but not 
$req(...) or $rpl(...).

Any other opinion about this matter?

Cheers,
Daniel

On 11/20/08 20:07, Alex Balashov wrote:
> I think this would be a good patch to throw in.
>
> -------- Original Message --------
> Subject: [OpenSIPS-Devel] [NEW Functionality] extra accounting from replies
> Date: Thu, 20 Nov 2008 20:06:37 +0200
> From: Bogdan-Andrei Iancu <bogdan at voice-system.ro>
> To: users at lists.opensips.org <users at lists.opensips.org>, 
> devel at lists.opensips.org <devel at lists.opensips.org>
>
> Hi,
>
> There is available a new enhancement of the acc module that allows you
> (via extra accounting) to log also information related to the SIP reply
> of that transaction.
> So far, all PV from extra accounting were evaluated in the context of
> the SIP request, so you were able do directly log only info from the SIP
> request; for information related to SIP reply, you had to use a
> onreply_route to get the reply, to put the info you are interested in in
> some AVPS and than use the AVPS in extra accounting.
>
> Now, you can simply do:
> modparam("acc", "log_extra",
>      "contactA=$ct;
> contactB=$ct/reply;uaA=$hdr(User-Agent);uaB=$hdr(Server)/reply;src_ipA=$si;src_ipB=$si/reply")
>
> use the "/reply" marker to say you want that PV to be evaluated in the
> context of the reply; by default (without the marker), the evaluation is
> done in the request context.
>
> Regards,
> Bogdan
>
>
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>
>   

-- 
Daniel-Constantin Mierla
http://www.asipto.com




More information about the Devel mailing list