]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix att xfer to an app
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 8 Oct 2009 18:09:06 +0000 (18:09 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 8 Oct 2009 18:09:06 +0000 (18:09 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15122 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_ivr.h
src/mod/applications/mod_commands/mod_commands.c
src/mod/endpoints/mod_sofia/sofia.c
src/switch_ivr.c

index efd9a3720ead6ee67971fb35f999c71374538d8b..a62d84d5503a4098459f1c20e99cdd4d228c2c3b 100644 (file)
@@ -802,6 +802,8 @@ SWITCH_DECLARE(switch_say_type_t) switch_ivr_get_say_type_by_name(const char *na
 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
index eee0ee82c47d4d9ac243ec0bbb362062da7d06b4..1ace74388b409b35a75671e4fafbaf6b05a6818d 100644 (file)
@@ -3267,18 +3267,14 @@ SWITCH_STANDARD_API(uuid_setvar_multi_function)
        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");
 
index cdd7698c2215808576c9e85636b65cd42b54df83..8c2e80e60f1f896a9e184eaf7642debb57fd84dc 100644 (file)
@@ -4247,6 +4247,14 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
                                                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;
 
index 52997dc06e2634a21093ca6b72380b36f9f6b55e..6c84a74a514975f7ba01469bca50d11015c673b6 100644 (file)
@@ -2244,6 +2244,20 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_set_user(switch_core_session_t *sessi
        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