r3174 - trunk/minisip/minisip/gui/textui

erik at minisip.org erik at minisip.org
Thu Feb 1 11:02:04 CET 2007


Author: erik
Date: 2007-02-01 11:02:03 +0100 (Thu, 01 Feb 2007)
New Revision: 3174

Modified:
   trunk/minisip/minisip/gui/textui/MinisipTextUI.cxx
Log:

 * Added "sleep <n>" command to the text ui. It will delay executing
   any command passed to the text ui for n seconds. 

   This is can be used for scripted testing of minisip. The testing
   has started from the lower layers, but we are now getting closer
   to testing the complete application.



Modified: trunk/minisip/minisip/gui/textui/MinisipTextUI.cxx
===================================================================
--- trunk/minisip/minisip/gui/textui/MinisipTextUI.cxx	2007-02-01 09:57:29 UTC (rev 3173)
+++ trunk/minisip/minisip/gui/textui/MinisipTextUI.cxx	2007-02-01 10:02:03 UTC (rev 3174)
@@ -48,6 +48,7 @@
 	//#endif
 	
 	addCommand("quit");
+	addCommand("sleep");
 	addCommand("answer");
 	addCommand("disable autoanswer");
 	addCommand("enable autoanswer");
@@ -676,6 +677,13 @@
 		handled=true;
 	}
 #endif
+	
+	if (command.substr(0,5)=="sleep"){
+		string time = command.substr(5);
+		int t = atoi(time.c_str());
+		if (t>0)
+			Thread::msleep(t*1000);
+	}
 
 	if (command == "answer"){
 		CommandString command(callId, SipCommandString::accept_invite);



More information about the Minisip-devel mailing list