Wireshark-dev: [Wireshark-dev] listen_rtp plugin
From: Alejandro Vaquero <alejandrovaquero@xxxxxxxxx>
Date: Mon, 26 Jun 2006 20:38:28 -0700
Hi All,
Here is the "listen_rtp" plugin that allows to listen audio RTP conversations.

The plugin is integrated to the "Voip Calls" feature. There is a new "listen" button in the "Voip Calls" that once the calls are selected and the "listen" is clicked, a new window will open. In this window you can change the simulated jitter buffer to be used for decoding the RTP packets. In this first implementation, only a static jitter buffer can be simulated. Then pressing "decode" will decode all the RTP and generate the graphical view of the audio channels. From there you can select up to two channels at the same time (to be played in the left and right channels) and then play, pause, stop,etc.....ok, the attached screenshot it is self explanatory (hopefully).
   The only codecs available from now are G711u and G711a law.

The PortAudio (www.portaudio.com) library is used to play audio. This is an open source cross-platform Audio library. I have tested this on Windows XP and in a linux FC4.

I modified the Makefile.nmake and Makfile.am files, acinclude.m4, config.nmake and configure.in to be compiled in Windows VC6 and Linux (thanks Luis for the lua staff as I was totally lost here). Not sure what else it is needed for other platforms. For windows, the user can comment the PORTAUDIO_DIR parameter in the config.nmake file to avoid the plugin to be compiled. For linux, by default the plugin is not compiled unless the user uses the "--with-portaudio" argument when running "configure". To be compiled in linux, the "portaudio" package needs to be installed.

   The attached files contain:
listen_rtp.patch: this is a patch that has the changes for the "Voip Calls" files, and all the Makefiles and auto staff.
listen_rtp.zip: the plugin files to be added to the plugin directory
portaudio_v18_1.zip: this file is the PortAudio Window library that need to be downloaded when using "nmake -f Makefile setup".
listen_rtp_screenshot.png: A screen shot of the plugin.

TODO:
  - Tests in other platforms.
- Make the changes in the Windows installer, to have the option to install it or not (same as the Lua plugin). I don't know where to start looking for this.

   Any comment or enhancement are very welcome.

Regards
Alejandro



PNG image

Index: acinclude.m4
===================================================================
--- acinclude.m4	(revision 18459)
+++ acinclude.m4	(working copy)
@@ -933,6 +933,132 @@
 ])
 
 #
