From 63b7f1cac97909292f15d7b31266e5cf8d4e6519 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 25 Mar 2008 15:14:05 +0000 Subject: [PATCH] un revert stuff from r7958 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7960 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_fifo/mod_fifo.c | 32 ++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index c2c72a5f32..4f1f9c0348 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -337,7 +337,10 @@ SWITCH_STANDARD_APP(fifo_function) int custom_pop = 0; int pop_array[MAX_PRI] = { 0 }; char *pop_list[MAX_PRI] = { 0 }; - + const char *fifo_consumer_wrapup_sound = NULL; + const char *fifo_consumer_wrapup_key = NULL; + char buf[5] = ""; + if (argc > 3) { announce = argv[3]; } @@ -388,6 +391,8 @@ SWITCH_STANDARD_APP(fifo_function) while(switch_channel_ready(channel)) { int x = 0 ; + pop = NULL; + if (moh) { args.read_frame_callback = read_frame_callback; args.user_data = node; @@ -423,6 +428,7 @@ SWITCH_STANDARD_APP(fifo_function) } uuid = (char *) pop; + pop = NULL; if ((other_session = switch_core_session_locate(uuid))) { switch_channel_t *other_channel = switch_core_session_get_channel(other_session); @@ -505,7 +511,29 @@ SWITCH_STANDARD_APP(fifo_function) if (nowait) { done = 1; } - } + + fifo_consumer_wrapup_sound = switch_channel_get_variable(channel, "fifo_consumer_wrapup_sound"); + fifo_consumer_wrapup_key = switch_channel_get_variable(channel, "fifo_consumer_wrapup_key"); + memset(buf, 0, sizeof(buf)); + + if (!switch_strlen_zero(fifo_consumer_wrapup_sound)) { + args.buf = buf; + args.buflen = sizeof(buf); + + memset(&args, 0, sizeof(args)); + switch_ivr_play_file(session, NULL, fifo_consumer_wrapup_sound, &args); + } + + if (!switch_strlen_zero(fifo_consumer_wrapup_key) && strcmp(buf, fifo_consumer_wrapup_key)) { + for(;;) { + char terminator = 0; + switch_ivr_collect_digits_count(session, buf, sizeof(buf)-1, 1, fifo_consumer_wrapup_key, &terminator, 0, 0, 0); + if (terminator == *fifo_consumer_wrapup_key) { + break; + } + } + } + } switch_safe_free(uuid);