Session Initiation Protocol Library Functions
sipenabletranslogging(3SIP)
NAME
sipenabletranslogging, sipenabledialoglogging,
sipdisabledialoglogging, sipdisabletranslogging -
transaction and dialog logging operations
SYNOPSIS
cc [ flag... ] file... -lsip [ library... ]
#include
int sipenabletranslogging(FILE *logfile, int flags);
int sipenabledialoglogging(FILE *logfile, int flags);
void sipdisabledialoglogging();
void sipdisabletranslogging();
DESCRIPTION
The sipenabletranslogging() and
sipenabledialoglogging() functions enable transaction and
dialog logging respectively. The logfile argument points to
a file to which the SIP messages are logged. The flags argu-
ment controls the amount of logging. The only flag defined
in is SIPDETAILOGING. Either transaction or dia-
log logging, or both, can be enabled at any time. For dialog
logging to work, the SIP stack must be enabled to manage
dialogs (using SIPSTACKDIALOGS, see sipstackinit(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 sipdisabletranslogging() and
sipdisabledialoglogging() functions disable the transac-
tion or dialog logging. These functions do not close the
files. It is the responsibility of the application to close
them.
SunOS 5.11 Last change: 11 Jan 2008 1
Session Initiation Protocol Library Functions
sipenabletranslogging(3SIP)
The log contains the state of the transaction or dialog at
the time the message was processed.
RETURN VALUES
Upon successful completion, sipenabletranslogging() and
sipenabledialoglogging() return 0. They return EINVAL if
logfile is NUL or flags is unrecognized.
EXAMPLES
Example 1 Dialog logging
The following is an example of dialog logging.
FILE *logfile;
logfile = fopen("/tmp/ApplicationA", "a]");
sipenabledialoglogging(logfile, SIPDETAILOGING);
/* Application sends INVITE, recieves 180 and 200 response and dialog is
created. */
/* Application sends ACK request */
/* Application sends BYE and recieves 200 response */
/* Application disables logging */
sipdisabledialoglogging();
The log file will be of the following format.
************* Begin Dialog *************
Digest : 43854 43825 26120 9475 5415 21595 25658 18538
-----------------------------
Dialog State : SIPDLGNEW
Tue Nov 27 15:53:34 2007 Message - 1
INVITE sip:user@example.com SIP/2.0
From: "Me" < sip:me@mydomain.com > ; TAG=tag-from-01
To: "You" < sip:you@yourdomain.com >
Contact: < sip:myhome.host.com >
MAX-FORWARDS: 70
Call-ID: 1261K6A6492KF33549XM
CSeq: 111 INVITE
CONTENT-TYPE: application/sdp
Via: SIP/2.0/UDP 192.0.0.1 : 5060 ;branch=z9hG4bK-via-EVERYTHINGIDO-05
Record-Route:
Record-Route:
CONTENT-LENGTH : 0
SunOS 5.11 Last change: 11 Jan 2008 2
Session Initiation Protocol Library Functions
sipenabletranslogging(3SIP)
Tue Nov 27 15:53:34 2007 Message - 2
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.0.0.1 : 5060 ;branch=z9hG4bK-via-EVERYTHINGIDO-05
From: "Me" < sip:me@mydomain.com > ; TAG=tag-from-01
To: "You" < sip:you@yourdomain.com >;tag=1
Call-ID: 1261K6A6492KF33549XM
CSeq: 111 INVITE
Contact:
Record-Route:
Record-Route:
Content-Length: 0
-----------------------------
Dialog State : SIPDLGEARLY
/* Entire 200 OK SIP Response */
-----------------------------
Dialog State : SIPDLGCONFIRMED
/* Entire ACK Request */
/* Entire BYE Request */
/* Entire 200 OK Response */
-----------------------------
************* End Dialog *************
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level MT-Safe
SEE ALSO
sipstackinit(3SIP), attributes(5)
SunOS 5.11 Last change: 11 Jan 2008 3
Session Initiation Protocol Library Functions
sipenabletranslogging(3SIP)
SunOS 5.11 Last change: 11 Jan 2008 4
|