summaryrefslogtreecommitdiff
path: root/usr/src/lib/libsip/common/sip_dialog_ui.c
diff options
context:
space:
mode:
authorgm209912 <none@none>2008-01-15 08:42:39 -0800
committergm209912 <none@none>2008-01-15 08:42:39 -0800
commit943efbc33954e332318b6365bf27037c05bff72c (patch)
tree3e4d8821b5482533452918abf346a5c5624a55fb /usr/src/lib/libsip/common/sip_dialog_ui.c
parent347a77f277285a2c589b756c918c3f40eefbbb8b (diff)
downloadillumos-joyent-943efbc33954e332318b6365bf27037c05bff72c.tar.gz
PSARC 2008/007 SIP Statistics And Logging
6496355 SIP stack should provide Call Tracing, logging and stat counters
Diffstat (limited to 'usr/src/lib/libsip/common/sip_dialog_ui.c')
-rw-r--r--usr/src/lib/libsip/common/sip_dialog_ui.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/usr/src/lib/libsip/common/sip_dialog_ui.c b/usr/src/lib/libsip/common/sip_dialog_ui.c
index d15d79f56e..998ad45218 100644
--- a/usr/src/lib/libsip/common/sip_dialog_ui.c
+++ b/usr/src/lib/libsip/common/sip_dialog_ui.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -531,6 +531,28 @@ sip_get_dialog_type(sip_dialog_t dialog, int *error)
return (type);
}
+/*
+ * Return the number of messages exchanged within a dialog.
+ */
+int
+sip_get_dialog_msgcnt(sip_dialog_t dialog, int *error)
+{
+ _sip_dialog_t *_dialog;
+ int nmsgs;
+
+ if (error != NULL)
+ *error = 0;
+ if (!sip_manage_dialog || dialog == NULL) {
+ if (error != NULL)
+ *error = EINVAL;
+ return (-1);
+ }
+ _dialog = (_sip_dialog_t *)dialog;
+ (void) pthread_mutex_lock(&_dialog->sip_dlg_mutex);
+ nmsgs = _dialog->sip_dlg_msgcnt;
+ (void) pthread_mutex_unlock(&_dialog->sip_dlg_mutex);
+ return (nmsgs);
+}
/*
* Partial dialog ?