I propose the attached patch which stops sipp from opening media ports unless a port number is given on the command line.

The current behavior of always opening ports 6000 & 6002 is a problem for the way I use sipp. I'm not using the media ports, but I am invoking sipp many times over the course of automated tests, and right now it often fails to start because some other invocation is still holding on to the same port. It would be difficult to try to come up with unique port numbers for each invocation.

I'd appreciate if this would be considered. I'm happy to tweak the approach.

Thanks,
Dan
Index: sipp.cpp
===================================================================
--- sipp.cpp    (revision 18)
+++ sipp.cpp    (working copy)
@@ -3959,9 +3959,7 @@
   open_connections();
    
   /* Defaults for media sockets */
-  if (media_port <= 0) {
-    media_port = 6000;
-  }
+  if (media_port > 0) {
   if (media_ip[0] == '\0') {
       strcpy(media_ip, local_ip);
     }
@@ -4033,7 +4031,7 @@
       sprintf(msg, "Unable to bind audio RTP socket (IP=%s, port=%d)", 
media_ip, media_port);
       ERROR_NO(msg);
     }
-    
+
     /*---------------------------------------------------------
        Bind the second socket to media_port+2 
        (+1 is reserved for RTCP) 
@@ -4059,6 +4057,7 @@
     }
     /* Second socket bound */
   }
+  }
 
   /* Creating the remote control socket thread */
   if (pthread_create
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sipp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to