[Freeswitch-svn] [commit] r7961 - in freeswitch/trunk/src/mod: applications/mod_fifo endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Tue Mar 25 14:48:21 EDT 2008


Author: anthm
Date: Tue Mar 25 14:48:20 2008
New Revision: 7961

Modified:
   freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c

Log:
update

Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c	Tue Mar 25 14:48:20 2008
@@ -337,8 +337,8 @@
 		int custom_pop = 0;
 		int pop_array[MAX_PRI] = { 0 };
 		char *pop_list[MAX_PRI] = { 0 };
-		const char *fifo_consumer_wrapup_sound = NULL;
-		const char *fifo_consumer_wrapup_key = NULL;
+		const char *fifo_consumer_wrapup_sound = NULL;
+		const char *fifo_consumer_wrapup_key = NULL;
 		char buf[5] = "";
 
         if (argc > 3) {
@@ -394,6 +394,7 @@
 			pop = NULL;
 
             if (moh) {
+				memset(&args, 0, sizeof(args));
                 args.read_frame_callback = read_frame_callback;
                 args.user_data = node;
                 switch_ivr_play_file(session, NULL, moh, &args);
@@ -511,27 +512,26 @@
                 if (nowait) {
                     done = 1;
                 }
-
-				fifo_consumer_wrapup_sound = switch_channel_get_variable(channel, "fifo_consumer_wrapup_sound");
-				fifo_consumer_wrapup_key = switch_channel_get_variable(channel, "fifo_consumer_wrapup_key");
-				memset(buf, 0, sizeof(buf));
-
-				if (!switch_strlen_zero(fifo_consumer_wrapup_sound)) {
-					args.buf = buf;
-					args.buflen = sizeof(buf);
-
-					memset(&args, 0, sizeof(args));
-					switch_ivr_play_file(session, NULL, fifo_consumer_wrapup_sound, &args);
-				}
-
-				if (!switch_strlen_zero(fifo_consumer_wrapup_key) && strcmp(buf, fifo_consumer_wrapup_key)) {
-					for(;;) {
-						char terminator = 0;                        
-						switch_ivr_collect_digits_count(session, buf, sizeof(buf)-1, 1, fifo_consumer_wrapup_key, &terminator, 0, 0, 0);
-						if (terminator == *fifo_consumer_wrapup_key) {
-							break;
-						}
-					}
+
+				fifo_consumer_wrapup_sound = switch_channel_get_variable(channel, "fifo_consumer_wrapup_sound");
+				fifo_consumer_wrapup_key = switch_channel_get_variable(channel, "fifo_consumer_wrapup_key");
+				memset(buf, 0, sizeof(buf));
+
+				if (!switch_strlen_zero(fifo_consumer_wrapup_sound)) {
+					memset(&args, 0, sizeof(args));
+					args.buf = buf;
+					args.buflen = sizeof(buf);
+					switch_ivr_play_file(session, NULL, fifo_consumer_wrapup_sound, &args);
+				}
+
+				if (!switch_strlen_zero(fifo_consumer_wrapup_key) && strcmp(buf, fifo_consumer_wrapup_key)) {
+					for(;;) {
+						char terminator = 0;                        
+						switch_ivr_collect_digits_count(session, buf, sizeof(buf)-1, 1, fifo_consumer_wrapup_key, &terminator, 0, 0, 0);
+						if (terminator == *fifo_consumer_wrapup_key) {
+							break;
+						}
+					}
 				}
 			}
 

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Tue Mar 25 14:48:20 2008
@@ -1828,8 +1828,9 @@
 		}
 		break;
 	case nua_callstate_ready:
-		switch_channel_clear_flag(channel, CF_REQ_MEDIA);
-
+		if (channel) {
+			switch_channel_clear_flag(channel, CF_REQ_MEDIA);
+		}
 		if (tech_pvt && nh == tech_pvt->nh2) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Cheater Reinvite!\n");
 			switch_set_flag_locked(tech_pvt, TFLAG_REINVITE);

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	Tue Mar 25 14:48:20 2008
@@ -222,8 +222,9 @@
 #endif
 	}
 
-	if (switch_test_flag(tech_pvt, TFLAG_VIDEO)) {							
-		if (!tech_pvt->local_sdp_video_port) {
+	if (switch_test_flag(tech_pvt, TFLAG_VIDEO)) {
+		if (!switch_channel_test_flag(tech_pvt->channel, CF_ANSWERED) && !switch_channel_test_flag(tech_pvt->channel, CF_EARLY_MEDIA) && 
+			!tech_pvt->local_sdp_video_port) {
 			sofia_glue_tech_choose_video_port(tech_pvt);
 		}
 



More information about the Freeswitch-svn mailing list