提交 4d5ea559 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-5480 --resolve

上级 acc8eb5c
...@@ -1040,6 +1040,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_profile_var(switch_channel_t ...@@ -1040,6 +1040,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_profile_var(switch_channel_t
channel->caller_profile->chan_name = v; channel->caller_profile->chan_name = v;
} else { } else {
profile_node_t *pn, *n = switch_core_alloc(channel->caller_profile->pool, sizeof(*n)); profile_node_t *pn, *n = switch_core_alloc(channel->caller_profile->pool, sizeof(*n));
int var_found;
n->var = switch_core_strdup(channel->caller_profile->pool, name); n->var = switch_core_strdup(channel->caller_profile->pool, name);
n->val = v; n->val = v;
...@@ -1047,9 +1048,21 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_profile_var(switch_channel_t ...@@ -1047,9 +1048,21 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_profile_var(switch_channel_t
if (!channel->caller_profile->soft) { if (!channel->caller_profile->soft) {
channel->caller_profile->soft = n; channel->caller_profile->soft = n;
} else { } else {
for(pn = channel->caller_profile->soft; pn && pn->next; pn = pn->next); var_found = 0;
if (pn) { for(pn = channel->caller_profile->soft; pn ; pn = pn->next) {
if (!strcasecmp(pn->var,n->var)) {
pn->val = n->val;
var_found = 1;
break;
}
if(!pn->next) {
break;
}
}
if (pn && !pn->next && !var_found) {
pn->next = n; pn->next = n;
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论