[OpenSIPS-Users] Trying to learn how to use siptrace
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Tue Dec 22 10:12:51 CET 2009
Hi Brian,
The siptrace module require you to set a message/transaction flag (for
forcing the siptracing for a transaction) (see
http://www.opensips.org/Resources/DocsCoreFlags16)
A SIP transaction is a request plus all its replies. A dialog is the sum
of all transactions from a SIP session.
In the route{} which is a request route, you get only requests, so you
cannot trace replies there - the simple solution is to do sip_trace +
setflag(trace) and (using t_relay()) you should get traced all traffic.
Of course, if the route{} you can select for what requests you want to
enable the tracing.
Regards,
Bogdan
opensipslist at encambio.com wrote:
> Hello Bogdan,
>
> An jeu., déc 17, 2009, Bogdan-Andrei Iancu schrieb:
>
>> sip_trace() function will siptrace the current SIP message
>>
>> + setting the trace flag (like setflag(22) ) will trace all the
>> messages related to the transaction created by the current request you
>> process
>>
>> trace_dialog() works only for call - use it for initials INVITEs and it
>> will trace the whole dialog.
>>
>>
> Then if I have one UAC (PhoneA) and the proxy (OsipsA) and want
> to trace all messages between them, it seems that the best way is:
>
> # Example 1
> route{
> sip_trace();
> [...]
> }
>
> But to to avoid REGISTER, SUBSCRIBE, and ACK messages, then it seems
> best to set the trace flag. How do you do this appropriately, and
> how to avoid calling setflag more than once per transaction? Maybe
> something like:
>
> # Example 2
> route{
> [...]
> if (loose_route()) # Not sure here ?!?
> setflag(22);
> [...]
> }
>
> It seems in the context described above it makes no difference
> if I use setflag, setbflag, or setsflag, right?
>
> Lastly, it seems that one can get a similar result as example 2
> above by doing:
>
> # Example 3
> route{
> [...]
> if (is_method("INVITE") && !has_totag())
> trace_dialog();
> [...]
> }
>
> ...just that in this case I will see the ACK messages as well.
>
> Did I get that right? I'll be tracing all messages now, because
> of needing to debug until OpenSIPS is running well. Later I'll
> probably reduce the traces to just the dialogs.
>
> By the way these diagrams helped me understand the difference
> between transactions (setflag(22)) and dialogs (trace_dialog()):
>
> http://www.iptel.org/sip_dialog
> http://www.iptel.org/sip_transaction
>
> Regards,
> Brian
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
--
Bogdan-Andrei Iancu
www.voice-system.ro
More information about the Users
mailing list