[OpenSIPS-Devel] Contribution: New function in siptrace module

Dan Pascu dan at ag-projects.com
Mon Oct 27 20:50:57 CET 2008


On Monday 27 October 2008, Sergio Gutierrez wrote:
> Hello Dan.
>
> Thanks a lot for your feedback.
>
> If I understand well the code, the approach using the avp is not
> exclusive with the global tracing, so the whole messages get stored
> into the table, at least that a different table be defined, as stated
> in documentation;

I think there is a misunderstanding. While the AVP can be set even when 
global tracing is on, it makes little sense to do so, since all messages 
are logged anyway in that case.

However if you only want to trace certain users, you can turn global 
tracing off and set the AVP. In this case only messages for that user 
will be traced.

Maybe is not obvious from the docs, but the trace_on modparam only 
controls global tracing. You can set that to 0 and user tracing will 
still work if the AVP is set.

The condition is like:

if (trace_on || is_set_avp(traced_user_avp) { do_trace(); }

>
> Although my approach does use the same table, it is thought to work in
> an exclusive way, avoiding to trace the whole messages processed, and
> storing only the messages of the users defined as traced.
>
> Again thanks in advance for your attention, and I will be awaiting any
> other suggestion you have.
>
> Best regards.
>
> Sergio Gutierrez.
>
> On Mon, Oct 27, 2008 at 1:51 PM, Dan Pascu <dan at ag-projects.com> wrote:
> > The siptrace module already has the ability to record messages for a
> > given user, by setting an AVP. That avp can be read from a property
> > in the subscriber table (automatically loaded when the subscriber is
> > loaded or by putting a subscriber in a group or by loading it
> > explicitly from a different table). The real problem is not the
> > inability to do this already, is the fact that is difficult to do it
> > for all messages within dialog. By making the siptrace module work on
> > top of the dialog module to automatically trigger tracing all
> > messages within a dialog once the dialog was marked for tracing, this
> > issue should be solved.
> >
> > So what does you approach add in addition to the existing behavior
> > that cannot be done already?
> >
> > On Monday 27 October 2008, Sergio Gutierrez wrote:
> > > Hello to all members in the list.
> > >
> > > I would like to put on your consideration a contribution for the
> > > siptrace module;
> > >
> > > My contribution consists in adding two new functions to module;
> > > this contribution in particular is a new function called
> > > sip_trace_user();
> > >
> > > This function would enable the trace of the sip requests originated
> > > from a particular user, in the same as sip_trace() does it in a
> > > global way.  The param trace_user has to be defined as 1 to enable
> > > the feature. The list of traced users would be stored on a table in
> > > database, and this list could be reloaded or cleared at execution
> > > time, by MI commands. sip_trace_user() uses the existing logic
> > > within the module, and it was only necessary implement helper
> > > functions for FROM USER URI manipulation, and the ones required to
> > > handle the list (load , clear and reload).
> > >
> > > In the way that the function is currently implemented, it is
> > > limited to 512 traced users simultaneously; the modification of
> > > this limit would have to be performed at compilation time.
> > >
> > > The feature request has been registered on the tracker with the
> > > number 2200068. Currently, the function is in BETA state, but it is
> > > completely functional, and I have tested it on OpenSIPS trunk
> > > version. It is pending to implement the MI commands to
> > > enable/disable the tracing, and a command to clear the traced users
> > > list.
> > >
> > > I would thank any comments, corrections or suggestions you have
> > > regarding to this contribution. As it is my first one, I think
> > > there must be a lot of things to improve.
> > >
> > > Thanks in advance all for your attention.
> > >
> > > Best regards.
> > >
> > > Sergio Gutierrez
> >
> > --
> > Dan



-- 
Dan



More information about the Devel mailing list