[Freeswitch-svn] [commit] r7199 - in freeswitch/trunk/src: . include mod/applications/mod_conference mod/applications/mod_rss mod/codecs/mod_amr mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Sun Jan 13 13:39:51 EST 2008


Author: anthm
Date: Sun Jan 13 13:39:51 2008
New Revision: 7199

Modified:
   freeswitch/trunk/src/include/switch_core.h
   freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
   freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c
   freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
   freeswitch/trunk/src/switch_core_session.c
   freeswitch/trunk/src/switch_core_state_machine.c
   freeswitch/trunk/src/switch_ivr.c
   freeswitch/trunk/src/switch_ivr_async.c
   freeswitch/trunk/src/switch_ivr_bridge.c
   freeswitch/trunk/src/switch_ivr_originate.c
   freeswitch/trunk/src/switch_ivr_play_say.c

Log:
tweak

Modified: freeswitch/trunk/src/include/switch_core.h
==============================================================================
--- freeswitch/trunk/src/include/switch_core.h	(original)
+++ freeswitch/trunk/src/include/switch_core.h	Sun Jan 13 13:39:51 2008
@@ -797,7 +797,7 @@
   \brief Reset the buffers and resampler on a session
   \param session the session to reset
 */
-SWITCH_DECLARE(void) switch_core_session_reset(_In_ switch_core_session_t *session);
+SWITCH_DECLARE(void) switch_core_session_reset(_In_ switch_core_session_t *session, switch_bool_t flush_dtmf);
 
 /*! 
   \brief Write a frame to a session

Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	Sun Jan 13 13:39:51 2008
@@ -4369,7 +4369,7 @@
 		switch_safe_free(dfile);
 	}
 
-	switch_core_session_reset(session);
+	switch_core_session_reset(session, SWITCH_TRUE);
 
 	/* release the readlock */
 	if (rl) {

Modified: freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_rss/mod_rss.c	Sun Jan 13 13:39:51 2008
@@ -624,7 +624,7 @@
 	}
 
 	switch_xml_free(xml);
-	switch_core_session_reset(session);
+	switch_core_session_reset(session, SWITCH_TRUE);
 }
 
 

Modified: freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c	Sun Jan 13 13:39:51 2008
@@ -37,8 +37,8 @@
 SWITCH_MODULE_DEFINITION(mod_amr, mod_amr_load, NULL, NULL);
 
 #ifndef AMR_PASSTHROUGH
-#include "amr/interf_enc.h"
-#include "amr/interf_dec.h"
+#include "interf_enc.h"
+#include "interf_dec.h"
 
 /*
  * Check section 8.1 of rfc3267 for possible sdp options.

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	Sun Jan 13 13:39:51 2008
@@ -1016,7 +1016,7 @@
 							  tech_pvt->read_codec.implementation->iananame, tech_pvt->rm_encoding);
 			switch_core_codec_destroy(&tech_pvt->read_codec);
 			switch_core_codec_destroy(&tech_pvt->write_codec);
-			switch_core_session_reset(tech_pvt->session);
+			switch_core_session_reset(tech_pvt->session, SWITCH_TRUE);
 		} else {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Already using %s\n", tech_pvt->read_codec.implementation->iananame);
 			return SWITCH_STATUS_SUCCESS;

Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c	(original)
+++ freeswitch/trunk/src/switch_core_session.c	Sun Jan 13 13:39:51 2008
@@ -575,11 +575,14 @@
 }
 
 
-SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session)
+SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session, switch_bool_t flush_dtmf)
 {
 	switch_channel_t *channel;
 	switch_size_t has;
 
+	channel = switch_core_session_get_channel(session);
+	switch_assert(channel != NULL);
+
 	/* clear resamplers*/
 	switch_resample_destroy(&session->read_resampler);
 	switch_resample_destroy(&session->write_resampler);
@@ -590,12 +593,11 @@
 	/* wipe theese, they will be recreated if need be */
 	switch_buffer_destroy(&session->raw_read_buffer);
 	switch_buffer_destroy(&session->raw_write_buffer);
