HP-UX C SIP Stack Programmer's Guide (Novembery 2007)

SIP Stack Log 353
Message Structure
RvSipStackCfg stackCfg;
RvSipStackInitCfg(sizeof(stackCfg), &stackCfg);
stackCfg.defaultLogFilters = RVSIP_LOG_INFO_FILTER | RVSIP_LOG_DEBUG_FILTER |
RVSIP_LOG_ERROR_FILTER | RVSIP_LOG_WARN_FILTER |
RVSIP_LOG_EXCEP_FILTER;
/*==========================================================================*/
MESSAGE
S
TRUCTURE
The default Log contains rows of messages. Each row consists of the following
fields:
<thread id><date> <time> <message type> <source identifier>
<log message>
The following is an example of a message row:
T 00000d50 07/15/03 12:18:49 INFO - CALL -
RvSipCallLegAccept - Accepting call-leg 0x01F9D7C0
The fields in a message row represent the following:
thread id—the thread that is currently running and printing to
the log.
date—the date on which the logged event took place.
time—the time at which the logged event took place.
message type—see Log Messages for a list of message types.
source identifier—see Source Identifiers for a list of the
SIP Stack source identifiers analyzed by the Log.
log message—the actual Log message item.
CONTROLLING THE
L
OG
You can control both the Log output device (file, network or console) and the
Log message structure by registering your own Log callback function to the
SIP Stack. Each time the SIP Stack wants to add a line to the Log, your callback
function will be called instead of the default Log function. You register your
callback function during the SIP Stack initialization process, as shown in The
following code.
Sample Code
The following code demonstrates how to replace the default log function with a
user callback function. The user call back function prints the Log to a file named
MyLog.txt and adds a line number before each line in the Log.