Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d544c065
提交
d544c065
authored
12月 26, 2011
作者:
Marc Olivier Chouinard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mod_voicemail_ivr: Fixed issue in settings system. Added initials settings.
上级
f2cba2aa
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
180 行增加
和
115 行删除
+180
-115
voicemail_ivr.conf.xml
conf/autoload_configs/voicemail_ivr.conf.xml
+12
-8
config.c
src/mod/applications/mod_voicemail_ivr/config.c
+46
-30
config.h
src/mod/applications/mod_voicemail_ivr/config.h
+2
-0
menu.c
src/mod/applications/mod_voicemail_ivr/menu.c
+116
-70
utils.c
src/mod/applications/mod_voicemail_ivr/utils.c
+2
-3
utils.h
src/mod/applications/mod_voicemail_ivr/utils.h
+2
-4
没有找到文件。
conf/autoload_configs/voicemail_ivr.conf.xml
浏览文件 @
d544c065
<configuration
name=
"voicemail_ivr.conf"
description=
"Voicemail IVR"
>
<profiles>
<profile
name=
"default"
>
<!-- Not yet implemented - Open for comments
<settings>
<param name="record-format" value="wav"/>
<param name="record-rate" value="8000"/>
<param
name=
"IVR-Maximum-Attempts"
value=
"3"
/>
<param
name=
"IVR-Entry-Timeout"
value=
"3"
/>
<param
name=
"Record-Format"
value=
"wav"
/>
<!--<param name="Record-Sample-Rate" value="8000" />-->
<param
name=
"Record-Silence-Hits"
value=
"4"
/>
<param
name=
"Record-Silence-Threshold"
value=
"200"
/>
<param
name=
"Record-Maximum-Length"
value=
"30"
/>
<param
name=
"Exit-Purge"
value=
"true"
/>
<param
name=
"Password-Mask"
value=
"XXX."
/>
<param
name=
"User-Mask"
value=
"X."
/>
</settings>
-->
<apis>
<api
name=
"auth_login"
value=
"vm_fsdb_auth_login"
/>
<api
name=
"msg_list"
value=
"vm_fsdb_msg_list"
/>
...
...
@@ -64,12 +71,9 @@
</menu>
<menu
name=
"std_navigator"
>
<!-- Not yet implemented - Open for comments
This will inherit the settings from the top profile settings. So if it global, put it inside the profile <settings>
<settings>
<
param name="playback-order" value="newest-first" /
>
<
!--<param name="Nav-Action-On-Delete" value="next_msg" />--
>
</settings>
-->
<phrases>
<phrase
name=
"msg_count"
value=
"message_count@voicemail_ivr"
/>
<phrase
name=
"say_date"
value=
"say_date_event@voicemail_ivr"
/>
...
...
src/mod/applications/mod_voicemail_ivr/config.c
浏览文件 @
d544c065
...
...
@@ -52,12 +52,14 @@ void menu_init(vmivr_profile_t *profile, vmivr_menu_t *menu) {
goto
end
;
}
if
(
profile
->
event_settings
&&
menu
->
event_settings
)
{
if
(
profile
->
event_settings
)
{
/* TODO Replace this with a switch_event_merge_not_set(...) */
switch_event_t
*
menu_default
;
switch_event_create
(
&
menu_default
,
SWITCH_EVENT_REQUEST_PARAMS
);
switch_event_merge
(
menu_default
,
menu
->
event_settings
);
switch_event_destroy
(
&
menu
->
event_settings
);
if
(
menu
->
event_settings
)
{
switch_event_merge
(
menu_default
,
menu
->
event_settings
);
switch_event_destroy
(
&
menu
->
event_settings
);
}
switch_event_create
(
&
menu
->
event_settings
,
SWITCH_EVENT_REQUEST_PARAMS
);
switch_event_merge
(
menu
->
event_settings
,
profile
->
event_settings
);
...
...
@@ -65,6 +67,12 @@ void menu_init(vmivr_profile_t *profile, vmivr_menu_t *menu) {
switch_event_destroy
(
&
menu_default
);
}
{
const
char
*
s_max_attempts
=
switch_event_get_header
(
menu
->
event_settings
,
"IVR-Maximum-Attempts"
);
const
char
*
s_entry_timeout
=
switch_event_get_header
(
menu
->
event_settings
,
"IVR-Entry-Timeout"
);
menu
->
ivr_maximum_attempts
=
atoi
(
s_max_attempts
);
menu
->
ivr_entry_timeout
=
atoi
(
s_entry_timeout
);
}
if
((
x_profile
=
switch_xml_find_child
(
x_profiles
,
"profile"
,
"name"
,
profile
->
name
)))
{
if
((
x_menus
=
switch_xml_child
(
x_profile
,
"menus"
)))
{
...
...
@@ -127,38 +135,36 @@ void menu_free(vmivr_menu_t *menu) {
static
void
append_event_profile
(
vmivr_menu_t
*
menu
)
{
if
(
!
menu
->
phrase_params
)
{
switch_event_create
(
&
menu
->
phrase_params
,
SWITCH_EVENT_REQUEST_PARAMS
);
}
if
(
!
menu
->
phrase_params
)
{
switch_event_create
(
&
menu
->
phrase_params
,
SWITCH_EVENT_REQUEST_PARAMS
);
}
/* Used for some appending function */
if
(
menu
->
profile
&&
menu
->
profile
->
name
&&
menu
->
profile
->
id
&&
menu
->
profile
->
domain
)
{
switch_event_add_header
(
menu
->
phrase_params
,
SWITCH_STACK_BOTTOM
,
"VM-Profile"
,
"%s"
,
menu
->
profile
->
name
);
switch_event_add_header
(
menu
->
phrase_params
,
SWITCH_STACK_BOTTOM
,
"VM-Account-ID"
,
"%s"
,
menu
->
profile
->
id
);
switch_event_add_header
(
menu
->
phrase_params
,
SWITCH_STACK_BOTTOM
,
"VM-Account-Domain"
,
"%s"
,
menu
->
profile
->
domain
);
}
/* Used for some appending function */
if
(
menu
->
profile
&&
menu
->
profile
->
name
&&
menu
->
profile
->
id
&&
menu
->
profile
->
domain
)
{
switch_event_add_header
(
menu
->
phrase_params
,
SWITCH_STACK_BOTTOM
,
"VM-Profile"
,
"%s"
,
menu
->
profile
->
name
);
switch_event_add_header
(
menu
->
phrase_params
,
SWITCH_STACK_BOTTOM
,
"VM-Account-ID"
,
"%s"
,
menu
->
profile
->
id
);
switch_event_add_header
(
menu
->
phrase_params
,
SWITCH_STACK_BOTTOM
,
"VM-Account-Domain"
,
"%s"
,
menu
->
profile
->
domain
);
}
}
static
void
populate_dtmfa_from_event
(
vmivr_menu_t
*
menu
)
{
int
i
=
0
;
if
(
menu
->
event_keys_dtmf
)
{
switch_event_header_t
*
hp
;
for
(
hp
=
menu
->
event_keys_dtmf
->
headers
;
hp
;
hp
=
hp
->
next
)
{
if
(
strlen
(
hp
->
name
)
<
3
&&
hp
->
value
)
{
/* TODO This is a hack to discard default FS Events ! */
const
char
*
varphrasename
=
switch_event_get_header
(
menu
->
event_keys_varname
,
hp
->
value
);
menu
->
dtmfa
[
i
++
]
=
hp
->
name
;
if
(
varphrasename
&&
!
zstr
(
varphrasename
))
{
switch_event_add_header
(
menu
->
phrase_params
,
SWITCH_STACK_BOTTOM
,
varphrasename
,
"%s"
,
hp
->
name
);
}
}
}
}
menu
->
dtmfa
[
i
++
]
=
'\0'
;
int
i
=
0
;
if
(
menu
->
event_keys_dtmf
)
{
switch_event_header_t
*
hp
;
}
for
(
hp
=
menu
->
event_keys_dtmf
->
headers
;
hp
;
hp
=
hp
->
next
)
{
if
(
strlen
(
hp
->
name
)
<
3
&&
hp
->
value
)
{
/* TODO This is a hack to discard default FS Events ! */
const
char
*
varphrasename
=
switch_event_get_header
(
menu
->
event_keys_varname
,
hp
->
value
);
menu
->
dtmfa
[
i
++
]
=
hp
->
name
;
if
(
varphrasename
&&
!
zstr
(
varphrasename
))
{
switch_event_add_header
(
menu
->
phrase_params
,
SWITCH_STACK_BOTTOM
,
varphrasename
,
"%s"
,
hp
->
name
);
}
}
}
}
menu
->
dtmfa
[
i
++
]
=
'\0'
;
}
vmivr_profile_t
*
get_profile
(
switch_core_session_t
*
session
,
const
char
*
profile_name
)
{
...
...
@@ -193,7 +199,17 @@ vmivr_profile_t *get_profile(switch_core_session_t *session, const char *profile
profile
->
menu_check_main
=
"std_main_menu"
;
profile
->
menu_check_terminate
=
"std_purge"
;
/* TODO Create event_settings and add default settings here */
/* Populate default general settings */
switch_event_create
(
&
profile
->
event_settings
,
SWITCH_EVENT_REQUEST_PARAMS
);
switch_event_add_header
(
profile
->
event_settings
,
SWITCH_STACK_BOTTOM
,
"IVR-Maximum-Attempts"
,
"%d"
,
3
);
switch_event_add_header
(
profile
->
event_settings
,
SWITCH_STACK_BOTTOM
,
"IVR-Entry-Timeout"
,
"%d"
,
3000
);
switch_event_add_header
(
profile
->
event_settings
,
SWITCH_STACK_BOTTOM
,
"Exit-Purge"
,
"%s"
,
"true"
);
switch_event_add_header
(
profile
->
event_settings
,
SWITCH_STACK_BOTTOM
,
"Password-Mask"
,
"%s"
,
"XXX."
);
switch_event_add_header
(
profile
->
event_settings
,
SWITCH_STACK_BOTTOM
,
"User-Mask"
,
"%s"
,
"X."
);
switch_event_add_header
(
profile
->
event_settings
,
SWITCH_STACK_BOTTOM
,
"Record-Format"
,
"%s"
,
"wav"
);
switch_event_add_header
(
profile
->
event_settings
,
SWITCH_STACK_BOTTOM
,
"Record-Silence-Hits"
,
"%d"
,
4
);
switch_event_add_header
(
profile
->
event_settings
,
SWITCH_STACK_BOTTOM
,
"Record-Silence-Threshold"
,
"%d"
,
200
);
switch_event_add_header
(
profile
->
event_settings
,
SWITCH_STACK_BOTTOM
,
"Record-Maximum-Length"
,
"%d"
,
30
);
if
((
x_settings
=
switch_xml_child
(
x_profile
,
"settings"
)))
{
switch_event_import_xml
(
switch_xml_child
(
x_settings
,
"param"
),
"name"
,
"value"
,
&
profile
->
event_settings
);
...
...
src/mod/applications/mod_voicemail_ivr/config.h
浏览文件 @
d544c065
...
...
@@ -91,6 +91,8 @@ struct vmivr_menu {
switch_event_t
*
phrase_params
;
ivre_data_t
ivre_d
;
int
ivr_maximum_attempts
;
int
ivr_entry_timeout
;
};
typedef
struct
vmivr_menu
vmivr_menu_t
;
...
...
src/mod/applications/mod_voicemail_ivr/menu.c
浏览文件 @
d544c065
差异被折叠。
点击展开。
src/mod/applications/mod_voicemail_ivr/utils.c
浏览文件 @
d544c065
...
...
@@ -33,11 +33,10 @@
#include "utils.h"
switch_status_t
vmivr_merge_media_files
(
const
char
**
inputs
,
const
char
*
output
)
{
switch_status_t
vmivr_merge_media_files
(
const
char
**
inputs
,
const
char
*
output
,
int
rate
)
{
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
switch_file_handle_t
fh_output
=
{
0
};
int
channels
=
1
;
int
rate
=
8000
;
/* TODO Make this configurable */
int
j
=
0
;
if
(
switch_core_file_open
(
&
fh_output
,
output
,
channels
,
rate
,
SWITCH_FILE_FLAG_WRITE
|
SWITCH_FILE_DATA_SHORT
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
...
...
@@ -99,7 +98,7 @@ switch_event_t *jsonapi2event(switch_core_session_t *session, switch_event_t *ap
return
phrases_event
;
}
char
*
generate_random_file_name
(
switch_core_session_t
*
session
,
const
char
*
mod_name
,
char
*
file_extension
)
{
char
*
generate_random_file_name
(
switch_core_session_t
*
session
,
const
char
*
mod_name
,
c
onst
c
har
*
file_extension
)
{
char
rand_uuid
[
SWITCH_UUID_FORMATTED_LENGTH
+
1
]
=
""
;
switch_uuid_t
srand_uuid
;
...
...
src/mod/applications/mod_voicemail_ivr/utils.h
浏览文件 @
d544c065
...
...
@@ -34,12 +34,10 @@
#include "config.h"
switch_status_t
vmivr_merge_files
(
const
char
**
inputs
,
const
char
*
output
);
void
append_event_message
(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
,
switch_event_t
*
phrase_params
,
switch_event_t
*
msg_list_event
,
size_t
current_msg
);
char
*
generate_random_file_name
(
switch_core_session_t
*
session
,
const
char
*
mod_name
,
char
*
file_extension
);
char
*
generate_random_file_name
(
switch_core_session_t
*
session
,
const
char
*
mod_name
,
c
onst
c
har
*
file_extension
);
switch_event_t
*
jsonapi2event
(
switch_core_session_t
*
session
,
switch_event_t
*
apply_event
,
const
char
*
api
,
const
char
*
data
);
switch_status_t
vmivr_merge_media_files
(
const
char
**
inputs
,
const
char
*
output
);
switch_status_t
vmivr_merge_media_files
(
const
char
**
inputs
,
const
char
*
output
,
int
rate
);
switch_status_t
vmivr_api_execute
(
switch_core_session_t
*
session
,
const
char
*
apiname
,
const
char
*
arguments
);
#endif
/* _UTIL_H_ */
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论