From 293d72548d9b2abde966378d1ef23113e4836bad Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 2 Mar 2011 13:01:25 -0600 Subject: [PATCH] add valet_announce_slot variable --- .../mod_valet_parking/mod_valet_parking.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/mod/applications/mod_valet_parking/mod_valet_parking.c b/src/mod/applications/mod_valet_parking/mod_valet_parking.c index 42ece97e28..14412bc318 100644 --- a/src/mod/applications/mod_valet_parking/mod_valet_parking.c +++ b/src/mod/applications/mod_valet_parking/mod_valet_parking.c @@ -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); + } }