FS-5185 --resolve

This commit is contained in:
Jeff Lenk 2013-03-22 08:40:45 -05:00
parent 65ba846a30
commit 5406fb8a11
1 changed files with 16 additions and 22 deletions

View File

@ -3869,37 +3869,31 @@ static void actual_message_query_handler(switch_event_t *event)
char *id, *domain; char *id, *domain;
dup = strdup(account); dup = strdup(account);
id = dup;
if (!strncasecmp(account, "sip:", 4)) { switch_split_user_domain(dup, &id, &domain);
id += 4;
}
if (!id) { if (!id || !domain) {
free(dup); free(dup);
return; return;
} }
if ((domain = strchr(id, '@'))) { profile = NULL;
*domain++ = '\0';
profile = NULL;
if (globals.message_query_exact_match) { if (globals.message_query_exact_match) {
if ((profile = (vm_profile_t *) switch_core_hash_find(globals.profile_hash, domain))) { if ((profile = (vm_profile_t *) switch_core_hash_find(globals.profile_hash, domain))) {
parse_profile(); parse_profile();
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"Cound not find a profile for domain: [%s] Returning 0 messages\nWhen message-query-exact-match is enabled you must have a dedicated vm profile per distinct domain name you wish to use.\n", domain);
}
} else { } else {
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
switch_hash_this(hi, NULL, NULL, &val); "Cound not find a profile for domain: [%s] Returning 0 messages\nWhen message-query-exact-match is enabled you must have a dedicated vm profile per distinct domain name you wish to use.\n", domain);
profile = (vm_profile_t *) val; }
parse_profile(); } else {
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, NULL, NULL, &val);
profile = (vm_profile_t *) val;
parse_profile();
if (new_event) { if (new_event) {
break; break;
}
} }
} }
} }