-
-	/* flush dtmf */
-	channel = switch_core_session_get_channel(session);
-
-	while ((has = switch_channel_has_dtmf(channel))) {
-		switch_channel_flush_dtmf(channel);
+	
+	if (flush_dtmf) {
+		while ((has = switch_channel_has_dtmf(channel))) {
+			switch_channel_flush_dtmf(channel);
+		}
 	}
 
 	switch_ivr_deactivate_unicast(session);

Modified: freeswitch/trunk/src/switch_core_state_machine.c
==============================================================================
--- freeswitch/trunk/src/switch_core_state_machine.c	(original)
+++ freeswitch/trunk/src/switch_core_state_machine.c	Sun Jan 13 13:39:51 2008
@@ -220,7 +220,7 @@
 	switch_assert(session != NULL);
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard PARK\n");
 	switch_channel_clear_flag(session->channel, CF_TRANSFER);
-	switch_core_session_reset(session);
+	switch_core_session_reset(session, SWITCH_TRUE);
 	switch_ivr_park(session, NULL);
 }
 

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Sun Jan 13 13:39:51 2008
@@ -882,7 +882,7 @@
 	const char *uuid = NULL;
 
 	switch_assert(session != NULL);
-	switch_core_session_reset(session);
+	switch_core_session_reset(session, SWITCH_TRUE);
 
 	channel = switch_core_session_get_channel(session);
 	switch_assert(channel != NULL);

Modified: freeswitch/trunk/src/switch_ivr_async.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_async.c	(original)
+++ freeswitch/trunk/src/switch_ivr_async.c	Sun Jan 13 13:39:51 2008
@@ -300,7 +300,7 @@
 							  SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
 							  switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
-		switch_core_session_reset(session);
+		switch_core_session_reset(session, SWITCH_TRUE);
 		return SWITCH_STATUS_GENERR;
 	}
 
@@ -664,7 +664,7 @@
 		status = SWITCH_STATUS_SUCCESS;
 
 		switch_core_session_set_read_codec(session, read_codec);
-		switch_core_session_reset(session);
+		switch_core_session_reset(session, SWITCH_TRUE);
     }
 	
 	return status;
@@ -720,7 +720,7 @@
 							  SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening %s\n", file);
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
-		switch_core_session_reset(session);
+		switch_core_session_reset(session, SWITCH_TRUE);
 		return SWITCH_STATUS_GENERR;
 	}
 

Modified: freeswitch/trunk/src/switch_ivr_bridge.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_bridge.c	(original)
+++ freeswitch/trunk/src/switch_ivr_bridge.c	Sun Jan 13 13:39:51 2008
@@ -222,7 +222,7 @@
  end:
 
 	switch_core_session_kill_channel(session_b, SWITCH_SIG_BREAK);
-	switch_core_session_reset(session_a);
+	switch_core_session_reset(session_a, SWITCH_TRUE);
 	switch_channel_set_variable(chan_a, SWITCH_BRIDGE_VARIABLE, NULL);
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "BRIDGE THREAD DONE [%s]\n", switch_channel_get_name(chan_a));
 	switch_channel_clear_flag(chan_a, CF_BRIDGED);
@@ -353,8 +353,8 @@
 		
 		switch_channel_clear_flag(channel, CF_TRANSFER);
 		switch_channel_clear_flag(other_channel, CF_TRANSFER);
-		switch_core_session_reset(session);
-		switch_core_session_reset(other_session);
+		switch_core_session_reset(session, SWITCH_TRUE);
+		switch_core_session_reset(other_session, SWITCH_TRUE);
 
 		ready_a = switch_channel_ready(channel);
 		ready_b = switch_channel_ready(other_channel);

Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c	(original)
+++ freeswitch/trunk/src/switch_ivr_originate.c	Sun Jan 13 13:39:51 2008
@@ -448,7 +448,7 @@
 	if (!pass && write_codec.implementation) {
 		if (read_codec && !ringback.asis) {
 			switch_core_session_set_read_codec(session, read_codec);
-			switch_core_session_reset(session);
+			switch_core_session_reset(session, SWITCH_TRUE);
 		}
 		switch_core_codec_destroy(&write_codec);
 	}
@@ -1116,7 +1116,7 @@
 			}
 
 			if (session && (ringback_data || !switch_channel_test_flag(caller_channel, CF_BYPASS_MEDIA))) {
-				switch_core_session_reset(session);
+				switch_core_session_reset(session, SWITCH_FALSE);
 			}
 
 			for (i = 0; i < and_argc; i++) {
@@ -1243,7 +1243,7 @@
 			if (!pass && write_codec.implementation) {
 				if (read_codec && !ringback.asis) {
 					switch_core_session_set_read_codec(session, read_codec);
-					switch_core_session_reset(session);
+					switch_core_session_reset(session, SWITCH_FALSE);
 				}
 				switch_core_codec_destroy(&write_codec);
 			}

Modified: freeswitch/trunk/src/switch_ivr_play_say.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_play_say.c	(original)
+++ freeswitch/trunk/src/switch_ivr_play_say.c	Sun Jan 13 13:39:51 2008
@@ -371,7 +371,7 @@
 							  read_codec->implementation->actual_samples_per_second,
 							  SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
-		switch_core_session_reset(session);
+		switch_core_session_reset(session, SWITCH_TRUE);
 		return SWITCH_STATUS_GENERR;
 	}
 
