Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
15218697
提交
15218697
authored
8月 16, 2011
作者:
Marc Olivier Chouinard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mod_protovm: Removal of the proto vm. Might reinclude it under a different name in the future.
上级
d48edc53
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
0 行增加
和
2149 行删除
+0
-2149
Makefile
src/mod/applications/mod_protovm/Makefile
+0
-3
config.c
src/mod/applications/mod_protovm/config.c
+0
-135
config.h
src/mod/applications/mod_protovm/config.h
+0
-53
ivr.c
src/mod/applications/mod_protovm/ivr.c
+0
-250
ivr.h
src/mod/applications/mod_protovm/ivr.h
+0
-30
menu.c
src/mod/applications/mod_protovm/menu.c
+0
-743
menu.h
src/mod/applications/mod_protovm/menu.h
+0
-32
mod_protovm.c
src/mod/applications/mod_protovm/mod_protovm.c
+0
-139
protovm.conf.xml
src/mod/applications/mod_protovm/protovm.conf.xml
+0
-176
sounds.xml
src/mod/applications/mod_protovm/sounds.xml
+0
-397
util.c
src/mod/applications/mod_protovm/util.c
+0
-175
util.h
src/mod/applications/mod_protovm/util.h
+0
-16
没有找到文件。
src/mod/applications/mod_protovm/Makefile
deleted
100644 → 0
浏览文件 @
d48edc53
BASE
=
../../../..
LOCAL_OBJS
=
ivr.o util.o config.o menu.o
include
$(BASE)/build/modmake.rules
src/mod/applications/mod_protovm/config.c
deleted
100644 → 0
浏览文件 @
d48edc53
/* Copy paste from FS mod_voicemail */
#include <switch.h>
#include "config.h"
const
char
*
global_cf
=
"protovm.conf"
;
void
populate_profile_menu_event
(
vmivr_profile_t
*
profile
,
vmivr_menu_profile_t
*
menu
)
{
switch_xml_t
cfg
,
xml
,
x_profiles
,
x_profile
,
x_keys
,
x_phrases
,
x_menus
,
x_menu
;
free_profile_menu_event
(
menu
);
if
(
!
(
xml
=
switch_xml_open_cfg
(
global_cf
,
&
cfg
,
NULL
)))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Open of %s failed
\n
"
,
global_cf
);
goto
end
;
}
if
(
!
(
x_profiles
=
switch_xml_child
(
cfg
,
"profiles"
)))
{
goto
end
;
}
if
((
x_profile
=
switch_xml_find_child
(
x_profiles
,
"profile"
,
"name"
,
profile
->
name
)))
{
if
((
x_menus
=
switch_xml_child
(
x_profile
,
"menus"
)))
{
if
((
x_menu
=
switch_xml_find_child
(
x_menus
,
"menu"
,
"name"
,
menu
->
name
)))
{
if
((
x_keys
=
switch_xml_child
(
x_menu
,
"keys"
)))
{
switch_event_import_xml
(
switch_xml_child
(
x_keys
,
"key"
),
"dtmf"
,
"action"
,
&
menu
->
event_keys_dtmf
);
switch_event_import_xml
(
switch_xml_child
(
x_keys
,
"key"
),
"action"
,
"dtmf"
,
&
menu
->
event_keys_action
);
switch_event_import_xml
(
switch_xml_child
(
x_keys
,
"key"
),
"action"
,
"variable"
,
&
menu
->
event_keys_varname
);
}
if
((
x_phrases
=
switch_xml_child
(
x_menu
,
"phrases"
)))
{
switch_event_import_xml
(
switch_xml_child
(
x_phrases
,
"phrase"
),
"name"
,
"value"
,
&
menu
->
event_phrases
);
}
}
}
}
end:
if
(
xml
)
switch_xml_free
(
xml
);
return
;
}
void
free_profile_menu_event
(
vmivr_menu_profile_t
*
menu
)
{
if
(
menu
->
event_keys_dtmf
)
{
switch_event_destroy
(
&
menu
->
event_keys_dtmf
);
}
if
(
menu
->
event_keys_action
)
{
switch_event_destroy
(
&
menu
->
event_keys_action
);
}
if
(
menu
->
event_keys_varname
)
{
switch_event_destroy
(
&
menu
->
event_keys_varname
);
}
if
(
menu
->
event_phrases
)
{
switch_event_destroy
(
&
menu
->
event_phrases
);
}
}
vmivr_profile_t
*
get_profile
(
switch_core_session_t
*
session
,
const
char
*
profile_name
)
{
vmivr_profile_t
*
profile
=
NULL
;
switch_xml_t
cfg
,
xml
,
x_profiles
,
x_profile
,
x_apis
,
param
;
if
(
!
(
xml
=
switch_xml_open_cfg
(
global_cf
,
&
cfg
,
NULL
)))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Open of %s failed
\n
"
,
global_cf
);
return
profile
;
}
if
(
!
(
x_profiles
=
switch_xml_child
(
cfg
,
"profiles"
)))
{
goto
end
;
}
if
((
x_profile
=
switch_xml_find_child
(
x_profiles
,
"profile"
,
"name"
,
profile_name
)))
{
if
(
!
(
profile
=
switch_core_session_alloc
(
session
,
sizeof
(
vmivr_profile_t
))))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Alloc Failure
\n
"
);
goto
end
;
}
profile
->
name
=
profile_name
;
profile
->
current_msg
=
0
;
profile
->
current_msg_uuid
=
NULL
;
/* TODO Make the following configurable */
profile
->
api_profile
=
profile
->
name
;
profile
->
menu_check_auth
=
"std_authenticate"
;
profile
->
menu_check_main
=
"std_navigator"
;
profile
->
menu_check_terminate
=
"std_purge"
;
if
((
x_apis
=
switch_xml_child
(
x_profile
,
"apis"
)))
{
int
total_options
=
0
;
int
total_invalid_options
=
0
;
for
(
param
=
switch_xml_child
(
x_apis
,
"api"
);
param
;
param
=
param
->
next
)
{
char
*
var
,
*
val
;
if
((
var
=
(
char
*
)
switch_xml_attr_soft
(
param
,
"name"
))
&&
(
val
=
(
char
*
)
switch_xml_attr_soft
(
param
,
"value"
)))
{
if
(
!
strcasecmp
(
var
,
"msg_undelete"
)
&&
!
profile
->
api_msg_undelete
)
profile
->
api_msg_undelete
=
switch_core_session_strdup
(
session
,
val
);
else
if
(
!
strcasecmp
(
var
,
"msg_delete"
)
&&
!
profile
->
api_msg_delete
)
profile
->
api_msg_delete
=
switch_core_session_strdup
(
session
,
val
);
else
if
(
!
strcasecmp
(
var
,
"msg_list"
)
&&
!
profile
->
api_msg_list
)
profile
->
api_msg_list
=
switch_core_session_strdup
(
session
,
val
);
else
if
(
!
strcasecmp
(
var
,
"msg_count"
)
&&
!
profile
->
api_msg_count
)
profile
->
api_msg_count
=
switch_core_session_strdup
(
session
,
val
);
else
if
(
!
strcasecmp
(
var
,
"msg_save"
)
&&
!
profile
->
api_msg_save
)
profile
->
api_msg_save
=
switch_core_session_strdup
(
session
,
val
);
else
if
(
!
strcasecmp
(
var
,
"msg_purge"
)
&&
!
profile
->
api_msg_purge
)
profile
->
api_msg_purge
=
switch_core_session_strdup
(
session
,
val
);
else
if
(
!
strcasecmp
(
var
,
"msg_get"
)
&&
!
profile
->
api_msg_get
)
profile
->
api_msg_get
=
switch_core_session_strdup
(
session
,
val
);
else
if
(
!
strcasecmp
(
var
,
"msg_forward"
)
&&
!
profile
->
api_msg_forward
)
profile
->
api_msg_forward
=
switch_core_session_strdup
(
session
,
val
);
else
if
(
!
strcasecmp
(
var
,
"pref_greeting_set"
)
&&
!
profile
->
api_pref_greeting_set
)
profile
->
api_pref_greeting_set
=
switch_core_session_strdup
(
session
,
val
);
else
if
(
!
strcasecmp
(
var
,
"pref_recname_set"
)
&&
!
profile
->
api_pref_recname_set
)
profile
->
api_pref_recname_set
=
switch_core_session_strdup
(
session
,
val
);
else
if
(
!
strcasecmp
(
var
,
"pref_password_set"
)
&&
!
profile
->
api_pref_password_set
)
profile
->
api_pref_password_set
=
switch_core_session_strdup
(
session
,
val
);
else
if
(
!
strcasecmp
(
var
,
"auth_login"
)
&&
!
profile
->
api_auth_login
)
profile
->
api_auth_login
=
switch_core_session_strdup
(
session
,
val
);
else
total_invalid_options
++
;
total_options
++
;
}
}
if
(
total_options
-
total_invalid_options
!=
12
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Missing api definition for profile '%s'
\n
"
,
profile_name
);
profile
=
NULL
;
}
}
}
end:
switch_xml_free
(
xml
);
return
profile
;
}
src/mod/applications/mod_protovm/config.h
deleted
100644 → 0
浏览文件 @
d48edc53
#ifndef _CONFIG_H_
#define _CONFIG_H_
extern
const
char
*
global_cf
;
struct
vmivr_profile
{
const
char
*
name
;
const
char
*
domain
;
const
char
*
id
;
int
current_msg
;
const
char
*
current_msg_uuid
;
const
char
*
menu_check_auth
;
const
char
*
menu_check_main
;
const
char
*
menu_check_terminate
;
switch_bool_t
authorized
;
const
char
*
api_profile
;
const
char
*
api_auth_login
;
const
char
*
api_msg_delete
;
const
char
*
api_msg_undelete
;
const
char
*
api_msg_list
;
const
char
*
api_msg_count
;
const
char
*
api_msg_save
;
const
char
*
api_msg_purge
;
const
char
*
api_msg_get
;
const
char
*
api_msg_forward
;
const
char
*
api_pref_greeting_set
;
const
char
*
api_pref_recname_set
;
const
char
*
api_pref_password_set
;
};
typedef
struct
vmivr_profile
vmivr_profile_t
;
struct
vmivr_menu_profile
{
const
char
*
name
;
switch_event_t
*
event_keys_action
;
switch_event_t
*
event_keys_dtmf
;
switch_event_t
*
event_keys_varname
;
switch_event_t
*
event_phrases
;
};
typedef
struct
vmivr_menu_profile
vmivr_menu_profile_t
;
vmivr_profile_t
*
get_profile
(
switch_core_session_t
*
session
,
const
char
*
profile_name
);
void
free_profile_menu_event
(
vmivr_menu_profile_t
*
menu
);
void
populate_profile_menu_event
(
vmivr_profile_t
*
profile
,
vmivr_menu_profile_t
*
menu
);
#endif
/* _CONFIG_H_ */
src/mod/applications/mod_protovm/ivr.c
deleted
100644 → 0
浏览文件 @
d48edc53
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2011, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Marc Olivier Chouinard <mochouinard@moctel.com>
*
*
* ivr.c -- MT IVR System Interface
*
*/
#include <switch.h>
#include "ivr.h"
int
match_dtmf
(
switch_core_session_t
*
session
,
dtmf_ss_t
*
loc
)
{
switch_bool_t
is_invalid
[
128
]
=
{
SWITCH_FALSE
};
int
i
;
loc
->
potentialMatch
=
NULL
;
loc
->
completeMatch
=
NULL
;
loc
->
potentialMatchCount
=
0
;
for
(
i
=
0
;
i
<
loc
->
dtmf_received
;
i
++
)
{
int
j
;
loc
->
potentialMatchCount
=
0
;
for
(
j
=
0
;
!
zstr
(
loc
->
dtmf_accepted
[
j
])
&&
j
<
128
;
j
++
)
{
switch_bool_t
cMatch
=
SWITCH_FALSE
;
char
test
[
2
]
=
{
0
};
if
(
is_invalid
[
j
])
continue
;
test
[
0
]
=
loc
->
dtmf_stored
[
i
];
if
(
loc
->
dtmf_accepted
[
j
][
i
]
==
'N'
&&
atoi
(
test
)
>=
2
&&
atoi
(
test
)
<=
9
)
cMatch
=
SWITCH_TRUE
;
if
(
loc
->
dtmf_accepted
[
j
][
i
]
==
'X'
&&
atoi
(
test
)
>=
0
&&
atoi
(
test
)
<=
9
)
{
cMatch
=
SWITCH_TRUE
;
}
if
(
i
>=
strlen
(
loc
->
dtmf_accepted
[
j
])
-
1
&&
loc
->
dtmf_accepted
[
j
][
strlen
(
loc
->
dtmf_accepted
[
j
])
-
1
]
==
'.'
)
cMatch
=
SWITCH_TRUE
;
if
(
loc
->
dtmf_accepted
[
j
][
i
]
==
loc
->
dtmf_stored
[
i
])
cMatch
=
SWITCH_TRUE
;
if
(
cMatch
==
SWITCH_FALSE
)
{
is_invalid
[
j
]
=
SWITCH_TRUE
;
continue
;
}
if
(
i
==
strlen
(
loc
->
dtmf_accepted
[
j
])
-
1
&&
loc
->
dtmf_accepted
[
j
][
strlen
(
loc
->
dtmf_accepted
[
j
])
-
1
]
==
'.'
)
{
loc
->
completeMatch
=
loc
->
dtmf_accepted
[
j
];
}
if
(
i
==
loc
->
dtmf_received
-
1
&&
loc
->
dtmf_received
==
strlen
(
loc
->
dtmf_accepted
[
j
])
&&
loc
->
dtmf_accepted
[
j
][
strlen
(
loc
->
dtmf_accepted
[
j
])
-
1
]
!=
'.'
)
{
loc
->
completeMatch
=
loc
->
dtmf_accepted
[
j
];
continue
;
}
loc
->
potentialMatchCount
++
;
}
}
return
1
;
}
static
switch_status_t
cb_on_dtmf_ignore
(
switch_core_session_t
*
session
,
void
*
input
,
switch_input_type_t
itype
,
void
*
buf
,
unsigned
int
buflen
)
{
switch
(
itype
)
{
case
SWITCH_INPUT_TYPE_DTMF
:
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_dtmf_t
*
dtmf
=
(
switch_dtmf_t
*
)
input
;
switch_channel_queue_dtmf
(
channel
,
dtmf
);
return
SWITCH_STATUS_BREAK
;
}
default:
break
;
}
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
cb_on_dtmf
(
switch_core_session_t
*
session
,
void
*
input
,
switch_input_type_t
itype
,
void
*
buf
,
unsigned
int
buflen
)
{
dtmf_ss_t
*
loc
=
(
dtmf_ss_t
*
)
buf
;
switch
(
itype
)
{
case
SWITCH_INPUT_TYPE_DTMF
:
{
switch_dtmf_t
*
dtmf
=
(
switch_dtmf_t
*
)
input
;
switch_bool_t
audio_was_stopped
=
loc
->
audio_stopped
;
loc
->
audio_stopped
=
SWITCH_TRUE
;
if
(
loc
->
dtmf_received
>=
sizeof
(
loc
->
dtmf_stored
))
{
loc
->
result
=
RES_BUFFER_OVERFLOW
;
break
;
}
if
(
!
loc
->
terminate_key
||
dtmf
->
digit
!=
loc
->
terminate_key
)
loc
->
dtmf_stored
[
loc
->
dtmf_received
++
]
=
dtmf
->
digit
;
match_dtmf
(
session
,
loc
);
if
(
loc
->
terminate_key
&&
dtmf
->
digit
==
loc
->
terminate_key
&&
loc
->
result
==
RES_WAITFORMORE
)
{
if
(
loc
->
potentialMatchCount
==
1
&&
loc
->
completeMatch
!=
NULL
)
{
loc
->
result
=
RES_FOUND
;
}
else
{
loc
->
result
=
RES_INVALID
;
}
return
SWITCH_STATUS_BREAK
;
}
else
{
if
(
loc
->
potentialMatchCount
==
0
&&
loc
->
completeMatch
!=
NULL
)
{
loc
->
result
=
RES_FOUND
;
return
SWITCH_STATUS_BREAK
;
}
else
if
(
loc
->
potentialMatchCount
>
0
)
{
loc
->
result
=
RES_WAITFORMORE
;
if
(
!
audio_was_stopped
)
return
SWITCH_STATUS_BREAK
;
}
else
{
loc
->
result
=
RES_INVALID
;
return
SWITCH_STATUS_BREAK
;
}
}
}
break
;
default:
break
;
}
return
SWITCH_STATUS_SUCCESS
;
}
switch_status_t
captureMenuInitialize
(
dtmf_ss_t
*
loc
,
char
**
dtmf_accepted
)
{
int
i
;
memset
(
loc
,
0
,
sizeof
(
*
loc
));
for
(
i
=
0
;
dtmf_accepted
[
i
]
&&
i
<
16
;
i
++
)
{
strncpy
(
loc
->
dtmf_accepted
[
i
],
dtmf_accepted
[
i
],
128
);
}
return
SWITCH_STATUS_SUCCESS
;
}
switch_status_t
playbackBufferDTMF
(
switch_core_session_t
*
session
,
const
char
*
macro_name
,
const
char
*
data
,
switch_event_t
*
event
,
const
char
*
lang
,
int
timeout
)
{
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
if
(
switch_channel_ready
(
channel
))
{
switch_input_args_t
args
=
{
0
};
args
.
input_callback
=
cb_on_dtmf_ignore
;
if
(
macro_name
)
{
status
=
switch_ivr_phrase_macro_event
(
session
,
macro_name
,
data
,
event
,
lang
,
&
args
);
}
}
else
{
status
=
SWITCH_STATUS_BREAK
;
}
return
status
;
}
switch_status_t
captureMenu
(
switch_core_session_t
*
session
,
dtmf_ss_t
*
loc
,
const
char
*
macro_name
,
const
char
*
data
,
switch_event_t
*
event
,
const
char
*
lang
,
int
timeout
)
{
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
if
(
switch_channel_ready
(
channel
))
{
switch_input_args_t
args
=
{
0
};
args
.
input_callback
=
cb_on_dtmf
;
args
.
buf
=
loc
;
if
(
macro_name
&&
loc
->
audio_stopped
==
SWITCH_FALSE
&&
loc
->
result
==
RES_WAITFORMORE
)
{
status
=
switch_ivr_phrase_macro_event
(
session
,
macro_name
,
data
,
event
,
lang
,
&
args
);
}
if
(
switch_channel_ready
(
channel
)
&&
(
status
==
SWITCH_STATUS_SUCCESS
||
status
==
SWITCH_STATUS_BREAK
)
&&
timeout
&&
loc
->
result
==
RES_WAITFORMORE
)
{
loc
->
audio_stopped
=
SWITCH_TRUE
;
switch_ivr_collect_digits_callback
(
session
,
&
args
,
timeout
,
0
);
if
(
loc
->
result
==
RES_WAITFORMORE
)
{
if
(
loc
->
potentialMatchCount
==
1
&&
loc
->
completeMatch
!=
NULL
)
{
loc
->
result
=
RES_FOUND
;
}
else
{
loc
->
result
=
RES_TIMEOUT
;
}
}
}
}
else
{
status
=
SWITCH_STATUS_BREAK
;
}
return
status
;
}
switch_status_t
captureMenuRecord
(
switch_core_session_t
*
session
,
dtmf_ss_t
*
loc
,
switch_event_t
*
event
,
const
char
*
file_path
,
switch_file_handle_t
*
fh
,
int
max_record_len
)
{
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
if
(
switch_channel_ready
(
channel
))
{
switch_input_args_t
args
=
{
0
};
args
.
input_callback
=
cb_on_dtmf
;
args
.
buf
=
loc
;
if
(
loc
->
audio_stopped
==
SWITCH_FALSE
&&
loc
->
result
==
RES_WAITFORMORE
)
{
loc
->
recorded_audio
=
SWITCH_TRUE
;
switch_ivr_gentones
(
session
,
"%(1000, 0, 640)"
,
0
,
NULL
);
/* TODO Make this optional and configurable */
status
=
switch_ivr_record_file
(
session
,
fh
,
file_path
,
&
args
,
max_record_len
);
}
if
(
loc
->
result
==
RES_WAITFORMORE
)
{
loc
->
result
=
RES_TIMEOUT
;
}
}
else
{
status
=
SWITCH_STATUS_BREAK
;
}
return
status
;
}
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4
*/
src/mod/applications/mod_protovm/ivr.h
deleted
100644 → 0
浏览文件 @
d48edc53
struct
dtmf_ss
{
char
dtmf_stored
[
128
];
int
dtmf_received
;
char
dtmf_accepted
[
16
][
128
];
int
result
;
switch_bool_t
audio_stopped
;
switch_bool_t
recorded_audio
;
const
char
*
potentialMatch
;
int
potentialMatchCount
;
const
char
*
completeMatch
;
char
terminate_key
;
};
typedef
struct
dtmf_ss
dtmf_ss_t
;
#define RES_WAITFORMORE 0
#define RES_FOUND 1
#define RES_INVALID 3
#define RES_TIMEOUT 4
#define RES_BREAK 5
#define RES_RECORD 6
#define RES_BUFFER_OVERFLOW 99
#define MAX_DTMF_SIZE_OPTION 32
switch_status_t
captureMenu
(
switch_core_session_t
*
session
,
dtmf_ss_t
*
loc
,
const
char
*
macro_name
,
const
char
*
data
,
switch_event_t
*
event
,
const
char
*
lang
,
int
timeout
);
switch_status_t
captureMenuRecord
(
switch_core_session_t
*
session
,
dtmf_ss_t
*
loc
,
switch_event_t
*
event
,
const
char
*
file_path
,
switch_file_handle_t
*
fh
,
int
max_record_len
);
switch_status_t
captureMenuInitialize
(
dtmf_ss_t
*
loc
,
char
**
dtmf_accepted
);
switch_status_t
playbackBufferDTMF
(
switch_core_session_t
*
session
,
const
char
*
macro_name
,
const
char
*
data
,
switch_event_t
*
event
,
const
char
*
lang
,
int
timeout
);
src/mod/applications/mod_protovm/menu.c
deleted
100644 → 0
浏览文件 @
d48edc53
差异被折叠。
点击展开。
src/mod/applications/mod_protovm/menu.h
deleted
100644 → 0
浏览文件 @
d48edc53
#ifndef _MENU_H_
#define _MENU_H_
#include "config.h"
void
mtvm_menu_purge
(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
);
void
mtvm_menu_authenticate
(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
);
void
mtvm_menu_main
(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
);
void
mtvm_menu_record_name
(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
);
void
mtvm_menu_set_password
(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
);
void
mtvm_menu_select_greeting_slot
(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
);
void
mtvm_menu_record_greeting_with_slot
(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
);
void
mtvm_menu_preference
(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
);
void
mtvm_menu_forward
(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
);
switch_status_t
mtvm_menu_record
(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
,
vmivr_menu_profile_t
menu
,
const
char
*
file_name
);
char
*
mtvm_menu_get_input_set
(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
,
vmivr_menu_profile_t
menu
,
const
char
*
input_mask
);
struct
vmivr_menu_function
{
const
char
*
name
;
void
(
*
pt2Func
)(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
);
};
typedef
struct
vmivr_menu_function
vmivr_menu_function_t
;
extern
vmivr_menu_function_t
menu_list
[];
void
(
*
mtvm_get_menu_function
(
const
char
*
menu_name
))(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
);
#endif
/* _MENU_H_ */
src/mod/applications/mod_protovm/mod_protovm.c
deleted
100644 → 0
浏览文件 @
d48edc53
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2011, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Marc Olivier Chouinard <mochouinard@moctel.com>
*
*
* mod_protovm.c -- MT VoiceMail System
*
*/
#include <switch.h>
#include "config.h"
#include "menu.h"
/* Prototypes */
SWITCH_MODULE_SHUTDOWN_FUNCTION
(
mod_protovm_shutdown
);
SWITCH_MODULE_RUNTIME_FUNCTION
(
mod_protovm_runtime
);
SWITCH_MODULE_LOAD_FUNCTION
(
mod_protovm_load
);
/* SWITCH_MODULE_DEFINITION(name, load, shutdown, runtime)
* Defines a switch_loadable_module_function_table_t and a static const char[] modname
*/
SWITCH_MODULE_DEFINITION
(
mod_protovm
,
mod_protovm_load
,
mod_protovm_shutdown
,
NULL
);
#define MTVM_DESC "protovm"
#define MTVM_USAGE "<check> profile domain [id]"
SWITCH_STANDARD_APP
(
protovm_function
)
{
const
char
*
id
=
NULL
;
const
char
*
domain
=
NULL
;
const
char
*
profile_name
=
NULL
;
vmivr_profile_t
*
profile
=
NULL
;
int
argc
=
0
;
char
*
argv
[
6
]
=
{
0
};
char
*
mydata
=
NULL
;
if
(
!
zstr
(
data
))
{
mydata
=
switch_core_session_strdup
(
session
,
data
);
argc
=
switch_separate_string
(
mydata
,
' '
,
argv
,
(
sizeof
(
argv
)
/
sizeof
(
argv
[
0
])));
}
if
(
argv
[
1
])
profile_name
=
argv
[
1
];
if
(
argv
[
2
])
domain
=
argv
[
2
];
if
(
!
strcasecmp
(
argv
[
0
],
"check"
))
{
if
(
argv
[
3
])
id
=
argv
[
3
];
if
(
domain
&&
profile_name
)
{
profile
=
get_profile
(
session
,
profile_name
);
if
(
profile
)
{
void
(
*
fPtrAuth
)(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
)
=
mtvm_get_menu_function
(
profile
->
menu_check_auth
);
void
(
*
fPtrMain
)(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
)
=
mtvm_get_menu_function
(
profile
->
menu_check_main
);
void
(
*
fPtrTerminate
)(
switch_core_session_t
*
session
,
vmivr_profile_t
*
profile
)
=
mtvm_get_menu_function
(
profile
->
menu_check_terminate
);
profile
->
domain
=
domain
;
profile
->
id
=
id
;
if
(
fPtrAuth
&&
!
profile
->
authorized
)
{
fPtrAuth
(
session
,
profile
);
}
if
(
fPtrMain
&&
profile
->
authorized
)
{
fPtrMain
(
session
,
profile
);
}
if
(
fPtrTerminate
)
{
fPtrTerminate
(
session
,
profile
);
}
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Profile '%s' not found
\n
"
,
profile_name
);
}
}
}
return
;
}
/* Macro expands to: switch_status_t mod_protovm_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool) */
SWITCH_MODULE_LOAD_FUNCTION
(
mod_protovm_load
)
{
switch_application_interface_t
*
app_interface
;
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
/* connect my internal structure to the blank pointer passed to me */
*
module_interface
=
switch_loadable_module_create_module_interface
(
pool
,
modname
);
SWITCH_ADD_APP
(
app_interface
,
"protovm"
,
"protovm"
,
MTVM_DESC
,
protovm_function
,
MTVM_USAGE
,
SAF_NONE
);
/* indicate that the module should continue to be loaded */
return
status
;
}
/*
Called when the system shuts down
Macro expands to: switch_status_t mod_protovm_shutdown() */
SWITCH_MODULE_SHUTDOWN_FUNCTION
(
mod_protovm_shutdown
)
{
return
SWITCH_STATUS_SUCCESS
;
}
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4
*/
src/mod/applications/mod_protovm/protovm.conf.xml
deleted
100644 → 0
浏览文件 @
d48edc53
<configuration
name=
"protovm.conf"
description=
"ProtoVoicemailIVR"
>
<profiles>
<profile
name=
"default"
>
<apis>
<api
name=
"auth_login"
value=
"vm_fsdb_auth_login"
/>
<api
name=
"msg_list"
value=
"vm_fsdb_msg_list"
/>
<api
name=
"msg_count"
value=
"vm_fsdb_msg_count"
/>
<api
name=
"msg_delete"
value=
"vm_fsdb_msg_delete"
/>
<api
name=
"msg_undelete"
value=
"vm_fsdb_msg_undelete"
/>
<api
name=
"msg_save"
value=
"vm_fsdb_msg_save"
/>
<api
name=
"msg_purge"
value=
"vm_fsdb_msg_purge"
/>
<api
name=
"msg_get"
value=
"vm_fsdb_msg_get"
/>
<api
name=
"msg_forward"
value=
"vm_fsdb_msg_forward"
/>
<api
name=
"pref_greeting_set"
value=
"vm_fsdb_pref_greeting_set"
/>
<api
name=
"pref_recname_set"
value=
"vm_fsdb_pref_recname_set"
/>
<api
name=
"pref_password_set"
value=
"vm_fsdb_pref_password_set"
/>
</apis>
<menus>
<menu
name=
"std_authenticate"
>
<phrases>
<phrase
name=
"fail_auth"
value=
"fail_auth@protovm"
/>
</phrases>
<keys>
</keys>
</menu>
<menu
name=
"std_authenticate_ask_user"
>
<phrases>
<phrase
name=
"instructions"
value=
"enter_id@protovm"
/>
</phrases>
<keys>
<key
dtmf=
"#"
action=
"ivrengine:terminate_entry"
variable=
"VM-Key-Terminator"
/>
</keys>
</menu>
<menu
name=
"std_authenticate_ask_password"
>
<phrases>
<phrase
name=
"instructions"
value=
"enter_pass@protovm"
/>
</phrases>
<keys>
<key
dtmf=
"#"
action=
"ivrengine:terminate_entry"
variable=
"VM-Key-Terminator"
/>
</keys>
</menu>
<menu
name=
"std_navigator"
>
<phrases>
<phrase
name=
"msg_count"
value=
"message_count@protovm"
/>
<phrase
name=
"say_date"
value=
"say_date_event@protovm"
/>
<phrase
name=
"say_msg_number"
value=
"say_message_number@protovm"
/>
<phrase
name=
"menu_options"
value=
"listen_file_check@protovm"
/>
<phrase
name=
"ack"
value=
"ack@protovm"
/>
<phrase
name=
"play_message"
value=
"play_message@protovm"
/>
</phrases>
<keys>
<key
dtmf=
"1"
action=
"skip_intro"
variable=
"VM-Key-Main-Listen-File"
/>
<key
dtmf=
"6"
action=
"next_msg"
variable=
"VM-Key-Main-Next-Msg"
/>
<key
dtmf=
"4"
action=
"prev_msg"
/>
<key
dtmf=
"7"
action=
"delete_msg"
variable=
"VM-Key-Main-Delete-File"
/>
<!-- Same key for undelete if it already deleted -->
<key
dtmf=
"8"
action=
"menu:std_forward"
variable=
"VM-Key-Main-Forward"
/>
<key
dtmf=
"3"
action=
"save_msg"
variable=
"VM-Key-Main-Save-File"
/>
<key
dtmf=
"2"
action=
"callback"
variable=
"VM-Key-Main-Callback"
/>
<key
dtmf=
"5"
action=
"menu:std_preference"
/>
<key
dtmf=
"#"
action=
"return"
/>
<!-- TODO Might Conflict with future fast-forward -->
</keys>
</menu>
<menu
name=
"std_preference"
>
<phrases>
<phrase
name=
"menu_options"
value=
"config_menu@protovm"
/>
</phrases>
<keys>
<key
dtmf=
"1"
action=
"menu:std_record_greeting_with_slot"
variable=
"VM-Key-Record-Greeting"
/>
<key
dtmf=
"2"
action=
"menu:std_select_greeting_slot"
variable=
"VM-Key-Choose-Greeting"
/>
<key
dtmf=
"3"
action=
"menu:std_record_name"
variable=
"VM-Key-Record-Name"
/>
<key
dtmf=
"6"
action=
"menu:std_set_password"
variable=
"VM-Key-Change-Password"
/>
<key
dtmf=
"#"
action=
"return"
variable=
"VM-Key-Main-Menu"
/>
</keys>
</menu>
<menu
name=
"std_record_greeting"
>
<phrases>
<phrase
name=
"instructions"
value=
"record_greeting@protovm"
/>
<phrase
name=
"play_recording"
value=
"play_recording@protovm"
/>
<phrase
name=
"menu_options"
value=
"record_file_check@protovm"
/>
</phrases>
<keys>
<key
dtmf=
"1"
action=
"listen"
variable=
"VM-Key-Listen-File"
/>
<key
dtmf=
"3"
action=
"save"
variable=
"VM-Key-Save-File"
/>
<key
dtmf=
"4"
action=
"rerecord"
variable=
"VM-Key-ReRecord-File"
/>
<key
dtmf=
"#"
action=
"skip_instruction"
/>
</keys>
</menu>
<menu
name=
"std_record_name"
>
<phrases>
<phrase
name=
"instructions"
value=
"record_name@protovm"
/>
<phrase
name=
"play_recording"
value=
"play_recording@protovm"
/>
<phrase
name=
"menu_options"
value=
"record_file_check@protovm"
/>
</phrases>
<keys>
<key
dtmf=
"1"
action=
"listen"
variable=
"VM-Key-Listen-File"
/>
<key
dtmf=
"3"
action=
"save"
variable=
"VM-Key-Save-File"
/>
<key
dtmf=
"4"
action=
"rerecord"
variable=
"VM-Key-ReRecord-File"
/>
<key
dtmf=
"#"
action=
"skip_instruction"
/>
</keys>
</menu>
<menu
name=
"std_record_message"
>
<phrases>
<phrase
name=
"instructions"
value=
"record_message@protovm"
/>
<phrase
name=
"play_recording"
value=
"play_recording@protovm"
/>
<phrase
name=
"menu_options"
value=
"record_file_check@protovm"
/>
</phrases>
<keys>
<key
dtmf=
"1"
action=
"listen"
variable=
"VM-Key-Listen-File"
/>
<key
dtmf=
"3"
action=
"save"
variable=
"VM-Key-Save-File"
/>
<key
dtmf=
"4"
action=
"rerecord"
variable=
"VM-Key-ReRecord-File"
/>
<key
dtmf=
"#"
action=
"skip_instruction"
/>
</keys>
</menu>
<menu
name=
"std_forward_ask_prepend"
>
<phrases>
<phrase
name=
"menu_options"
value=
"forward_ask_prepend@protovm"
/>
</phrases>
<keys>
<key
dtmf=
"1"
action=
"prepend"
variable=
"VM-Key-Prepend"
/>
<key
dtmf=
"8"
action=
"forward"
variable=
"VM-Key-Forward"
/>
<key
dtmf=
"#"
action=
"return"
variable=
"VM-Key-Return"
/>
</keys>
</menu>
<menu
name=
"std_forward_ask_extension"
>
<phrases>
<phrase
name=
"instructions"
value=
"forward_ask_extension@protovm"
/>
<phrase
name=
"ack"
value=
"ack@protovm"
/>
<phrase
name=
"invalid_extension"
value=
"invalid_extension@protovm"
/>
</phrases>
<keys>
<key
dtmf=
"#"
action=
"ivrengine:terminate_entry"
variable=
"VM-Key-Terminator"
/>
</keys>
</menu>
<menu
name=
"std_select_greeting_slot"
>
<phrases>
<phrase
name=
"instructions"
value=
"choose_greeting@protovm"
/>
<phrase
name=
"invalid_slot"
value=
"choose_greeting_fail@protovm"
/>
<phrase
name=
"selected_slot"
value=
"greeting_selected@protovm"
/>
</phrases>
<keys>
</keys>
</menu>
<menu
name=
"std_record_greeting_with_slot"
>
<phrases>
<phrase
name=
"instructions"
value=
"choose_greeting@protovm"
/>
</phrases>
<keys>
</keys>
</menu>
<menu
name=
"std_set_password"
>
<phrases>
<phrase
name=
"instructions"
value=
"enter_pass@protovm"
/>
</phrases>
<keys>
<key
dtmf=
"#"
action=
"ivrengine:terminate_entry"
variable=
"VM-Key-Terminator"
/>
</keys>
</menu>
</menus>
</profile>
</profiles>
</configuration>
src/mod/applications/mod_protovm/sounds.xml
deleted
100644 → 0
浏览文件 @
d48edc53
差异被折叠。
点击展开。
src/mod/applications/mod_protovm/util.c
deleted
100644 → 0
浏览文件 @
d48edc53
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2011, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Marc Olivier Chouinard <mochouinard@moctel.com>
*
*
* utils.c -- MT VoiceMail / Different utility that might need to go into the core (after cleanup)
*
*/
#include <switch.h>
#include "util.h"
switch_status_t
mt_merge_media_files
(
const
char
**
inputs
,
const
char
*
output
)
{
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
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't open %s
\n
"
,
output
);
goto
end
;
}
for
(
j
=
0
;
inputs
[
j
]
!=
NULL
&&
j
<
128
&&
status
==
SWITCH_STATUS_SUCCESS
;
j
++
)
{
switch_file_handle_t
fh_input
=
{
0
};
char
buf
[
2048
];
switch_size_t
len
=
sizeof
(
buf
)
/
2
;
if
(
switch_core_file_open
(
&
fh_input
,
inputs
[
j
],
channels
,
rate
,
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't open %s
\n
"
,
inputs
[
j
]);
status
=
SWITCH_STATUS_GENERR
;
break
;
}
while
(
switch_core_file_read
(
&
fh_input
,
buf
,
&
len
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_core_file_write
(
&
fh_output
,
buf
,
&
len
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Write error
\n
"
);
status
=
SWITCH_STATUS_GENERR
;
break
;
}
}
if
(
fh_input
.
file_interface
)
{
switch_core_file_close
(
&
fh_input
);
}
}
if
(
fh_output
.
file_interface
)
{
switch_core_file_close
(
&
fh_output
);
}
end:
return
status
;
}
switch_event_t
*
jsonapi2event
(
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_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_destroy
(
&
phrases_event
);
phrases_event
=
apply_event
;
}
return
phrases_event
;
}
char
*
generate_random_file_name
(
switch_core_session_t
*
session
,
const
char
*
mod_name
,
char
*
file_extension
)
{
char
rand_uuid
[
SWITCH_UUID_FORMATTED_LENGTH
+
1
]
=
""
;
switch_uuid_t
srand_uuid
;
switch_uuid_get
(
&
srand_uuid
);
switch_uuid_format
(
rand_uuid
,
&
srand_uuid
);
return
switch_core_session_sprintf
(
session
,
"%s%s%s_%s.%s"
,
SWITCH_GLOBAL_dirs
.
temp_dir
,
SWITCH_PATH_SEPARATOR
,
mod_name
,
rand_uuid
,
file_extension
);
}
switch_status_t
mt_api_execute
(
switch_core_session_t
*
session
,
const
char
*
apiname
,
const
char
*
arguments
)
{
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
switch_stream_handle_t
stream
=
{
0
};
SWITCH_STANDARD_STREAM
(
stream
);
switch_api_execute
(
apiname
,
arguments
,
session
,
&
stream
);
if
(
!
strncasecmp
(
stream
.
data
,
"-ERR"
,
4
))
{
status
=
SWITCH_STATUS_GENERR
;
}
switch_safe_free
(
stream
.
data
);
return
status
;
}
void
append_event_profile
(
switch_event_t
*
phrase_params
,
vmivr_profile_t
*
profile
,
vmivr_menu_profile_t
menu
)
{
/* Used for some appending function */
if
(
profile
->
name
&&
profile
->
id
&&
profile
->
domain
)
{
switch_event_add_header
(
phrase_params
,
SWITCH_STACK_BOTTOM
,
"VM-Profile"
,
"%s"
,
profile
->
name
);
switch_event_add_header
(
phrase_params
,
SWITCH_STACK_BOTTOM
,
"VM-Account-ID"
,
"%s"
,
profile
->
id
);
switch_event_add_header
(
phrase_params
,
SWITCH_STACK_BOTTOM
,
"VM-Account-Domain"
,
"%s"
,
profile
->
domain
);
}
}
void
populate_dtmfa_from_event
(
switch_event_t
*
phrase_params
,
vmivr_profile_t
*
profile
,
vmivr_menu_profile_t
menu
,
char
**
dtmfa
)
{
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
);
dtmfa
[
i
++
]
=
hp
->
name
;
if
(
varphrasename
&&
!
zstr
(
varphrasename
))
{
switch_event_add_header
(
phrase_params
,
SWITCH_STACK_BOTTOM
,
varphrasename
,
"%s"
,
hp
->
name
);
}
}
}
}
}
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
*
varname
;
char
*
apicmd
;
varname
=
switch_mprintf
(
"VM-List-Message-%"
SWITCH_SIZE_T_FMT
"-UUID"
,
current_msg
);
apicmd
=
switch_mprintf
(
"json %s %s %s %s"
,
profile
->
api_profile
,
profile
->
domain
,
profile
->
id
,
switch_event_get_header
(
msg_list_event
,
varname
));
switch_safe_free
(
varname
);
jsonapi2event
(
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"
);
switch_event_add_header
(
phrase_params
,
SWITCH_STACK_BOTTOM
,
"VM-Message-Number"
,
"%"
SWITCH_SIZE_T_FMT
,
current_msg
);
switch_event_add_header_string
(
phrase_params
,
SWITCH_STACK_BOTTOM
,
"VM-Message-Private-Local-Copy"
,
"False"
);
switch_safe_free
(
apicmd
);
}
src/mod/applications/mod_protovm/util.h
deleted
100644 → 0
浏览文件 @
d48edc53
#ifndef _UTIL_H_
#define _UTIL_H_
#include "config.h"
switch_status_t
mt_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
);
void
append_event_profile
(
switch_event_t
*
phrase_params
,
vmivr_profile_t
*
profile
,
vmivr_menu_profile_t
menu
);
char
*
generate_random_file_name
(
switch_core_session_t
*
session
,
const
char
*
mod_name
,
char
*
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
mt_merge_media_files
(
const
char
**
inputs
,
const
char
*
output
);
switch_status_t
mt_api_execute
(
switch_core_session_t
*
session
,
const
char
*
apiname
,
const
char
*
arguments
);
void
populate_dtmfa_from_event
(
switch_event_t
*
phrase_params
,
vmivr_profile_t
*
profile
,
vmivr_menu_profile_t
menu
,
char
**
dtmfa
);
#endif
/* _UTIL_H_ */
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论