]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add valet_announce_slot variable
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 2 Mar 2011 19:01:25 +0000 (13:01 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 2 Mar 2011 19:01:25 +0000 (13:01 -0600)
src/mod/applications/mod_valet_parking/mod_valet_parking.c

index 42ece97e28bf5a52a0f78a8ab804d017ea378876..14412bc318c8ec68858caaa8d10cb96cea8bfbe2 100644 (file)
@@ -114,7 +114,13 @@ SWITCH_STANDARD_APP(valet_parking_function)
        switch_channel_t *channel = switch_core_session_get_channel(session);
        switch_event_t *event;
        char dtmf_buf[128] = "";
-       int is_auto = 0;
+       int is_auto = 0, play_announce = 1;
+       const char *var;
+
+
+       if ((var = switch_channel_get_variable(channel, "valet_announce_slot"))) {
+               play_announce = switch_true(var);
+       }
 
        if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
                && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 2) {
@@ -254,7 +260,9 @@ SWITCH_STANDARD_APP(valet_parking_function)
                                switch_core_session_t *b_session;
 
                                if ((b_session = switch_core_session_locate(uuid))) {
-                                       switch_ivr_phrase_macro(session, "valet_announce_ext", tmp, NULL, NULL);
+                                       if (play_announce) {
+                                               switch_ivr_phrase_macro(session, "valet_announce_ext", tmp, NULL, NULL);
+                                       }
                                        switch_ivr_session_transfer(b_session, dest, "inline", NULL);
                                        switch_mutex_unlock(lot->mutex);
                                        switch_core_session_rwunlock(b_session);
@@ -263,7 +271,9 @@ SWITCH_STANDARD_APP(valet_parking_function)
                                }
                        }
 
-                       switch_ivr_phrase_macro(session, "valet_announce_ext", tmp, NULL, NULL);
+                       if (play_announce) {
+                               switch_ivr_phrase_macro(session, "valet_announce_ext", tmp, NULL, NULL);
+                       }
                }