[Freeswitch-svn] [commit] r5380 - in freeswitch/trunk/src: . mod/applications/mod_commands mod/applications/mod_dptools

Freeswitch SVN anthm at freeswitch.org
Fri Jun 15 23:43:14 EDT 2007


Author: anthm
Date: Fri Jun 15 23:43:13 2007
New Revision: 5380

Modified:
   freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
   freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
   freeswitch/trunk/src/switch_core_io.c
   freeswitch/trunk/src/switch_ivr_async.c

Log:
finish up merge

Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	Fri Jun 15 23:43:13 2007
@@ -284,7 +284,9 @@
 	time_t to = 0;
 	switch_core_session_t *rsession;
 	
-	mydata = switch_core_session_strdup(session, cmd);
+	mydata = strdup(cmd);
+	assert(mydata != NULL);
+
 	if ((argc = switch_separate_string(mydata, ' ', argv, sizeof(argv) / sizeof(argv[0]))) < 3) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID ARGS!\n");
 	}
@@ -296,15 +298,15 @@
 
 	if (argv[4]) {
 		uint32_t mto;
-		if (*argv[2] == '+') {
-			if ((mto = atoi(argv[3]+1)) > 0) {
+		if (*argv[4] == '+') {
+			if ((mto = atoi(argv[4]+1)) > 0) {
 				to = time(NULL) + mto;
 			} else {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID Timeout!\n");
 				goto done;
 			}
 		} else {
-			if ((to = atoi(argv[3])) < time(NULL)) {
+			if ((to = atoi(argv[4])) < time(NULL)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID Timeout!\n");
 				to = 0;
 				goto done;
@@ -317,6 +319,7 @@
 
  done:
 
+	free(mydata);
 	switch_core_session_rwunlock(rsession);
 
 	return SWITCH_STATUS_SUCCESS;
@@ -1431,7 +1434,7 @@
 };
 
 static switch_api_interface_t tone_detect_session_interface = {
-	/*.interface_name */ "tone_Detect",
+	/*.interface_name */ "tone_detect",
 	/*.desc */ "Start Tone Detection on a channel",
 	/*.function */ tone_detect_session_function,
 	/*.syntax */

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	Fri Jun 15 23:43:13 2007
@@ -680,14 +680,14 @@
 	}
 	if (argv[3]) {
 		uint32_t mto;
-		if (*argv[2] == '+') {
-			if ((mto = atoi(argv[2]+1)) > 0) {
+		if (*argv[3] == '+') {
+			if ((mto = atol(argv[3]+1)) > 0) {
 				to = time(NULL) + mto;
 			} else {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID Timeout!\n");
 			}
 		} else {
-			if ((to = atoi(argv[2])) < time(NULL)) {
+			if ((to = atol(argv[3])) < time(NULL)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID Timeout!\n");
 				to = 0;
 			}

Modified: freeswitch/trunk/src/switch_core_io.c
==============================================================================
--- freeswitch/trunk/src/switch_core_io.c	(original)
+++ freeswitch/trunk/src/switch_core_io.c	Fri Jun 15 23:43:13 2007
@@ -232,7 +232,7 @@
 					switch_mutex_lock(bp->read_mutex);
 					switch_buffer_write(bp->raw_read_buffer, read_frame->data, read_frame->datalen);
 					if (bp->callback) {
-						if (bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ) == SWITCH_FALSE || (bp->stop_time && bp->stop_time >= time(NULL))) {
+						if (bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ) == SWITCH_FALSE || (bp->stop_time && bp->stop_time <= time(NULL))) {
 							ok = SWITCH_FALSE;
 						}
 					}
@@ -516,7 +516,7 @@
 					}
 				}
 
-				if (bp->stop_time && bp->stop_time >= time(NULL)) {
+				if (bp->stop_time && bp->stop_time <= time(NULL)) {
 					ok = SWITCH_FALSE;
 				}
 

Modified: freeswitch/trunk/src/switch_ivr_async.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_async.c	(original)
+++ freeswitch/trunk/src/switch_ivr_async.c	Fri Jun 15 23:43:13 2007
@@ -519,7 +519,8 @@
 				if (cont->list[i].up && teletone_multi_tone_detect(&cont->list[i].mt, frame->data, frame->samples)) {
 					switch_event_t *event;
 					
-					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "TONE %s DETECTED\n", cont->list[i].key);
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "TONE %s DETECTED\n", cont->list[i].key);
+					cont->list[i].up = 0;
 
 					if (cont->list[i].app) {
 						if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
@@ -531,8 +532,6 @@
 						}
 					}
 
-					cont->list[cont->index].up = 0;
-
 					if (switch_event_create(&event, SWITCH_EVENT_DETECTED_TONE) == SWITCH_STATUS_SUCCESS) {
 						switch_event_t *dup;
 						switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Detected-Tone", "%s", cont->list[i].key);
@@ -641,6 +640,7 @@
 		  p = next + 1;
 	  }
   } while (next);
+  cont->list[cont->index].map.freqs[i++] = 0;
 
   if (!ok) {
 	  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid tone spec!\n");
@@ -675,6 +675,7 @@
 	  }
   }
 
+
   if ((status = switch_core_media_bug_add(session, tone_detect_callback, cont, timeout, bflags, &cont->bug)) != SWITCH_STATUS_SUCCESS) {
 	  return status;
   }



More information about the Freeswitch-svn mailing list