[Freeswitch-svn] [commit] r3255 - freeswitch/branches/knhor/wip/mod_conference

Freeswitch SVN knhor at freeswitch.org
Wed Nov 1 23:21:37 EST 2006


Author: knhor
Date: Wed Nov  1 23:21:36 2006
New Revision: 3255

Modified:
   freeswitch/branches/knhor/wip/mod_conference/mod_conference.c

Log:
there are 12 dtmf caller control functions, not 11

Modified: freeswitch/branches/knhor/wip/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/branches/knhor/wip/mod_conference/mod_conference.c	(original)
+++ freeswitch/branches/knhor/wip/mod_conference/mod_conference.c	Wed Nov  1 23:21:36 2006
@@ -47,6 +47,10 @@
 #define CONF_DBUFFER_MAX 0
 #define CONF_CHAT_PROTO "conf"
 
+#ifndef MIN
+#define MIN(a,b) ((a)<(b)?(a):(b))
+#endif
+
 typedef enum {
 	FILE_STOP_CURRENT,
 	FILE_STOP_ALL
@@ -1023,7 +1027,7 @@
 				// determines the operation that is being requested
 				// To disable the function for the user, make the control
 				// string digit something that can't be dialed... ie. a space
-				// The control string should have at least 11 characters in it
+				// The control string should have at least 12 characters in it
 				pcontroldigit = strchr(member->conference->caller_dtmf_control,*digit);
 
 				if(pcontroldigit != NULL) {
@@ -3351,13 +3355,13 @@
 	// determines the operation that is being requested
 	// To disable the function for the user, make the control
 	// string digit something that can't be dialed... ie. a space
-	// The control string should have at least 11 characters in it
-	if(strlen(caller_dtmf_control) < 11) {
-		char dbuf[12];
+	// The control string should have at least 12 characters in it
+	if(strlen(caller_dtmf_control) < 12) {
+		char dbuf[13];
 
 		memset(dbuf,' ',sizeof(dbuf));
-		dbuf[11] = '\0';
-		memcpy(dbuf,caller_dtmf_control,strlen(caller_dtmf_control));
+		dbuf[12] = '\0';
+		memcpy(dbuf,caller_dtmf_control,MIN(sizeof(dbuf)-1,strlen(caller_dtmf_control)));
 
 		conference->caller_dtmf_control = switch_core_strdup(conference->pool, dbuf);
 	} else {



More information about the Freeswitch-svn mailing list