Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch-contrib
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch-contrib
Commits
f2aae049
提交
f2aae049
authored
7月 18, 2013
作者:
Emmanuel Schmidbauer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
changes to profile enum result
上级
394267b8
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
20 行增加
和
25 行删除
+20
-25
mod_voicemail_originate.c
...idbauer/mod_voicemail_originate/mod_voicemail_originate.c
+20
-25
没有找到文件。
eschmidbauer/mod_voicemail_originate/mod_voicemail_originate.c
浏览文件 @
f2aae049
...
...
@@ -130,17 +130,12 @@ struct call_helper {
};
typedef
enum
{
VM_ORIGINATE_STATUS_SUCCESS
,
VM_ORIGINATE_STATUS_FAIL
,
VM_ORIGINATE_CANNOT_MODIFY
,
VM_ORIGINATE_USER_NOT_EXIST
,
VM_ORIGINATE_USER_EXISTS
,
VM_ORIGINATE_INVALID_KEY
,
VM_ORIGINATE_INVALID_VALUE_BOOL
,
VM_ORIGINATE_INVALID_PROFILE
,
VM_ORIGINATE_INVALID_PROFILE_NOT_FOUND
,
VM_ORIGINATE_PROFILE_INUSE
}
vm_originate_status_t
;
PROFILE_STATUS_SUCCESS
,
PROFILE_STATUS_FAIL
,
PROFILE_STATUS_FAIL_INUSE
,
PROFILE_STATUS_INVALID
,
PROFILE_STATUS_INVALID_NOT_FOUND
}
vm_originate_profile_status_t
;
switch_time_t
local_epoch_time_now
(
switch_time_t
*
t
)
{
...
...
@@ -403,10 +398,10 @@ static void profile_rwunlock(config_profile_t *profile)
}
}
vm_originate_status_t
destroy_profile
(
const
char
*
profile_name
,
switch_bool_t
block
)
vm_originate_
profile_
status_t
destroy_profile
(
const
char
*
profile_name
,
switch_bool_t
block
)
{
config_profile_t
*
profile
=
NULL
;
vm_originate_
status_t
result
=
VM_ORIGINAT
E_STATUS_SUCCESS
;
vm_originate_
profile_status_t
result
=
PROFIL
E_STATUS_SUCCESS
;
switch_mutex_lock
(
globals
.
mutex
);
if
((
profile
=
switch_core_hash_find
(
globals
.
profile_hash
,
profile_name
)))
{
switch_core_hash_delete
(
globals
.
profile_hash
,
profile_name
);
...
...
@@ -414,7 +409,7 @@ vm_originate_status_t destroy_profile(const char *profile_name, switch_bool_t bl
switch_mutex_unlock
(
globals
.
mutex
);
if
(
!
profile
)
{
result
=
VM_ORIGINATE_INVALID_PROFILE
;
result
=
PROFILE_STATUS_INVALID
;
return
result
;
}
...
...
@@ -424,7 +419,7 @@ vm_originate_status_t destroy_profile(const char *profile_name, switch_bool_t bl
}
else
{
if
(
switch_thread_rwlock_trywrlock
(
profile
->
rwlock
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_set_flag
(
profile
,
PFLAG_DESTROY
);
result
=
VM_ORIGINATE_PROFILE
_INUSE
;
result
=
PROFILE_STATUS_FAIL
_INUSE
;
return
result
;
}
}
...
...
@@ -929,7 +924,7 @@ SWITCH_STANDARD_API(vm_originate_function)
char
*
mydata
=
NULL
,
*
argv
[
2
]
=
{
0
};
const
char
*
action
=
NULL
;
const
char
*
account
=
NULL
;
vm_originate_
status_t
api_result
=
VM_ORIGINAT
E_STATUS_SUCCESS
;
vm_originate_
profile_status_t
profile_api_result
=
PROFIL
E_STATUS_SUCCESS
;
int
argc
;
if
(
!
globals
.
running
)
{
...
...
@@ -966,34 +961,34 @@ SWITCH_STANDARD_API(vm_originate_function)
if
((
profile
=
get_profile
(
account
)))
{
profile_rwunlock
(
profile
);
}
else
{
api_result
=
VM_ORIGINATE_INVALID_PROFILE
_NOT_FOUND
;
profile_api_result
=
PROFILE_STATUS_INVALID
_NOT_FOUND
;
}
}
else
if
(
action
&&
!
strcasecmp
(
action
,
"unload"
))
{
api_result
=
destroy_profile
(
account
,
SWITCH_FALSE
);
profile_
api_result
=
destroy_profile
(
account
,
SWITCH_FALSE
);
}
else
if
(
action
&&
!
strcasecmp
(
action
,
"reload"
))
{
config_profile_t
*
profile
=
NULL
;
destroy_profile
(
account
,
SWITCH_FALSE
);
if
((
profile
=
get_profile
(
account
)))
{
profile_rwunlock
(
profile
);
}
else
{
api_result
=
VM_ORIGINATE_INVALID_PROFILE
_NOT_FOUND
;
profile_api_result
=
PROFILE_STATUS_INVALID
_NOT_FOUND
;
}
}
switch
(
api_result
)
{
case
VM_ORIGINAT
E_STATUS_SUCCESS
:
switch
(
profile_
api_result
)
{
case
PROFIL
E_STATUS_SUCCESS
:
stream
->
write_function
(
stream
,
"%s"
,
"+OK
\n
"
);
break
;
case
VM_ORIGINAT
E_STATUS_FAIL
:
case
PROFIL
E_STATUS_FAIL
:
stream
->
write_function
(
stream
,
"%s"
,
"-ERR Failed
\n
"
);
break
;
case
VM_ORIGINATE_INVALID_PROFILE
:
case
PROFILE_STATUS_INVALID
:
stream
->
write_function
(
stream
,
"[%s] %s"
,
account
,
"-ERR Invalid profile
\n
"
);
break
;
case
VM_ORIGINATE_PROFILE
_INUSE
:
case
PROFILE_STATUS_FAIL
_INUSE
:
stream
->
write_function
(
stream
,
"[%s] %s"
,
account
,
"-ERR Profile is in use, memory will be freed whenever its no longer in use
\n
"
);
break
;
case
VM_ORIGINATE_INVALID_PROFILE
_NOT_FOUND
:
case
PROFILE_STATUS_INVALID
_NOT_FOUND
:
stream
->
write_function
(
stream
,
"[%s] %s"
,
account
,
"-ERR Invalid, profile not found!
\n
"
);
break
;
default
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论