]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add i flag to bind_meta_app to do inline execute of the app (not wise to use unless...
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 24 Sep 2009 22:21:44 +0000 (22:21 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 24 Sep 2009 22:21:44 +0000 (22:21 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14969 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_types.h
src/mod/applications/mod_dptools/mod_dptools.c
src/switch_ivr_async.c

index 58b0b5d462ad4b9d7172cc12aa908f83eef22076..7113497a2837ee19e723b2e9b3ce5e416822acff 100644 (file)
@@ -194,7 +194,8 @@ typedef enum {
        SBF_EXEC_BLEG = (1 << 3),
        SBF_EXEC_OPPOSITE = (1 << 4),
        SBF_EXEC_SAME = (1 << 5),
-       SBF_ONCE = (1 << 6)
+       SBF_ONCE = (1 << 6),
+       SBF_EXEC_INLINE = (1 << 7)
 } switch_bind_flag_enum_t;
 typedef uint32_t switch_bind_flag_t;
 
@@ -318,7 +319,8 @@ typedef enum {
        SMF_FORCE = (1 << 3),
        SMF_LOOP = (1 << 4),
        SMF_HOLD_BLEG = (1 << 5),
-       SMF_IMMEDIATE = (1 << 6)
+       SMF_IMMEDIATE = (1 << 6),
+       SMF_EXEC_INLINE = (1 << 7)
 } switch_media_flag_enum_t;
 typedef uint32_t switch_media_flag_t;
 
index 5b180d0b60ffaa37753b2b6eec3103f646fe9e7c..c3d4ea1d545c2f105797c722f5ad51c6b37fb8bf 100644 (file)
@@ -198,7 +198,7 @@ SWITCH_STANDARD_APP(dtmf_unbind_function)
 
 }
 
-#define BIND_SYNTAX "<key> [a|b|ab] [a|b|o|s|1] <app>"
+#define BIND_SYNTAX "<key> [a|b|ab] [a|b|o|s|i|1] <app>"
 SWITCH_STANDARD_APP(dtmf_bind_function)
 {
        char *argv[4] = { 0 };
@@ -242,6 +242,10 @@ SWITCH_STANDARD_APP(dtmf_bind_function)
                        }
                }
 
+               if (strchr(argv[2], 'i')) {
+                       bind_flags |= SBF_EXEC_INLINE;
+               }
+
                if (strchr(argv[2], 'o')) {
                        if ((bind_flags & SBF_EXEC_BLEG) || (bind_flags & SBF_EXEC_ALEG) || (bind_flags & SBF_EXEC_SAME)) {
                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot bind execute to multiple legs\n");
index 627c5826acb985b2ba10eadae876a27a69add506..d25369305a1debd05a08888349b5d9c9a7b8892d 100644 (file)
@@ -2031,6 +2031,8 @@ static switch_status_t meta_on_dtmf(switch_core_session_t *session, const switch
                                        } else {
                                                flags |= SMF_ECHO_ALEG;
                                        }
+                               } else if ((md->sr[direction].map[dval].bind_flags & SBF_EXEC_INLINE)) {
+                                       flags |= SMF_EXEC_INLINE;
                                } else if ((md->sr[direction].map[dval].bind_flags & SBF_EXEC_ALEG)) {
                                        flags |= SMF_ECHO_ALEG;
                                } else if ((md->sr[direction].map[dval].bind_flags & SBF_EXEC_BLEG)) {
@@ -2684,7 +2686,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(const char *uuid, const cha
                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hold-bleg", "true");
                        }
 
-                       switch_core_session_queue_private_event(other_session, &event);
+                       if ((flags & SMF_EXEC_INLINE)) {
+                               switch_core_session_execute_application(other_session, app, path);
+                       } else {
+                               switch_core_session_queue_private_event(other_session, &event);
+                       }
                }
 
                switch_core_session_rwunlock(other_session);