Module: kamailio Branch: master Commit: fa7eb2ab595665f1ff95caf819d260b86bb8ca2b URL: https://github.com/kamailio/kamailio/commit/fa7eb2ab595665f1ff95caf819d260b8...
Author: iionita ionut-razvan.ionita@1and1.ro Committer: Henning Westerholt henningw@users.noreply.github.com Date: 2019-04-09T21:25:53+02:00
siptrace: add basic transaction and dialog level tracing
Added a new parameter to sip_trace() function which is the tracing type. This can be m(message)/t(transaction)/d(dialog).
Transaction level tracing is done by registering REQUEST_SENT, REPLY_RECIEVED and REPLY_SENT callbacks when sip_trace() is called. Transaction module has to be loaded and the function call has to be made from a request route.
Dialog level tracing is a little more complicated. INVITE transaction is traced the same level as a transaction traced with 't' flag. For the other transactions DLGCB_CREATED callback is used to know when dialog is created and callbacks for the rest of the dialog can be created. Correlation_id has to be carried all the way to this callback which is called after all the routes are called. In order to pass the correlation_id from sip_trace() to DLGCB_CREATED correlation_id has been saved into an avp. Also, since DLGCB_CREATED is called for all dialogs and some users may opt out not to trace some dialogs, FL_SIPTRACE message flag has been added to signal from sip_trace() to the callback whether this dialog should be traced or not.
Moreover FL_SIPTRACE flag is used to signal whether stateless replies shall be traced, such as the 200 OK generated after a successful registration.
The implementation is not complete, some messages such as the 180 and negative acks will be missing. Moreover internally generated BYE transacitons at timeout might be missing but these shall be fixed in future commits.
---
Modified: src/core/parser/msg_parser.h Modified: src/modules/siptrace/siptrace.c Modified: src/modules/siptrace/siptrace_data.h
---
Diff: https://github.com/kamailio/kamailio/commit/fa7eb2ab595665f1ff95caf819d260b8... Patch: https://github.com/kamailio/kamailio/commit/fa7eb2ab595665f1ff95caf819d260b8...