@@ -429,7 +429,7 @@
 						  "Raw Codec Activation Failed %s@%uhz %u channels %dms\n", codec_name, fh->samplerate,
 						  fh->channels, read_codec->implementation->microseconds_per_frame / 1000);
 		switch_core_file_close(fh);
-		switch_core_session_reset(session);
+		switch_core_session_reset(session, SWITCH_TRUE);
 		return SWITCH_STATUS_GENERR;
 	}
 
@@ -551,7 +551,7 @@
 
 	switch_core_session_set_read_codec(session, read_codec);
 	switch_core_file_close(fh);
-	switch_core_session_reset(session);
+	switch_core_session_reset(session, SWITCH_TRUE);
 	return status;
 }
 
@@ -747,7 +747,7 @@
 							  read_codec->implementation->number_of_channels,
 							  read_codec->implementation->actual_samples_per_second,
 							  SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
-		switch_core_session_reset(session);
+		switch_core_session_reset(session, SWITCH_TRUE);
 		status = SWITCH_STATUS_NOTFOUND;
 		goto end;
 	}
@@ -812,7 +812,7 @@
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "setup buffer failed\n");
 
 			switch_core_file_close(fh);
-			switch_core_session_reset(session);
+			switch_core_session_reset(session, SWITCH_TRUE);
 
 			status = SWITCH_STATUS_GENERR;
 			goto end;
@@ -839,7 +839,7 @@
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
 							  "Raw Codec Activation Failed %s@%uhz %u channels %dms\n", codec_name, fh->samplerate, fh->channels, interval);
 			switch_core_file_close(fh);
-			switch_core_session_reset(session);
+			switch_core_session_reset(session, SWITCH_TRUE);
 			status = SWITCH_STATUS_GENERR;
 			goto end;
 		}
@@ -856,7 +856,7 @@
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "setup timer failed!\n");
 			switch_core_codec_destroy(&codec);
 			switch_core_file_close(fh);
-			switch_core_session_reset(session);
+			switch_core_session_reset(session, SWITCH_TRUE);
 			status = SWITCH_STATUS_GENERR;
 			goto end;
 		}
@@ -1103,7 +1103,7 @@
  end:
 	free(abuf);
 
-	switch_core_session_reset(session);
+	switch_core_session_reset(session, SWITCH_TRUE);
 	return status;
 }
 
@@ -1566,7 +1566,7 @@
 
 	timer_name = switch_channel_get_variable(channel, "timer_name");
 
-	switch_core_session_reset(session);
+	switch_core_session_reset(session, SWITCH_TRUE);
 	read_codec = switch_core_session_get_read_codec(session);
 	
 	rate = read_codec->implementation->actual_samples_per_second;
@@ -1577,7 +1577,7 @@
 		if (switch_core_speech_open(sh, tts_name, voice_name, (uint32_t) rate, interval, 
 									&flags, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid TTS module!\n");
-			switch_core_session_reset(session);
+			switch_core_session_reset(session, SWITCH_TRUE);
 			if (cache_obj) {
 				switch_channel_set_private(channel, SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME, NULL);
 			}
@@ -1603,7 +1603,7 @@
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Failed %s@%uhz 1 channel %dms\n", codec_name, rate, interval);
 			flags = 0;
 			switch_core_speech_close(sh, &flags);
-			switch_core_session_reset(session);
+			switch_core_session_reset(session, SWITCH_TRUE);
 			if (cache_obj) {
 				switch_channel_set_private(channel, SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME, NULL);
 			}
@@ -1620,7 +1620,7 @@
 				switch_core_codec_destroy(write_frame.codec);
 				flags = 0;
 				switch_core_speech_close(sh, &flags);
-				switch_core_session_reset(session);
+				switch_core_session_reset(session, SWITCH_TRUE);
 				if (cache_obj) {
 					switch_channel_set_private(channel, SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME, NULL);
 				}
@@ -1650,6 +1650,6 @@
 		}
 	}
 
-	switch_core_session_reset(session);
+	switch_core_session_reset(session, SWITCH_TRUE);
 	return status;
 }



More information about the Freeswitch-svn mailing list