+# AC_WIRESHARK_LIBPORTAUDIO_CHECK
+#
+AC_DEFUN([AC_WIRESHARK_LIBPORTAUDIO_CHECK],[
+
+	if test "x$portaudio_dir" != "x"
+	then
+		#
+		# The user specified a directory in which libportaudio
+		# resides, so add the "include" subdirectory of that directory to
+		# the include file search path and the "lib" subdirectory
+		# of that directory to the library search path.
+		#
+		# XXX - if there's also a libportaudio in a directory that's
+		# already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
+		# make us find the version in the specified directory,
+		# as the compiler and/or linker will search that other
+		# directory before it searches the specified directory.
+		#
+		wireshark_save_CFLAGS="$CFLAGS"
+		CFLAGS="$CFLAGS -I$portaudio_dir/include"
+		wireshark_save_CPPFLAGS="$CPPFLAGS"
+		CPPFLAGS="$CPPFLAGS -I$portaudio_dir/include"
+		wireshark_save_LIBS="$LIBS"
+		LIBS="$LIBS -L$portaudio_dir/lib -lportaudio"
+		wireshark_save_LDFLAGS="$LDFLAGS"
+		LDFLAGS="$LDFLAGS -L$portaudio_dir/lib"
+	else 
+		#
+		# The user specified no directory in which libportaudio resides,
+		# so just add "-lportaudio" to the used libs.
+		#
+		wireshark_save_CFLAGS="$CFLAGS"
+		wireshark_save_CPPFLAGS="$CPPFLAGS"
+		wireshark_save_LDFLAGS="$LDFLAGS"
+		wireshark_save_LIBS="$LIBS"
+		LIBS="$LIBS -lportaudio"
+	fi
+
+	#
+	# Make sure we have "portaudio.h".  If we don't, it means we probably
+	# don't have libportaudio, so don't use it.
+	#
+	AC_CHECK_HEADERS(portaudio.h,,
+	[
+		if test "x$portaudio_dir" != "x"
+		then
+			#
+			# The user used "--with-portaudio=" to specify a directory
+			# containing libportaudio, but we didn't find the header file
+			# there; that either means they didn't specify the
+			# right directory or are confused about whether libportaudio
+			# is, in fact, installed.  Report the error and give up.
+			#
+			AC_MSG_ERROR([libportaudio header not found in directory specified in --with-portaudio])
+		else
+			if test "x$want_portaudio" = "xyes"
+			then
+				#
+				# The user tried to force us to use the library, but we
+				# couldn't find the header file; report an error.
+				#
+				AC_MSG_ERROR(Header file portaudio.h not found.)
+			else
+				#
+				# We couldn't find the header file; don't use the
+				# library, as it's probably not present.
+				#
+				want_portaudio=no
+			fi
+		fi
+	])
+
+	if test "x$want_portaudio" != "xno"
+	then
+		#
+		# Well, we at least have the portaudio header file.
+		#
+		# let's check if the libs are there
+		#
+
+		AC_CHECK_LIB(portaudio, Pa_Initialize,
+		[
+			if test "x$portaudio_dir" != "x"
+			then
+				#
+				# Put the "-I" and "-L" flags for portaudio at
+				# the beginning of CFLAGS, CPPFLAGS,
+				# LDFLAGS, and LIBS.
+				#
+				PORTAUDIO_LIBS="-L$portaudio_dir/lib -lportaudio"
+				PORTAUDIO_INCLUDES="-I$portaudio_dir/include"
+			else
+				PORTAUDIO_LIBS="-lportaudio"
+				PORTAUDIO_INCLUDES=""
+			fi
+		],[  
+			#
+			# Restore the versions of CFLAGS, CPPFLAGS,
+			# LDFLAGS, and LIBS before we added the
+			# "--with-portaudio=" directory, as we didn't
+			# actually find portaudio there.
+			#
+			CFLAGS="$wireshark_save_CFLAGS"
+			CPPFLAGS="$wireshark_save_CPPFLAGS"
+			LDFLAGS="$wireshark_save_LDFLAGS"
+			LIBS="$wireshark_save_LIBS"
+			PORTAUDIO_LIBS=""
+			# User requested --with-portaudio but it isn't available
+			if test "x$want_portaudio" = "xyes"
+			then
+				AC_MSG_ERROR(Linking with libportaudio failed.)
+			fi
+			want_portaudio=no
+		])
+
+	CFLAGS="$wireshark_save_CFLAGS"
+	CPPFLAGS="$wireshark_save_CPPFLAGS"
+	LDFLAGS="$wireshark_save_LDFLAGS"
+	LIBS="$wireshark_save_LIBS"
+	AC_SUBST(PORTAUDIO_LIBS)
+	AC_SUBST(PORTAUDIO_INCLUDES)
+
+	fi
+])
+
+#
 # AC_WIRESHARK_NETSNMP_CHECK
 #
 AC_DEFUN([AC_WIRESHARK_NETSNMP_CHECK],
@@ -1466,159 +1592,3 @@
 	AC_SUBST(KRB5_LIBS)
 ])
 
