Revision
15122
Author
anthm
Date
2009-10-08 13:09:06 -0500 (Thu, 08 Oct 2009)

Log Message

fix att xfer to an app

Modified Paths

Diff

Modified: freeswitch/trunk/src/include/switch_ivr.h (15121 => 15122)


--- freeswitch/trunk/src/include/switch_ivr.h	2009-10-08 17:43:51 UTC (rev 15121)
+++ freeswitch/trunk/src/include/switch_ivr.h	2009-10-08 18:09:06 UTC (rev 15122)
@@ -802,6 +802,8 @@
 SWITCH_DECLARE(switch_status_t) switch_ivr_set_user(switch_core_session_t *session, const char *data);
 SWITCH_DECLARE(switch_status_t) switch_ivr_sound_test(switch_core_session_t *session);
 SWITCH_DECLARE(void) switch_process_import(switch_core_session_t *session, switch_channel_t *peer_channel, const char *varname);
+SWITCH_DECLARE(switch_bool_t) switch_ivr_uuid_exists(const char *uuid);
+
 /** @} */
 
 SWITCH_END_EXTERN_C

Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (15121 => 15122)


--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	2009-10-08 17:43:51 UTC (rev 15121)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	2009-10-08 18:09:06 UTC (rev 15122)
@@ -3267,19 +3267,15 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-#define EXISTS_SYNTAX "<uuid> <var>"
+#define EXISTS_SYNTAX "<uuid>"
 SWITCH_STANDARD_API(uuid_exists_function)
 {
-	int exists = 0;
-	
-    if (cmd) {
-		switch_core_session_t *psession = NULL;
-		if ((psession = switch_core_session_locate(cmd))) {
-			switch_core_session_rwunlock(psession);
-			exists = 1;
-		}
-    }
+	switch_bool_t exists = SWITCH_FALSE;
 
+	if (cmd) {
+		exists = switch_ivr_uuid_exists(cmd);
+	}
+
 	stream->write_function(stream, "%s", exists ? "true" : "false");
 
 	return SWITCH_STATUS_SUCCESS;

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (15121 => 15122)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-10-08 17:43:51 UTC (rev 15121)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-10-08 18:09:06 UTC (rev 15122)
@@ -4247,6 +4247,14 @@
 						br_a = switch_channel_get_variable(channel_a, SWITCH_SIGNAL_BOND_VARIABLE);
 						br_b = switch_channel_get_variable(channel_b, SWITCH_SIGNAL_BOND_VARIABLE);
 						
+						if (!switch_ivr_uuid_exists(br_a)) {
+							br_a = NULL;
+						}
+
+						if (!switch_ivr_uuid_exists(br_b)) {
+							br_b = NULL;
+						}
+						
 						if (switch_channel_test_flag(channel_b, CF_ORIGINATOR)) {
 							switch_core_session_t *a_session;
 

Modified: freeswitch/trunk/src/switch_ivr.c (15121 => 15122)


--- freeswitch/trunk/src/switch_ivr.c	2009-10-08 17:43:51 UTC (rev 15121)
+++ freeswitch/trunk/src/switch_ivr.c	2009-10-08 18:09:06 UTC (rev 15122)
@@ -2244,6 +2244,20 @@
 	return status;
 }
 
+SWITCH_DECLARE(switch_bool_t) switch_ivr_uuid_exists(const char *uuid)
+{
+	switch_bool_t exists = SWITCH_FALSE;
+	switch_core_session_t *psession = NULL;
+
+	if ((psession = switch_core_session_locate(uuid))) {
+		switch_core_session_rwunlock(psession);
+		exists = 1;
+	}
+
+	return exists;
+}
+
+
 /* For Emacs:
  * Local Variables:
  * mode:c