Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
068ad205
提交
068ad205
authored
4月 30, 2014
作者:
Michael Jerris
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
split this into 2 functions so its clear if this function allocates or not
上级
b205313f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
27 行增加
和
16 行删除
+27
-16
menu.c
src/mod/applications/mod_voicemail_ivr/menu.c
+4
-4
utils.c
src/mod/applications/mod_voicemail_ivr/utils.c
+21
-11
utils.h
src/mod/applications/mod_voicemail_ivr/utils.h
+2
-1
没有找到文件。
src/mod/applications/mod_voicemail_ivr/menu.c
浏览文件 @
068ad205
...
...
@@ -95,7 +95,7 @@ void vmivr_menu_main(switch_core_session_t *session, vmivr_profile_t *profile) {
ivre_init
(
&
menu
.
ivre_d
,
menu
.
dtmfa
);
cmd
=
switch_core_session_sprintf
(
session
,
"json %s %s %s %s"
,
profile
->
api_profile
,
profile
->
domain
,
profile
->
id
,
profile
->
folder_name
);
jsonapi
2
event
(
session
,
menu
.
phrase_params
,
profile
->
api_msg_count
,
cmd
);
jsonapi
_populate_
event
(
session
,
menu
.
phrase_params
,
profile
->
api_msg_count
,
cmd
);
/* Verify that phrases returned values, if not, exit */
if
(
!
switch_event_get_header
(
menu
.
phrase_params
,
"VM-Total-New-Messages"
))
{
...
...
@@ -192,7 +192,7 @@ void vmivr_menu_navigator(switch_core_session_t *session, vmivr_profile_t *profi
/* Get VoiceMail List And update msg count */
cmd
=
switch_core_session_sprintf
(
session
,
"json %s %s %s %s %s"
,
profile
->
api_profile
,
profile
->
domain
,
profile
->
id
,
profile
->
folder_name
,
profile
->
folder_filter
);
msg_list_params
=
jsonapi2event
(
session
,
NULL
,
profile
->
api_msg_list
,
cmd
);
msg_list_params
=
jsonapi2event
(
session
,
profile
->
api_msg_list
,
cmd
);
if
(
msg_list_params
)
{
msg_count
=
atol
(
switch_event_get_header
(
msg_list_params
,
"VM-List-Count"
));
if
(
msg_count
==
0
)
{
...
...
@@ -266,7 +266,7 @@ void vmivr_menu_navigator(switch_core_session_t *session, vmivr_profile_t *profi
if
(
!
skip_header
)
{
if
(
!
initial_count_played
)
{
cmd
=
switch_core_session_sprintf
(
session
,
"json %s %s %s"
,
profile
->
api_profile
,
profile
->
domain
,
profile
->
id
);
jsonapi
2
event
(
session
,
menu
.
phrase_params
,
profile
->
api_msg_count
,
cmd
);
jsonapi
_populate_
event
(
session
,
menu
.
phrase_params
,
profile
->
api_msg_count
,
cmd
);
initial_count_played
=
SWITCH_TRUE
;
// TODO ivre_playback(session, &menu.ivre_d, switch_event_get_header(menu.event_phrases, "msg_count"), NULL, menu.phrase_params, NULL, 0);
}
...
...
@@ -597,7 +597,7 @@ void vmivr_menu_select_greeting_slot(switch_core_session_t *session, vmivr_profi
if
(
vmivr_api_execute
(
session
,
profile
->
api_pref_greeting_set
,
cmd
)
==
SWITCH_STATUS_SUCCESS
)
{
char
*
str_num
=
switch_core_session_sprintf
(
session
,
"%d"
,
gnum
);
char
*
cmd
=
switch_core_session_sprintf
(
session
,
"json %s %s %s %d %s"
,
profile
->
api_profile
,
profile
->
domain
,
profile
->
id
);
switch_event_t
*
phrases
=
jsonapi2event
(
session
,
NULL
,
profile
->
api_pref_greeting_get
,
cmd
);
switch_event_t
*
phrases
=
jsonapi2event
(
session
,
profile
->
api_pref_greeting_get
,
cmd
);
ivre_playback_dtmf_buffered
(
session
,
switch_event_get_header
(
menu
.
event_phrases
,
"selected_slot"
),
str_num
,
phrases
,
NULL
,
0
);
...
...
src/mod/applications/mod_voicemail_ivr/utils.c
浏览文件 @
068ad205
...
...
@@ -75,25 +75,35 @@ end:
return
status
;
}
switch_event_t
*
jsonapi2
event
(
switch_core_session_t
*
session
,
switch_event_t
*
apply_event
,
const
char
*
api
,
const
char
*
data
)
{
void
jsonapi_populate_
event
(
switch_core_session_t
*
session
,
switch_event_t
*
apply_event
,
const
char
*
api
,
const
char
*
data
)
{
switch_event_t
*
phrases_event
=
NULL
;
switch_stream_handle_t
stream
=
{
0
};
switch_assert
(
apply_event
);
SWITCH_STANDARD_STREAM
(
stream
);
switch_api_execute
(
api
,
data
,
session
,
&
stream
);
switch_event_create_json
(
&
phrases_event
,
(
char
*
)
stream
.
data
);
switch_safe_free
(
stream
.
data
);
if
(
apply_event
)
{
switch_event_header_t
*
hp
;
for
(
hp
=
phrases_event
->
headers
;
hp
;
hp
=
hp
->
next
)
{
if
(
!
strncasecmp
(
hp
->
name
,
"VM-"
,
3
))
{
switch_event_add_header
(
apply_event
,
SWITCH_STACK_BOTTOM
,
hp
->
name
,
"%s"
,
hp
->
value
);
}
switch_event_header_t
*
hp
;
for
(
hp
=
phrases_event
->
headers
;
hp
;
hp
=
hp
->
next
)
{
if
(
!
strncasecmp
(
hp
->
name
,
"VM-"
,
3
))
{
switch_event_add_header
(
apply_event
,
SWITCH_STACK_BOTTOM
,
hp
->
name
,
"%s"
,
hp
->
value
);
}
switch_event_destroy
(
&
phrases_event
);
phrases_event
=
apply_event
;
}
switch_event_destroy
(
&
phrases_event
);
phrases_event
=
apply_event
;
return
;
}
switch_event_t
*
jsonapi2event
(
switch_core_session_t
*
session
,
const
char
*
api
,
const
char
*
data
)
{
switch_event_t
*
phrases_event
=
NULL
;
switch_stream_handle_t
stream
=
{
0
};
SWITCH_STANDARD_STREAM
(
stream
);
switch_api_execute
(
api
,
data
,
session
,
&
stream
);
switch_event_create_json
(
&
phrases_event
,
(
char
*
)
stream
.
data
);
switch_safe_free
(
stream
.
data
);
return
phrases_event
;
}
...
...
@@ -139,7 +149,7 @@ void append_event_message(switch_core_session_t *session, vmivr_profile_t *profi
switch_safe_free
(
varname
);
jsonapi
2
event
(
session
,
phrase_params
,
profile
->
api_msg_get
,
apicmd
);
jsonapi
_populate_
event
(
session
,
phrase_params
,
profile
->
api_msg_get
,
apicmd
);
/* TODO Set these 2 header correctly */
switch_event_add_header
(
phrase_params
,
SWITCH_STACK_BOTTOM
,
"VM-Message-Type"
,
"%s"
,
"new"
);
...
...
src/mod/applications/mod_voicemail_ivr/utils.h
浏览文件 @
068ad205
...
...
@@ -36,7 +36,8 @@
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
,
const
char
*
file_extension
);
switch_event_t
*
jsonapi2event
(
switch_core_session_t
*
session
,
switch_event_t
*
apply_event
,
const
char
*
api
,
const
char
*
data
);
switch_event_t
*
jsonapi2event
(
switch_core_session_t
*
session
,
const
char
*
api
,
const
char
*
data
);
void
jsonapi_populate_event
(
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
,
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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论