From 061a399af90e619178e742deef1a4740eeeb15f0 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Thu, 21 Jan 2010 02:34:06 +0000 Subject: [PATCH] FSCORE-531 + fix bogus UNPROTECT_INTERFACE git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16427 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_ivr_originate.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index e5fd8c6ebf..736726cc6a 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -142,6 +142,7 @@ static void *SWITCH_THREAD_FUNC collect_thread_run(switch_thread_t *thread, void switch_channel_t *channel = switch_core_session_get_channel(collect->session); char buf[10] = SWITCH_BLANK_STRING; char *p, term; + switch_application_interface_t *application_interface = NULL; if (collect->session) { if (switch_core_session_read_lock(collect->session) != SWITCH_STATUS_SUCCESS) { @@ -155,7 +156,6 @@ static void *SWITCH_THREAD_FUNC collect_thread_run(switch_thread_t *thread, void if (!strcasecmp(collect->key, "exec")) { char *data; - switch_application_interface_t *application_interface; char *app_name, *app_data; if (!(data = collect->file)) { @@ -171,7 +171,6 @@ static void *SWITCH_THREAD_FUNC collect_thread_run(switch_thread_t *thread, void if ((application_interface = switch_loadable_module_get_application_interface(app_name)) == 0) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(collect->session), SWITCH_LOG_ERROR, "Invalid Application %s\n", app_name); switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); - UNPROTECT_INTERFACE(application_interface); goto wbreak; } @@ -198,10 +197,12 @@ static void *SWITCH_THREAD_FUNC collect_thread_run(switch_thread_t *thread, void memset(buf, 0, sizeof(buf)); if (collect->file) { + switch_status_t status; switch_input_args_t args = { 0 }; args.buf = buf; args.buflen = sizeof(buf); - if (switch_ivr_play_file(collect->session, NULL, collect->file, &args) != SWITCH_STATUS_SUCCESS) { + status = switch_ivr_play_file(collect->session, NULL, collect->file, &args); + if (!SWITCH_READ_ACCEPTABLE(status)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(collect->session), SWITCH_LOG_ERROR, "%s Error Playing File!", switch_channel_get_name(channel)); switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); } @@ -219,7 +220,7 @@ static void *SWITCH_THREAD_FUNC collect_thread_run(switch_thread_t *thread, void wbreak: switch_core_session_rwunlock(collect->session); - + UNPROTECT_INTERFACE(application_interface); return NULL; }