From 2f2a19384762e40a3c6e2d1274161af34f884eb6 Mon Sep 17 00:00:00 2001 From: Rupa Schomaker Date: Fri, 20 Feb 2009 20:28:18 +0000 Subject: [PATCH] actually honor profile when used as a app git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12196 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_lcr/mod_lcr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mod/applications/mod_lcr/mod_lcr.c b/src/mod/applications/mod_lcr/mod_lcr.c index 0f46f85f87..ca74c265ab 100644 --- a/src/mod/applications/mod_lcr/mod_lcr.c +++ b/src/mod/applications/mod_lcr/mod_lcr.c @@ -763,10 +763,6 @@ SWITCH_STANDARD_APP(lcr_app_function) switch_core_new_memory_pool(&pool); } routes.pool = pool; - if (!(routes.profile = locate_profile(lcr_profile))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unknown profile: %s\n", lcr_profile); - goto end; - } if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { dest = argv[0]; @@ -774,8 +770,12 @@ SWITCH_STANDARD_APP(lcr_app_function) lcr_profile = argv[1]; } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "LCR Lookup on %s\n", dest); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "LCR Lookup on %s using profile %s\n", dest, lcr_profile); routes.lookup_number = dest; + if (!(routes.profile = locate_profile(lcr_profile))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unknown profile: %s\n", lcr_profile); + goto end; + } if (lcr_do_lookup(&routes, dest) == SWITCH_STATUS_SUCCESS) { for (cur_route = routes.head; cur_route; cur_route = cur_route->next) { switch_snprintf(vbuf, sizeof(vbuf), "lcr_route_%d", cnt++);