]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
actually honor profile when used as a app
authorRupa Schomaker <rupa@rupa.com>
Fri, 20 Feb 2009 20:28:18 +0000 (20:28 +0000)
committerRupa Schomaker <rupa@rupa.com>
Fri, 20 Feb 2009 20:28:18 +0000 (20:28 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12196 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_lcr/mod_lcr.c

index 0f46f85f87c394bfb5bd14d0b00a0cf5395a49f3..ca74c265abf6209511c0fe5d55e48c14dfe677e1 100644 (file)
@@ -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++);