-dnl Autoconf macros for libgnutls
-
-# Modified for LIBGNUTLS -- nmav
-# Configure paths for LIBGCRYPT
-# Shamelessly stolen from the one of XDELTA by Owen Taylor
-# Werner Koch   99-12-09
-
-dnl AM_PATH_LIBGNUTLS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
-dnl Test for libgnutls, and define LIBGNUTLS_CFLAGS and LIBGNUTLS_LIBS
-dnl
-AC_DEFUN([AM_PATH_LIBGNUTLS],
-[dnl
-dnl Get the cflags and libraries from the libgnutls-config script
-dnl
-AC_ARG_WITH(libgnutls-prefix,
-          [  --with-libgnutls-prefix=PFX   Prefix where libgnutls is installed (optional)],
-          libgnutls_config_prefix="$withval", libgnutls_config_prefix="")
-
-  if test x$libgnutls_config_prefix != x ; then
-     if test x${LIBGNUTLS_CONFIG+set} != xset ; then
-        LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config
-     fi
-  fi
-
-  AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no)
-  min_libgnutls_version=ifelse([$1], ,0.1.0,$1)
-  AC_MSG_CHECKING(for libgnutls - version >= $min_libgnutls_version)
-  no_libgnutls=""
-  if test "$LIBGNUTLS_CONFIG" = "no" ; then
-    no_libgnutls=yes
-  else
-    LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`
-    LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`
-    libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`
-
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
-      LIBS="$LIBS $LIBGNUTLS_LIBS"
-dnl
-dnl Now check if the installed libgnutls is sufficiently new. Also sanity
-dnl checks the results of libgnutls-config to some extent
-dnl
-      rm -f conf.libgnutlstest
-      AC_TRY_RUN([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <gnutls/gnutls.h>
-
-int
-main ()
-{
-    system ("touch conf.libgnutlstest");
-
-    if( strcmp( gnutls_check_version(NULL), "$libgnutls_config_version" ) )
-    {
-      printf("\n*** 'libgnutls-config --version' returned %s, but LIBGNUTLS (%s)\n",
-             "$libgnutls_config_version", gnutls_check_version(NULL) );
-      printf("*** was found! If libgnutls-config was correct, then it is best\n");
-      printf("*** to remove the old version of LIBGNUTLS. You may also be able to fix the error\n");
-      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
-      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
-      printf("*** required on your system.\n");
-      printf("*** If libgnutls-config was wrong, set the environment variable LIBGNUTLS_CONFIG\n");
-      printf("*** to point to the correct copy of libgnutls-config, and remove the file config.cache\n");
-      printf("*** before re-running configure\n");
-    }
-    else if ( strcmp(gnutls_check_version(NULL), LIBGNUTLS_VERSION ) )
-    {
-      printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION);
-      printf("*** library (version %s)\n", gnutls_check_version(NULL) );
-    }
-    else
-    {
-      if ( gnutls_check_version( "$min_libgnutls_version" ) )
-      {
-        return 0;
-      }
-     else
-      {
-        printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n",
-                gnutls_check_version(NULL) );
-        printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n",
-               "$min_libgnutls_version" );
-        printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n";);
-        printf("*** \n");
-        printf("*** If you have already installed a sufficiently new version, this error\n");
-        printf("*** probably means that the wrong copy of the libgnutls-config shell script is\n");
-        printf("*** being found. The easiest way to fix this is to remove the old version\n");
-        printf("*** of LIBGNUTLS, but you can also set the LIBGNUTLS_CONFIG environment to point to the\n");
-        printf("*** correct copy of libgnutls-config. (In this case, you will have to\n");
-        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
-        printf("*** so that the correct libraries are found at run-time))\n");
-      }
-    }
-  return 1;
-}
-],, no_libgnutls=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-  fi
-
-  if test "x$no_libgnutls" = x ; then
-     AC_MSG_RESULT(yes)
-     ifelse([$2], , :, [$2])
-  else
-     if test -f conf.libgnutlstest ; then
-        :
-     else
-        AC_MSG_RESULT(no)
-     fi
-     if test "$LIBGNUTLS_CONFIG" = "no" ; then
-       echo "*** The libgnutls-config script installed by LIBGNUTLS could not be found"
-       echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in"
-       echo "*** your path, or set the LIBGNUTLS_CONFIG environment variable to the"
-       echo "*** full path to libgnutls-config."
-     else
-       if test -f conf.libgnutlstest ; then
-        :
-       else
-          echo "*** Could not run libgnutls test program, checking why..."
-          CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
-          LIBS="$LIBS $LIBGNUTLS_LIBS"
-          AC_TRY_LINK([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <gnutls/gnutls.h>
-],      [ return !!gnutls_check_version(NULL); ],
-        [ echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong"
-          echo "*** version of LIBGNUTLS. If it is not finding LIBGNUTLS, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system"
-          echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
-          echo "***" ],
-        [ echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed"
-          echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you"
-          echo "*** may want to edit the libgnutls-config script: $LIBGNUTLS_CONFIG" ])
-          CFLAGS="$ac_save_CFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-     LIBGNUTLS_CFLAGS=""
-     LIBGNUTLS_LIBS=""
-     ifelse([$3], , :, [$3])
-  fi
-  rm -f conf.libgnutlstest
-  AC_SUBST(LIBGNUTLS_CFLAGS)
-  AC_SUBST(LIBGNUTLS_LIBS)
-])
Index: config.nmake
===================================================================
--- config.nmake	(revision 18459)
+++ config.nmake	(working copy)
@@ -171,6 +171,16 @@
 LUA_DIR=$(WIRESHARK_LIBS)\lua5.1
 
 #
+# If you have the PORTAUDIO library (used por listen_rtp plugin), 
+# set this to the pathname of the directory in which the PORTAUDIO
+# package has been extracted.
+#
+# If you don't have PORTAUDIO, comment this line out, so that 
+# PORTAUDIO_DIR isn't defined.
+#
+PORTAUDIO_DIR=$(WIRESHARK_LIBS)\portaudio_v18_1
+
+#
 # Set ICONV_DIR to the pathname of the directory in which the
 # ICONV include files and library resides.
 #
@@ -452,5 +462,12 @@
 LUA_CONFIG=
 !ENDIF
 
+!IFDEF PORTAUDIO_DIR
+# Nmake uses carets to escape special characters
+PORTAUDIO_CONFIG=^#define HAVE_PORTAUDIO 1
+!else
+PORTAUDIO_CONFIG=
+!ENDIF
+
 # Construct the path
 PATH=$(PATH);$(CYGWIN_PATH);$(DLL_PATH);$(ZLIB_PATH);$(ADNS_PATH)
Index: configure.in
===================================================================
--- configure.in	(revision 18459)
+++ configure.in	(working copy)
@@ -74,12 +74,28 @@
                 if test x$libgnutls_config_prefix != x ; then
 	                AC_MSG_ERROR([[gnuTLS not found; install gnuTLS-devel package for your system]])
                 else
-                        echo echo "gnuTLS not found, disabling ssl and ipsec decryption"
+                        echo echo "gnuTLS not found, disabling ssl decryption"
                         tls_message="no"
                 fi
         ]
 )
 
+# libgrypt
+AM_PATH_LIBGCRYPT(1.1.0,
+        [
+                echo "libgcrypt found, enabling ipsec decryption"
+                AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to use libgcrypt])
+                gcrypt_message="yes"
+        ]
+        , [
+                if test x$libgcrypt_config_prefix != x ; then
+	                AC_MSG_ERROR([[libgcrypt not found; install libgcrypt-devel package for your system]])
+                else
+                        echo echo "libgcrypt not found, disabling ipsec decryption"
+                        gcrypt_message="no"
+                fi
+        ]
+)
 
 # Check for xsltproc
 AC_PATH_PROG(XSLTPROC, xsltproc)
@@ -802,6 +818,41 @@
 AM_CONDITIONAL(HAVE_LIBLUA, test x$want_lua = xyes)
 
 
+dnl portaudio check
+AC_MSG_CHECKING(whether to use libportaudio for the listen_rtp plugin)
+
+AC_ARG_WITH(portaudio,
+[  --with-portaudio[[=DIR]]  use libportaudio (located in directory DIR, if supplied) for the listen_rtp plugin.  [[default=no]]],
+[
+	if test $withval = no
+	then
+		want_portaudio=no
+	elif test $withval = yes
+	then
+		want_portaudio=yes
+	else
+		want_portaudio=yes
+		portaudio_dir=$withval
+	fi
+],[
+	#
+	# Don't use libportaudio by default
+	#
+	want_portaudio=no
+	portaudio_dir=
+])
+if test "x$want_portaudio" = "xno" ; then
+	AC_MSG_RESULT(no)
+else
+	AC_MSG_RESULT(yes)
+	AC_WIRESHARK_LIBPORTAUDIO_CHECK
+	if test "x$want_portaudio" = "xno" ; then
+		AC_MSG_RESULT(libportaudio not found - disabling support for the listen_rtp plugin)
+	fi
+fi
+AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
+
+
 dnl ipv6 check
 AC_ARG_ENABLE(ipv6,
 [  --enable-ipv6           use ipv6 name resolution, if available.  [default=yes]],enable_ipv6=$enableval,enable_ipv6=yes)
@@ -1328,6 +1379,7 @@
   plugins/gryphon/Makefile
   plugins/h223/Makefile
   plugins/irda/Makefile
+  plugins/listen_rtp/Makefile
   plugins/lua/Makefile
   plugins/lwres/Makefile
   plugins/mate/Makefile
@@ -1373,6 +1425,12 @@
 	lua_message="no"
 fi
 
+if test "x$want_portaudio" = "xyes" -a "x$have_plugins" = "xyes" ; then
+	portaudio_message="yes"
+else
+	portaudio_message="no"
+fi
+
 if test "x$want_ssl" = "xno" ; then
 	ssl_message="no"
 else
@@ -1415,6 +1473,7 @@
 echo "                     Install setuid : $setuid_message"
 echo "                        Use plugins : $have_plugins"
 echo "                   Build lua plugin : $lua_message"
+echo "            Build listen_rtp plugin : $portaudio_message"
 echo "                Use GTK+ v2 library : $enable_gtk2"
 if test "x$enable_gtk2" = "xyes" ; then
 echo "                       Use threads : $enable_threads"
@@ -1425,6 +1484,7 @@
 echo "                  Use pcre library : $pcre_message"
 echo "              Use kerberos library : $krb5_message"
 echo "              Use GNU ADNS library : $adns_message"
+echo "            Use GNU crypto library : $gcrypt_message"
 echo "            Use SSL crypto library : $ssl_message"
 echo "          Use IPv6 name resolution : $enable_ipv6"
 echo "     Use UCD SNMP/Net-SNMP library : $snmp_libs_message"
Index: gtk/voip_calls.c
===================================================================
--- gtk/voip_calls.c	(revision 18459)
+++ gtk/voip_calls.c	(working copy)
@@ -64,6 +64,16 @@
 
 #include "alert_box.h"
 #include "simple_dialog.h"
+static dissector_handle_t listen_rtp_handle = NULL;
+struct dissector_handle {
+	const char	*name;		/* dissector name */
+	gboolean	is_new;		/* TRUE if new-style dissector */
+	union {
+		dissector_t	old;
+		new_dissector_t	new;
+	} dissector;
+	protocol_t	*protocol;
+};
 
 const char *voip_call_state_name[7]={
 	"CALL SETUP",
@@ -124,6 +134,9 @@
 	GList* list;
 	GList* list2;
 
+	/* if there is listen RTP plugin, then reset it */
+	if (listen_rtp_handle) (*listen_rtp_handle->dissector.old)(NULL, NULL, NULL); 
+
 	/* free the data items first */
 	list = g_list_first(tapinfo->strinfo_list);
 	while (list)
@@ -191,6 +204,7 @@
 	the_tapinfo_struct.graph_analysis->nconv = 0;
 	the_tapinfo_struct.graph_analysis->list = NULL;
 
+	listen_rtp_handle = find_dissector("listenrtp");
 }
 
 /****************************************************************************/
@@ -481,6 +495,9 @@
 		return 0;
 	}
 
+	/* if we have the listen_rtp plugin, add this RTP for future listening */
+	if (listen_rtp_handle) (*listen_rtp_handle->dissector.old)(NULL, pi, pinfo); 
+
 	/* check wether we already have a RTP stream with this setup frame and ssrc in the list */
 	list = g_list_first(tapinfo->list);
 	while (list)
@@ -659,6 +676,10 @@
 	have_RTP_tap_listener=FALSE;
 }
 
+/* XXX just copied from gtk/rpc_stat.c */
+void protect_thread_critical_region(void);
+void unprotect_thread_critical_region(void);
+
 /****************************************************************************/
 /******************************TAP for T38 **********************************/
 /****************************************************************************/
Index: gtk/voip_calls_dlg.c
===================================================================
--- gtk/voip_calls_dlg.c	(revision 18459)
+++ gtk/voip_calls_dlg.c	(working copy)
@@ -70,6 +70,16 @@
 #include <epan/addr_resolv.h>
  
 static const gchar FWD_LABEL_TEXT[] = "Select one call.";
+static dissector_handle_t listen_rtp_handle = NULL;
+struct dissector_handle {
+	const char	*name;		/* dissector name */
+	gboolean	is_new;		/* TRUE if new-style dissector */
+	union {
+		dissector_t	old;
+		new_dissector_t	new;
+	} dissector;
+	protocol_t	*protocol;
+};
 
 /****************************************************************************/
 /* pointer to the one and only dialog window */
@@ -83,8 +93,8 @@
 /*static GtkWidet *bt_unselect = NULL;*/
 static GtkWidget *bt_filter = NULL;
 static GtkWidget *bt_graph = NULL;
+static GtkWidget *bt_listen = NULL;
 
-
 static voip_calls_info_t* selected_call_fwd = NULL;  /* current selection */
 static GList *last_list = NULL;
 
@@ -231,6 +241,7 @@
 	/*gtk_widget_set_sensitive(bt_unselect, FALSE);*/
 	gtk_widget_set_sensitive(bt_filter, FALSE);
 	gtk_widget_set_sensitive(bt_graph, FALSE);
+	gtk_widget_set_sensitive(bt_listen, FALSE);
 }
 
 
@@ -395,6 +406,14 @@
 }
 
 /****************************************************************************/
+static void
+on_listen_bt_clicked                    (GtkButton       *button _U_,
+                                        gpointer         user_data _U_)
+{
+	if (listen_rtp_handle) (*listen_rtp_handle->dissector.old)(voip_calls_get_info(), NULL, NULL); 
+}
+
+/****************************************************************************/
 /* when the user selects a row in the calls list */
 static void
 voip_calls_on_select_row(GtkCList *clist,
@@ -443,9 +462,11 @@
 	if 	(calls_ns > 0) {
 		gtk_widget_set_sensitive(bt_filter, TRUE);
 		gtk_widget_set_sensitive(bt_graph, TRUE);
+		if (listen_rtp_handle) gtk_widget_set_sensitive(bt_listen, TRUE); /* we have the listen_rtp plugin */
 	} else {
 		gtk_widget_set_sensitive(bt_filter, FALSE);
 		gtk_widget_set_sensitive(bt_graph, FALSE);
+		gtk_widget_set_sensitive(bt_listen, FALSE);
 	}
 
 	/* TODO: activate other buttons when implemented */
@@ -650,6 +671,12 @@
 	SIGNAL_CONNECT(bt_graph, "clicked", on_graph_bt_clicked, NULL);
 	gtk_tooltips_set_tip (tooltips, bt_graph, "Show a flow graph of the selected calls.", NULL);
 
+	bt_listen = gtk_button_new_with_label("Listen");
+	gtk_container_add(GTK_CONTAINER(hbuttonbox), bt_listen);
+	gtk_widget_show(bt_listen);
+	SIGNAL_CONNECT(bt_listen, "clicked", on_listen_bt_clicked, NULL);
+	gtk_tooltips_set_tip (tooltips, bt_listen, "Listen the RTP for selected calls.", NULL);
+
 	bt_close = BUTTON_NEW_FROM_STOCK(GTK_STOCK_CLOSE);
 	gtk_container_add (GTK_CONTAINER (hbuttonbox), bt_close);
 	GTK_WIDGET_SET_FLAGS(bt_close, GTK_CAN_DEFAULT);
@@ -817,5 +844,6 @@
 	register_stat_cmd_arg("voip,calls",voip_calls_init_tap,NULL);
 	register_stat_menu_item("VoIP Calls", REGISTER_STAT_GROUP_TELEPHONY,
 	    voip_calls_launch, NULL, NULL, NULL);
+	listen_rtp_handle = find_dissector("listenrtp");
 	    
 }
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 18459)
+++ Makefile.am	(working copy)
@@ -192,6 +192,12 @@
 lua_lib =
 endif		# HAVE_LIBLUA
 
+if HAVE_LIBPORTAUDIO
+listen_rtp_lib = plugins/listen_rtp/listen_rtp.la
+else		# HAVE_LIBPORTAUDIO
+listen_rtp_lib =
+endif		# HAVE_LIBPORTAUDIO
+
 plugin_libs = \
 	plugins/acn/acn.la \
 	plugins/agentx/agentx.la \
@@ -204,6 +210,7 @@
 	plugins/giop/coseventcomm.la \
 	plugins/gryphon/gryphon.la \
 	plugins/irda/irda.la \
+	$(listen_rtp_lib) \
 	$(lua_lib) \
 	plugins/lwres/lwres.la \
 	plugins/mate/mate.la \
@@ -230,6 +237,12 @@
 lua_ldadd =
 endif		# HAVE_LIBLUA
 
+if HAVE_LIBPORTAUDIO
+listen_rtp_ldadd = "-dlopen" plugins/listen_rtp/listen_rtp.la
+else		# HAVE_LIBPORTAUDIO
+listen_rtp_ldadd =
+endif		# HAVE_LIBPORTAUDIO
+
 plugin_ldadd = \
 	"-dlopen" self	\
 	"-dlopen" plugins/acn/acn.la \
@@ -244,6 +257,7 @@
 	"-dlopen" plugins/gryphon/gryphon.la \
 	"-dlopen" plugins/h223/h223.la \
 	"-dlopen" plugins/irda/irda.la \
+	$(listen_rtp_ldadd) \
 	$(lua_ldadd) \
 	"-dlopen" plugins/lwres/lwres.la \
 	"-dlopen" plugins/mate/mate.la \
Index: Makefile.nmake
===================================================================
--- Makefile.nmake	(revision 18459)
+++ Makefile.nmake	(working copy)
@@ -235,6 +235,7 @@
 	    -e "s/@HAVE_GNUTLS@/$(GNUTLS_CONFIG)/" \
 	    -e "s/@HAVE_LUA@/$(LUA_CONFIG)/" \
 	    -e "s/@HAVE_LUA_5_1@/$(LUA_VERSION)/" \
+		-e "s/@HAVE_PORTAUDIO@/$(PORTAUDIO_CONFIG)/" \
 	    < config.h.win32 > $@
 
 ps.c	: rdps.exe print.ps
@@ -519,6 +520,10 @@
 	@$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
 		. lua5_1_vc6.zip
 !ENDIF
+!IFDEF PORTAUDIO_DIR
+	@$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
+		. portaudio_v18_1.zip
+!ENDIF
 !IFDEF GTK2_DIR
 !IF "$(GTK2_INST_VERSION)" == "2.8"
 	@$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \

Property changes on: plugins
___________________________________________________________________
Name: svn:ignore
   - Makefile
Makefile.in
xyzzy
*.obj
*.pdb


Index: plugins/Makefile.nmake
===================================================================
--- plugins/Makefile.nmake	(revision 18459)
+++ plugins/Makefile.nmake	(working copy)
@@ -18,6 +18,7 @@
 	gryphon \
 	h223 \
 	irda \
+	listen_rtp \
 	lua\
 	lwres \
 	mate \
@@ -89,6 +90,13 @@
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
 	cd ..
 
+listen_rtp::
+!IFDEF PORTAUDIO_DIR
+	cd listen_rtp
+	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
+	cd ..
+!ENDIF
+
 lua::
 !IFDEF LUA_DIR
 	cd lua
@@ -185,6 +193,8 @@
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
 	cd ../irda
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
+	cd ../listen_rtp
+	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
 	cd ../lua
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
 	cd ../lwres
@@ -242,6 +252,8 @@
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
 	cd ../lwres
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
+	cd ../listen_rtp
+	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
 	cd ../mate
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
 	cd ../megaco
@@ -291,6 +303,8 @@
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
 	cd ../irda
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+	cd ../listen_rtp
+	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
 	cd ../lua
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
 	cd ../lwres
@@ -339,6 +353,9 @@
 	xcopy gryphon\*.dll $(VERSION) /d
 	xcopy h223\*.dll $(VERSION) /d
 	xcopy irda\*.dll $(VERSION) /d
+!IFDEF PORTAUDIO_DIR
+	xcopy listen_rtp\*.dll $(VERSION) /d
+!ENDIF
 !IFDEF LUA_DIR
 	xcopy lua\*.dll $(VERSION) /d
 !ENDIF
Index: plugins/Makefile.am
===================================================================
--- plugins/Makefile.am	(revision 18459)
+++ plugins/Makefile.am	(working copy)
@@ -28,6 +28,13 @@
 lua_dir =
 endif		# HAVE_LIBLUA
 
+if HAVE_LIBPORTAUDIO
+listen_rtp_dir = \
+	listen_rtp
+else		# HAVE_LIBPORTAUDIO
+listen_rtp_dir =
+endif		# HAVE_LIBPORTAUDIO
+
 SUBDIRS = \
 	acn \
 	agentx \
@@ -40,6 +47,7 @@
 	gryphon \
 	h223 \
 	irda \
+	$(listen_rtp_dir) \
 	$(lua_dir) \
 	lwres \
 	mate \
Index: plugins/Makefile.am
===================================================================
--- plugins/Makefile.am	(revision 18459)
+++ plugins/Makefile.am	(working copy)
@@ -28,6 +28,13 @@
 lua_dir =
 endif		# HAVE_LIBLUA
 
+if HAVE_LIBPORTAUDIO
+listen_rtp_dir = \
+	listen_rtp
+else		# HAVE_LIBPORTAUDIO
+listen_rtp_dir =
+endif		# HAVE_LIBPORTAUDIO
+
 SUBDIRS = \
 	acn \
 	agentx \
@@ -40,6 +47,7 @@
 	gryphon \
 	h223 \
 	irda \
+	$(listen_rtp_dir) \
 	$(lua_dir) \
 	lwres \
 	mate \
Index: plugins/Makefile.nmake
===================================================================
--- plugins/Makefile.nmake	(revision 18459)
+++ plugins/Makefile.nmake	(working copy)
@@ -18,6 +18,7 @@
 	gryphon \
 	h223 \
 	irda \
+	listen_rtp \
 	lua\
 	lwres \
 	mate \
@@ -89,6 +90,13 @@
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
 	cd ..
 
+listen_rtp::
+!IFDEF PORTAUDIO_DIR
+	cd listen_rtp
+	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
+	cd ..
+!ENDIF
+
 lua::
 !IFDEF LUA_DIR
 	cd lua
@@ -185,6 +193,8 @@
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
 	cd ../irda
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
+	cd ../listen_rtp
+	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
 	cd ../lua
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
 	cd ../lwres
@@ -242,6 +252,8 @@
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
 	cd ../lwres
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
+	cd ../listen_rtp
+	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
 	cd ../mate
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
 	cd ../megaco
@@ -291,6 +303,8 @@
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
 	cd ../irda
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+	cd ../listen_rtp
+	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
 	cd ../lua
 	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
 	cd ../lwres
@@ -339,6 +353,9 @@
 	xcopy gryphon\*.dll $(VERSION) /d
 	xcopy h223\*.dll $(VERSION) /d
 	xcopy irda\*.dll $(VERSION) /d
+!IFDEF PORTAUDIO_DIR
+	xcopy listen_rtp\*.dll $(VERSION) /d
+!ENDIF
 !IFDEF LUA_DIR
 	xcopy lua\*.dll $(VERSION) /d
 !ENDIF

Attachment: listen_rtp.zip
Description: Zip compressed data

Attachment: portaudio_v18_1.zip
Description: Zip compressed data