2 .\" Copyright (c) 2008, Sun Microsystems Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH SIP_ENABLE_TRANS_LOGGING 3SIP "April 9, 2016"
8 sip_enable_trans_logging, sip_enable_dialog_logging,
9 sip_disable_dialog_logging, sip_disable_trans_logging \- transaction and dialog
14 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... -\fBlsip\fR [ \fIlibrary\fR... ]
17 \fBint\fR \fBsip_enable_trans_logging\fR(\fBFILE *\fR\fIlogfile\fR, \fBint\fR \fIflags\fR);
22 \fBint\fR \fBsip_enable_dialog_logging\fR(\fBFILE *\fR\fIlogfile\fR, \fBint\fR \fIflags\fR);
27 \fBvoid\fR \fBsip_disable_dialog_logging\fR();
32 \fBvoid\fR \fBsip_disable_trans_logging\fR();
37 The \fBsip_enable_trans_logging()\fR and \fBsip_enable_dialog_logging()\fR
38 functions enable transaction and dialog logging respectively. The \fIlogfile\fR
39 argument points to a file to which the SIP messages are logged. The flags
40 argument controls the amount of logging. The only flag defined in \fB<sip.h>\fR
41 is \fBSIP_DETAIL_LOGGING\fR. Either transaction or dialog logging, or both, can
42 be enabled at any time. For dialog logging to work, the SIP stack must be
43 enabled to manage dialogs (using \fBSIP_STACK_DIALOGS\fR, see
44 \fBsip_stack_init\fR(3SIP)) when the stack is initialized.
47 All the messages exchanged within a transaction/dialog is captured and later
48 dumped to a log file when the transaction or dialog is deleted or terminated.
49 Upon termination, each dialog writes to the file the messages that were
50 processed in its context. Similarly, upon termination each transaction writes
51 to the file the messages that were processed in its context.
54 The \fBsip_disable_trans_logging()\fR and \fBsip_disable_dialog_logging()\fR
55 functions disable the transaction or dialog logging. These functions do not
56 close the files. It is the responsibility of the application to close them.
59 The log contains the state of the transaction or dialog at the time the message
63 Upon successful completion, \fBsip_enable_trans_logging()\fR and
64 \fBsip_enable_dialog_logging()\fR return 0. They return \fBEINVAL\fR if
65 \fIlogfile\fR is \fINULL\fR or \fIflags\fR is unrecognized.
68 \fBExample 1 \fRDialog logging
71 The following is an example of dialog logging.
78 logfile = fopen("/tmp/ApplicationA", "a+");
79 sip_enable_dialog_logging(logfile, SIP_DETAIL_LOGGING);
81 /* Application sends INVITE, receives 180 and 200 response and dialog is
83 /* Application sends ACK request */
84 /* Application sends BYE and receives 200 response */
86 /* Application disables logging */
87 sip_disable_dialog_logging();
89 The log file will be of the following format.
92 ************* Begin Dialog *************
93 Digest : 43854 43825 26120 9475 5415 21595 25658 18538
95 -----------------------------
96 Dialog State : SIP_DLG_NEW
98 Tue Nov 27 15:53:34 2007| Message - 1
99 INVITE sip:user@example.com SIP/2.0
100 From: "Me" < sip:me@mydomain.com > ; TAG=tag-from-01
101 To: "You" < sip:you@yourdomain.com >
102 Contact: < sip:myhome.host.com >
104 Call-ID: 1261K6A6492KF33549XM
106 CONTENT-TYPE: application/sdp
107 Via: SIP/2.0/UDP 192.0.0.1 : 5060 ;branch=z9hG4bK-via-EVERYTHINGIDO-05
108 Record-Route: <sip:server1.com;lr>
109 Record-Route: <sip:server2.com;lr>
112 Tue Nov 27 15:53:34 2007| Message - 2
114 Via: SIP/2.0/UDP 192.0.0.1 : 5060 ;branch=z9hG4bK-via-EVERYTHINGIDO-05
115 From: "Me" < sip:me@mydomain.com > ; TAG=tag-from-01
116 To: "You" < sip:you@yourdomain.com >;tag=1
117 Call-ID: 1261K6A6492KF33549XM
119 Contact: <sip:whitestar2-0.East.Sun.COM:5060;transport=UDP>
120 Record-Route: <sip:server1.com;lr>
121 Record-Route: <sip:server2.com;lr>
124 -----------------------------
125 Dialog State : SIP_DLG_EARLY
127 /* Entire 200 OK SIP Response */
129 -----------------------------
130 Dialog State : SIP_DLG_CONFIRMED
132 /* Entire ACK Request */
134 /* Entire BYE Request */
135 /* Entire 200 OK Response */
136 -----------------------------
137 ************* End Dialog *************
143 See \fBattributes\fR(5) for descriptions of the following attributes:
151 ATTRIBUTE TYPE ATTRIBUTE VALUE
153 Interface Stability Committed
160 \fBsip_stack_init\fR(3SIP), \fBattributes\fR(5)