]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3995 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 7 May 2012 16:41:47 +0000 (11:41 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 7 May 2012 16:41:54 +0000 (11:41 -0500)
src/include/switch_types.h
src/mod/applications/mod_dptools/mod_dptools.c

index 35ca619cbd47ec610403c724999b68c46fe3645a..93a2e48ced9eb69e826866c439b2707eaf7a1078 100644 (file)
@@ -129,6 +129,7 @@ SWITCH_BEGIN_EXTERN_C
 #define SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE "enable_heartbeat_events"
 #define SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE "bypass_media_after_bridge"
 #define SWITCH_READ_RESULT_VARIABLE "read_result"
+#define SWITCH_ATT_XFER_RESULT_VARIABLE "att_xfer_result"
 #define SWITCH_COPY_XML_CDR_VARIABLE "copy_xml_cdr"
 #define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application"
 #define SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE "proto_specific_hangup_cause"
index db259412b0b593794782f4cfcc84da9630f658a2..7005a701c554b46ee6ccd4602b5a3e1df2cf3420 100755 (executable)
@@ -2122,6 +2122,12 @@ static switch_status_t hanguphook(switch_core_session_t *session)
        return SWITCH_STATUS_SUCCESS;
 }
 
+
+static void att_xfer_set_result(switch_channel_t *channel, switch_status_t status)
+{
+       switch_channel_set_variable(channel, SWITCH_ATT_XFER_RESULT_VARIABLE, status == SWITCH_STATUS_SUCCESS ? "success" : "failure");
+}
+
 SWITCH_STANDARD_APP(att_xfer_function)
 {
        switch_core_session_t *peer_session = NULL;
@@ -2167,7 +2173,8 @@ SWITCH_STANDARD_APP(att_xfer_function)
 
                if (!switch_channel_down(peer_channel)) {
                        if (!switch_channel_ready(channel)) {
-                               switch_ivr_uuid_bridge(switch_core_session_get_uuid(peer_session), bond);
+                               switch_status_t status = switch_ivr_uuid_bridge(switch_core_session_get_uuid(peer_session), bond);
+                               att_xfer_set_result(peer_channel, status);
                                br++;
                        } else if ((b_session = switch_core_session_locate(bond))) {
                                switch_channel_t *b_channel = switch_core_session_get_channel(b_session);
@@ -2185,7 +2192,8 @@ SWITCH_STANDARD_APP(att_xfer_function)
                }
 
                if (!br) {
-                       switch_ivr_uuid_bridge(switch_core_session_get_uuid(session), bond);
+                       switch_status_t status = switch_ivr_uuid_bridge(switch_core_session_get_uuid(session), bond);
+                       att_xfer_set_result(channel, status);
                }
 
        }