Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
726b6076
提交
726b6076
authored
11月 22, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-5841 --resolve
上级
4129adc9
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
44 行增加
和
26 行删除
+44
-26
mod_voicemail.c
src/mod/applications/mod_voicemail/mod_voicemail.c
+4
-4
switch_xml.c
src/switch_xml.c
+40
-22
没有找到文件。
src/mod/applications/mod_voicemail/mod_voicemail.c
浏览文件 @
726b6076
...
...
@@ -1724,7 +1724,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
switch_event_create
(
&
my_params
,
SWITCH_EVENT_REQUEST_PARAMS
);
switch_assert
(
my_params
);
status
=
switch_xml_locate_user_merged
(
"id"
,
vm_cc
,
cbt
->
domain
,
NULL
,
&
x_user
,
my_params
);
status
=
switch_xml_locate_user_merged
(
"id
:number-alias
"
,
vm_cc
,
cbt
->
domain
,
NULL
,
&
x_user
,
my_params
);
switch_event_destroy
(
&
my_params
);
if
(
status
!=
SWITCH_STATUS_SUCCESS
)
{
...
...
@@ -2440,7 +2440,7 @@ static void voicemail_check_main(switch_core_session_t *session, vm_profile_t *p
switch_event_add_header_string
(
params
,
SWITCH_STACK_BOTTOM
,
"destination_number"
,
caller_profile
->
destination_number
);
switch_event_add_header_string
(
params
,
SWITCH_STACK_BOTTOM
,
"caller_id_number"
,
caller_id_number
);
if
(
switch_xml_locate_user_merged
(
"id"
,
myid
,
domain_name
,
switch_channel_get_variable
(
channel
,
"network_addr"
),
if
(
switch_xml_locate_user_merged
(
"id
:number-alias
"
,
myid
,
domain_name
,
switch_channel_get_variable
(
channel
,
"network_addr"
),
&
x_user
,
params
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_WARNING
,
"Can't find user [%s@%s]
\n
"
,
myid
,
domain_name
);
ok
=
0
;
...
...
@@ -3388,7 +3388,7 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
switch_assert
(
locate_params
);
switch_event_add_header_string
(
locate_params
,
SWITCH_STACK_BOTTOM
,
"action"
,
"voicemail-lookup"
);
if
(
switch_xml_locate_user_merged
(
"id"
,
id
,
domain_name
,
switch_channel_get_variable
(
channel
,
"network_addr"
),
if
(
switch_xml_locate_user_merged
(
"id
:number-alias
"
,
id
,
domain_name
,
switch_channel_get_variable
(
channel
,
"network_addr"
),
&
x_user
,
locate_params
)
==
SWITCH_STATUS_SUCCESS
)
{
id
=
switch_core_session_strdup
(
session
,
switch_xml_attr
(
x_user
,
"id"
));
...
...
@@ -5689,7 +5689,7 @@ SWITCH_STANDARD_API(vm_fsdb_auth_login_function)
}
switch_event_create
(
&
params
,
SWITCH_EVENT_GENERAL
);
if
(
switch_xml_locate_user_merged
(
"id"
,
id
,
domain
,
NULL
,
&
x_user
,
params
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_xml_locate_user_merged
(
"id
:number-alias
"
,
id
,
domain
,
NULL
,
&
x_user
,
params
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_WARNING
,
"Can't find user [%s@%s]
\n
"
,
id
,
domain
);
stream
->
write_function
(
stream
,
"-ERR User not found
\n
"
);
}
else
{
...
...
src/switch_xml.c
浏览文件 @
726b6076
...
...
@@ -2044,34 +2044,52 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_merged(const char *key, c
{
switch_xml_t
xml
,
domain
,
group
,
x_user
,
x_user_dup
;
switch_status_t
status
=
SWITCH_STATUS_FALSE
;
char
*
kdup
=
NULL
;
char
*
keys
[
10
]
=
{
0
};
int
i
,
nkeys
;
if
((
status
=
switch_xml_locate_user_cache
(
key
,
user_name
,
domain_name
,
&
x_user
))
==
SWITCH_STATUS_SUCCESS
)
{
*
user
=
x_user
;
}
else
if
((
status
=
switch_xml_locate_user
(
key
,
user_name
,
domain_name
,
ip
,
&
xml
,
&
domain
,
&
x_user
,
&
group
,
params
))
==
SWITCH_STATUS_SUCCESS
)
{
const
char
*
cacheable
=
NULL
;
x_user_dup
=
switch_xml_dup
(
x_user
);
switch_xml_merge_user
(
x_user_dup
,
domain
,
group
);
cacheable
=
switch_xml_attr
(
x_user_dup
,
"cacheable"
);
if
(
switch_true
(
cacheable
))
{
switch_time_t
expires
=
0
;
switch_time_t
time_now
=
0
;
if
(
strchr
(
key
,
':'
))
{
kdup
=
strdup
(
key
);
nkeys
=
switch_split
(
kdup
,
':'
,
keys
);
}
else
{
keys
[
0
]
=
(
char
*
)
key
;
nkeys
=
1
;
}
if
(
switch_is_number
(
cacheable
))
{
int
cache_ms
=
atol
(
cacheable
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"caching lookup for user %s@%s for %d milliseconds
\n
"
,
user_name
,
domain_name
,
cache_ms
);
time_now
=
switch_micro_time_now
();
expires
=
time_now
+
(
cache_ms
*
1000
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"caching lookup for user %s@%s indefinitely
\n
"
,
user_name
,
domain_name
);
for
(
i
=
0
;
i
<
nkeys
;
i
++
)
{
if
((
status
=
switch_xml_locate_user_cache
(
keys
[
i
],
user_name
,
domain_name
,
&
x_user
))
==
SWITCH_STATUS_SUCCESS
)
{
*
user
=
x_user
;
break
;
}
else
if
((
status
=
switch_xml_locate_user
(
keys
[
i
],
user_name
,
domain_name
,
ip
,
&
xml
,
&
domain
,
&
x_user
,
&
group
,
params
))
==
SWITCH_STATUS_SUCCESS
)
{
const
char
*
cacheable
=
NULL
;
x_user_dup
=
switch_xml_dup
(
x_user
);
switch_xml_merge_user
(
x_user_dup
,
domain
,
group
);
cacheable
=
switch_xml_attr
(
x_user_dup
,
"cacheable"
);
if
(
switch_true
(
cacheable
))
{
switch_time_t
expires
=
0
;
switch_time_t
time_now
=
0
;
if
(
switch_is_number
(
cacheable
))
{
int
cache_ms
=
atol
(
cacheable
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"caching lookup for user %s@%s for %d milliseconds
\n
"
,
user_name
,
domain_name
,
cache_ms
);
time_now
=
switch_micro_time_now
();
expires
=
time_now
+
(
cache_ms
*
1000
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"caching lookup for user %s@%s indefinitely
\n
"
,
user_name
,
domain_name
);
}
switch_xml_user_cache
(
keys
[
i
],
user_name
,
domain_name
,
x_user_dup
,
expires
);
}
switch_xml_user_cache
(
key
,
user_name
,
domain_name
,
x_user_dup
,
expires
);
*
user
=
x_user_dup
;
switch_xml_free
(
xml
);
break
;
}
*
user
=
x_user_dup
;
switch_xml_free
(
xml
);
}
switch_safe_free
(
kdup
);
return
status
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论