From 943efbc33954e332318b6365bf27037c05bff72c Mon Sep 17 00:00:00 2001 From: gm209912 Date: Tue, 15 Jan 2008 08:42:39 -0800 Subject: PSARC 2008/007 SIP Statistics And Logging 6496355 SIP stack should provide Call Tracing, logging and stat counters --- usr/src/lib/libsip/common/sip_dialog_ui.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'usr/src/lib/libsip/common/sip_dialog_ui.c') 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 ? -- cgit v1.2.3