SCF_API_EXPANSION = (1 << 22),
SCF_SESSION_THREAD_POOL = (1 << 23),
SCF_DIALPLAN_TIMESTAMPS = (1 << 24),
- SCF_CPF_SOFT_PREFIX = (1 << 25)
+ SCF_CPF_SOFT_PREFIX = (1 << 25),
+ SCF_CPF_SOFT_LOOKUP = (1 << 26)
} switch_core_flag_enum_t;
typedef uint32_t switch_core_flag_t;
SWITCH_CPF_SCREEN = (1 << 0),
SWITCH_CPF_HIDE_NAME = (1 << 1),
SWITCH_CPF_HIDE_NUMBER = (1 << 2),
- SWITCH_CPF_SOFT_PREFIX = (1 << 3)
+ SWITCH_CPF_SOFT_PREFIX = (1 << 3),
+ SWITCH_CPF_SOFT_LOOKUP = (1 << 4)
} switch_caller_profile_flag_enum_t;
typedef uint32_t switch_caller_profile_flag_t;
if (switch_core_test_flag(SCF_CPF_SOFT_PREFIX)) {
switch_set_flag(profile, SWITCH_CPF_SOFT_PREFIX);
}
+ if (switch_core_test_flag(SCF_CPF_SOFT_LOOKUP)) {
+ switch_set_flag(profile, SWITCH_CPF_SOFT_LOOKUP);
+ }
profile->pool = pool;
return profile;
}
return switch_core_sprintf(caller_profile->pool, "%" SWITCH_TIME_T_FMT, caller_profile->times->transferred);
}
+ if (caller_profile->soft && switch_test_flag(caller_profile, SWITCH_CPF_SOFT_LOOKUP)) {
+ profile_node_t *pn;
+ for (pn = caller_profile->soft; pn; pn = pn->next) {
+ if (!strcasecmp(name, pn->var)) {
+ return pn->val;
+ }
+ }
+ }
return NULL;
}
} else {
switch_clear_flag((&runtime), SCF_CPF_SOFT_PREFIX);
}
+ } else if (!strcasecmp(var, "caller-profile-soft-lookup-values") && !zstr(val)) {
+ int v = switch_true(val);
+ if (v) {
+ switch_set_flag((&runtime), SCF_CPF_SOFT_LOOKUP);
+ } else {
+ switch_clear_flag((&runtime), SCF_CPF_SOFT_LOOKUP);
+ }
}
}
}