Description

The sip_enable_trans_logging() and sip_enable_dialog_logging() functions enable transaction and dialog logging respectively. The
logfile argument points to a file to which the SIP messages are
logged. The flags argument controls the amount of logging. The only flag defined
in <sip.h> is SIP_DETAIL_LOGGING. Either transaction or dialog logging, or both, can
be enabled at any time. For dialog logging to work, the SIP
stack must be enabled to manage dialogs (using SIP_STACK_DIALOGS, see sip_stack_init(3SIP)) when
the stack is initialized.

All the messages exchanged within a transaction/dialog is captured and later dumped
to a log file when the transaction or dialog is deleted or
terminated. Upon termination, each dialog writes to the file the messages that
were processed in its context. Similarly, upon termination each transaction writes to the
file the messages that were processed in its context.

The sip_disable_trans_logging() and sip_disable_dialog_logging() functions disable the transaction or dialog logging. These
functions do not close the files. It is the responsibility of the
application to close them.

The log contains the state of the transaction or dialog at the
time the message was processed.

Return Values

Upon successful completion, sip_enable_trans_logging() and sip_enable_dialog_logging() return 0. They return EINVAL if
logfile is NULL or flags is unrecognized.