Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
2226c3c6
提交
2226c3c6
authored
10月 12, 2018
作者:
Chris Rienzo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-11453 [mod_rayo] convert to fst testing
上级
e0b5df10
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
23 个修改的文件
包含
963 行增加
和
813 行删除
+963
-813
configure.ac
configure.ac
+1
-0
switch_test.h
src/include/test/switch_test.h
+56
-11
Makefile.am
src/mod/event_handlers/mod_rayo/Makefile.am
+2
-0
iks_helpers.h
src/mod/event_handlers/mod_rayo/iks_helpers.h
+29
-29
mod_rayo.h
src/mod/event_handlers/mod_rayo/mod_rayo.h
+18
-18
nlsml.h
src/mod/event_handlers/mod_rayo/nlsml.h
+7
-7
rayo_components.h
src/mod/event_handlers/mod_rayo/rayo_components.h
+29
-29
rayo_cpa_component.h
src/mod/event_handlers/mod_rayo/rayo_cpa_component.h
+3
-3
rayo_cpa_detector.h
src/mod/event_handlers/mod_rayo/rayo_cpa_detector.h
+4
-4
sasl.h
src/mod/event_handlers/mod_rayo/sasl.h
+2
-2
srgs.h
src/mod/event_handlers/mod_rayo/srgs.h
+10
-10
test.h
src/mod/event_handlers/mod_rayo/test.h
+0
-101
Makefile.am
src/mod/event_handlers/mod_rayo/test/Makefile.am
+13
-0
test_iks.c
src/mod/event_handlers/mod_rayo/test/test_iks.c
+204
-0
test_nlsml.c
src/mod/event_handlers/mod_rayo/test/test_nlsml.c
+75
-62
test_srgs.c
src/mod/event_handlers/mod_rayo/test/test_srgs.c
+495
-450
Makefile
src/mod/event_handlers/mod_rayo/test_iks/Makefile
+0
-18
test_iks.c
src/mod/event_handlers/mod_rayo/test_iks/test_iks.c
+0
-6
Makefile
src/mod/event_handlers/mod_rayo/test_nlsml/Makefile
+0
-18
test_nlsml.c
src/mod/event_handlers/mod_rayo/test_nlsml/test_nlsml.c
+0
-6
Makefile
src/mod/event_handlers/mod_rayo/test_srgs/Makefile
+0
-18
test_srgs.c
src/mod/event_handlers/mod_rayo/test_srgs/test_srgs.c
+0
-6
xmpp_streams.h
src/mod/event_handlers/mod_rayo/xmpp_streams.h
+15
-15
没有找到文件。
configure.ac
浏览文件 @
2226c3c6
...
@@ -1929,6 +1929,7 @@ AC_CONFIG_FILES([Makefile
...
@@ -1929,6 +1929,7 @@ AC_CONFIG_FILES([Makefile
src/mod/event_handlers/mod_radius_cdr/Makefile
src/mod/event_handlers/mod_radius_cdr/Makefile
src/mod/event_handlers/mod_odbc_cdr/Makefile
src/mod/event_handlers/mod_odbc_cdr/Makefile
src/mod/event_handlers/mod_rayo/Makefile
src/mod/event_handlers/mod_rayo/Makefile
src/mod/event_handlers/mod_rayo/test/Makefile
src/mod/event_handlers/mod_smpp/Makefile
src/mod/event_handlers/mod_smpp/Makefile
src/mod/event_handlers/mod_snmp/Makefile
src/mod/event_handlers/mod_snmp/Makefile
src/mod/event_handlers/mod_event_zmq/Makefile
src/mod/event_handlers/mod_event_zmq/Makefile
...
...
src/include/test/switch_test.h
浏览文件 @
2226c3c6
...
@@ -37,7 +37,6 @@
...
@@ -37,7 +37,6 @@
/**
/**
* Get environment variable and save to var
* Get environment variable and save to var
( )
*/
*/
static
char
*
fst_getenv_default
(
const
char
*
env
,
char
*
default_value
,
switch_bool_t
required
)
static
char
*
fst_getenv_default
(
const
char
*
env
,
char
*
default_value
,
switch_bool_t
required
)
{
{
...
@@ -171,7 +170,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -171,7 +170,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
*/
*/
#define fst_check_int_range(actual, expected, precision) \
#define fst_check_int_range(actual, expected, precision) \
fct_xchk( \
fct_xchk( \
abs((
v
al - expected)) <= precision, \
abs((
actu
al - expected)) <= precision, \
"fst_check_int_range: %d != %d +/- %d", \
"fst_check_int_range: %d != %d +/- %d", \
(actual), \
(actual), \
(expected), \
(expected), \
...
@@ -183,13 +182,39 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -183,13 +182,39 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
*/
*/
#define fst_check_double_range(actual, expected, precision) \
#define fst_check_double_range(actual, expected, precision) \
fct_xchk( \
fct_xchk( \
fabs((
v
al - expected)) <= precision, \
fabs((
actu
al - expected)) <= precision, \
"fst_check_double_range: %f != %f +/- %f", \
"fst_check_double_range: %f != %f +/- %f", \
(actual), \
(actual), \
(expected), \
(expected), \
(precision) \
(precision) \
);
);
/**
* Run test without loading FS core
*/
#define FST_BEGIN() \
FCT_BGN() \
{ \
int fst_core = 0; \
switch_time_t fst_time_start = 0; \
switch_timer_t fst_timer = { 0 }; \
switch_memory_pool_t *fst_pool = NULL; \
fst_getenv_default("FST_SUPPRESS_UNUSED_STATIC_WARNING", NULL, SWITCH_FALSE); \
if (fst_core) { \
fst_init_core_and_modload(NULL, NULL);
/* shuts up compiler */
\
} \
{ \
#define FST_END() \
} \
if (fst_time_start) { \
/* shut up compiler */
\
fst_time_start = 0; \
} \
} \
FCT_END()
/**
/**
* Define the beginning of a freeswitch core test driver. Only one per test application allowed.
* Define the beginning of a freeswitch core test driver. Only one per test application allowed.
* @param confdir directory containing freeswitch.xml configuration
* @param confdir directory containing freeswitch.xml configuration
...
@@ -197,12 +222,13 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -197,12 +222,13 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
#define FST_CORE_BEGIN(confdir) \
#define FST_CORE_BEGIN(confdir) \
FCT_BGN() \
FCT_BGN() \
{ \
{ \
int fst_core = 1; \
switch_time_t fst_time_start = 0; \
switch_time_t fst_time_start = 0; \
switch_timer_t fst_timer = { 0 }; \
switch_timer_t fst_timer = { 0 }; \
switch_memory_pool_t *fst_pool = NULL; \
switch_memory_pool_t *fst_pool = NULL; \
fst_getenv_default("FST_SUPPRESS_UNUSED_STATIC_WARNING", NULL, SWITCH_FALSE); \
fst_getenv_default("FST_SUPPRESS_UNUSED_STATIC_WARNING", NULL, SWITCH_FALSE); \
fst_init_core_and_modload(confdir, NULL); \
fst_init_core_and_modload(confdir, NULL); \
{
\
{
/**
/**
* Define the end of a freeswitch core test driver.
* Define the end of a freeswitch core test driver.
...
@@ -210,6 +236,10 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -210,6 +236,10 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
#define FST_CORE_END() \
#define FST_CORE_END() \
/*switch_core_destroy();*/
\
/*switch_core_destroy();*/
\
} \
} \
if (fst_time_start) { \
/* shut up compiler */
\
fst_time_start = 0; \
} \
} \
} \
FCT_END()
FCT_END()
...
@@ -222,6 +252,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -222,6 +252,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
#define FST_MODULE_BEGIN(modname,suite) \
#define FST_MODULE_BEGIN(modname,suite) \
{ \
{ \
const char *fst_test_module = #modname; \
const char *fst_test_module = #modname; \
fst_requires(fst_core); \
if (!zstr(fst_test_module)) { \
if (!zstr(fst_test_module)) { \
const char *err; \
const char *err; \
switch_loadable_module_load_module((char *)"../.libs", (char *)fst_test_module, SWITCH_FALSE, &err); \
switch_loadable_module_load_module((char *)"../.libs", (char *)fst_test_module, SWITCH_FALSE, &err); \
...
@@ -259,10 +290,12 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -259,10 +290,12 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
*/
*/
#define FST_SETUP_BEGIN() \
#define FST_SETUP_BEGIN() \
FCT_SETUP_BGN() \
FCT_SETUP_BGN() \
switch_core_new_memory_pool(&fst_pool); \
if (fst_core) { \
fst_requires(fst_pool != NULL); \
switch_core_new_memory_pool(&fst_pool); \
fst_requires(switch_core_timer_init(&fst_timer, "soft", 20, 160, fst_pool) == SWITCH_STATUS_SUCCESS); \
fst_requires(fst_pool != NULL); \
fst_time_mark();
fst_requires(switch_core_timer_init(&fst_timer, "soft", 20, 160, fst_pool) == SWITCH_STATUS_SUCCESS); \
fst_time_mark(); \
}
/**
/**
* Define the end of test suite setup.
* Define the end of test suite setup.
...
@@ -275,8 +308,10 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -275,8 +308,10 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
*/
*/
#define FST_TEARDOWN_BEGIN() \
#define FST_TEARDOWN_BEGIN() \
FCT_TEARDOWN_BGN() \
FCT_TEARDOWN_BGN() \
switch_core_destroy_memory_pool(&fst_pool); \
if (fst_core) { \
switch_core_timer_destroy(&fst_timer);
switch_core_destroy_memory_pool(&fst_pool); \
switch_core_timer_destroy(&fst_timer); \
}
/**
/**
* Define the test suite teardown end.
* Define the test suite teardown end.
...
@@ -323,6 +358,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -323,6 +358,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
switch_core_session_t *fst_session = NULL; \
switch_core_session_t *fst_session = NULL; \
switch_event_t *fst_originate_vars = NULL; \
switch_event_t *fst_originate_vars = NULL; \
switch_call_cause_t fst_cause = SWITCH_CAUSE_NORMAL_CLEARING; \
switch_call_cause_t fst_cause = SWITCH_CAUSE_NORMAL_CLEARING; \
fst_requires(fst_core); \
if (fst_test_module) { \
if (fst_test_module) { \
fst_requires_module(fst_test_module); \
fst_requires_module(fst_test_module); \
} \
} \
...
@@ -387,6 +423,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -387,6 +423,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
char *fst_asr_result = NULL; \
char *fst_asr_result = NULL; \
switch_asr_handle_t ah = { 0 }; \
switch_asr_handle_t ah = { 0 }; \
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE; \
switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE; \
fst_requires(fst_core); \
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Open recognizer: %s\n", recognizer); \
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Open recognizer: %s\n", recognizer); \
/* open ASR interface and feed recorded audio into it and collect result */
\
/* open ASR interface and feed recorded audio into it and collect result */
\
fst_requires(switch_core_asr_open(&ah, recognizer, "L16", 8000, "", &flags, fst_pool) == SWITCH_STATUS_SUCCESS); \
fst_requires(switch_core_asr_open(&ah, recognizer, "L16", 8000, "", &flags, fst_pool) == SWITCH_STATUS_SUCCESS); \
...
@@ -419,6 +456,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -419,6 +456,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
fst_asr_result = NULL; \
fst_asr_result = NULL; \
file_handle.channels = 1; \
file_handle.channels = 1; \
file_handle.native_rate = 8000; \
file_handle.native_rate = 8000; \
fst_requires(fst_core); \
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Test recognizer: input = %s\n", input_filename); \
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Test recognizer: input = %s\n", input_filename); \
fst_requires(switch_core_asr_load_grammar(&ah, grammar, "") == SWITCH_STATUS_SUCCESS); \
fst_requires(switch_core_asr_load_grammar(&ah, grammar, "") == SWITCH_STATUS_SUCCESS); \
fst_requires(switch_core_file_open(&file_handle, input_filename, file_handle.channels, 8000, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) == SWITCH_STATUS_SUCCESS); \
fst_requires(switch_core_file_open(&file_handle, input_filename, file_handle.channels, 8000, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) == SWITCH_STATUS_SUCCESS); \
...
@@ -461,6 +499,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -461,6 +499,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
* switch_core_asr_pause(&ah) == SWITCH_STATUS_SUCCESS
* switch_core_asr_pause(&ah) == SWITCH_STATUS_SUCCESS
*/
*/
#define fst_test_core_asr_pause() \
#define fst_test_core_asr_pause() \
fst_requires(fst_core); \
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Pause recognizer\n"); \
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Pause recognizer\n"); \
flags = SWITCH_ASR_FLAG_NONE; \
flags = SWITCH_ASR_FLAG_NONE; \
fst_requires(switch_core_asr_pause(&ah) == SWITCH_STATUS_SUCCESS);
fst_requires(switch_core_asr_pause(&ah) == SWITCH_STATUS_SUCCESS);
...
@@ -472,6 +511,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -472,6 +511,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
* switch_core_asr_resume(&ah) == SWITCH_STATUS_SUCCESS
* switch_core_asr_resume(&ah) == SWITCH_STATUS_SUCCESS
*/
*/
#define fst_test_core_asr_resume() \
#define fst_test_core_asr_resume() \
fst_requires(fst_core); \
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Resume recognizer\n"); \
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Resume recognizer\n"); \
flags = SWITCH_ASR_FLAG_NONE; \
flags = SWITCH_ASR_FLAG_NONE; \
fst_requires(switch_core_asr_resume(&ah) == SWITCH_STATUS_SUCCESS);
fst_requires(switch_core_asr_resume(&ah) == SWITCH_STATUS_SUCCESS);
...
@@ -483,6 +523,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -483,6 +523,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
* switch_core_asr_close(&ah, flags) == SWITCH_STATUS_SUCCESS
* switch_core_asr_close(&ah, flags) == SWITCH_STATUS_SUCCESS
*/
*/
#define fst_test_core_asr_close() \
#define fst_test_core_asr_close() \
fst_requires(fst_core); \
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Close recognizer\n"); \
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Close recognizer\n"); \
flags = SWITCH_ASR_FLAG_NONE; \
flags = SWITCH_ASR_FLAG_NONE; \
fst_requires(switch_core_asr_close(&ah, &flags) == SWITCH_STATUS_SUCCESS); \
fst_requires(switch_core_asr_close(&ah, &flags) == SWITCH_STATUS_SUCCESS); \
...
@@ -500,7 +541,8 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -500,7 +541,8 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
*/
*/
#define fst_play_and_detect_speech_test_begin() \
#define fst_play_and_detect_speech_test_begin() \
{ \
{ \
const char *fst_asr_result = NULL;
const char *fst_asr_result = NULL; \
fst_requires(fst_core);
/**
/**
* Use play_and_detect_speech APP to test recognizer
* Use play_and_detect_speech APP to test recognizer
...
@@ -524,6 +566,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -524,6 +566,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
#define fst_play_and_detect_speech_app_test(recognizer, grammar, prompt_filename, input_filename) \
#define fst_play_and_detect_speech_app_test(recognizer, grammar, prompt_filename, input_filename) \
{ \
{ \
char *args = NULL; \
char *args = NULL; \
fst_requires(fst_core); \
fst_requires_module("mod_dptools"); \
fst_requires_module("mod_dptools"); \
switch_channel_set_variable(fst_channel, "detect_speech_result", ""); \
switch_channel_set_variable(fst_channel, "detect_speech_result", ""); \
fst_requires(switch_ivr_displace_session(fst_session, input_filename, 0, "mr") == SWITCH_STATUS_SUCCESS); \
fst_requires(switch_ivr_displace_session(fst_session, input_filename, 0, "mr") == SWITCH_STATUS_SUCCESS); \
...
@@ -555,6 +598,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -555,6 +598,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
{ \
{ \
char *args = NULL; \
char *args = NULL; \
fst_asr_result = NULL; \
fst_asr_result = NULL; \
fst_requires(fst_core); \
fst_requires(switch_ivr_displace_session(fst_session, input_filename, 0, "mr") == SWITCH_STATUS_SUCCESS); \
fst_requires(switch_ivr_displace_session(fst_session, input_filename, 0, "mr") == SWITCH_STATUS_SUCCESS); \
switch_status_t status = switch_ivr_play_and_detect_speech(fst_session, prompt_filename, recognizer, grammar, (char **)&fst_asr_result, 0, input_args); \
switch_status_t status = switch_ivr_play_and_detect_speech(fst_session, prompt_filename, recognizer, grammar, (char **)&fst_asr_result, 0, input_args); \
fst_check(fst_asr_result != NULL); \
fst_check(fst_asr_result != NULL); \
...
@@ -580,6 +624,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
...
@@ -580,6 +624,7 @@ static void fst_init_core_and_modload(const char *confdir, const char *basedir)
{ \
{ \
switch_stream_handle_t stream = { 0 }; \
switch_stream_handle_t stream = { 0 }; \
SWITCH_STANDARD_STREAM(stream); \
SWITCH_STANDARD_STREAM(stream); \
fst_requires(fst_core); \
fst_requires_module("mod_commands"); \
fst_requires_module("mod_commands"); \
switch_status_t api_result = switch_api_execute("sched_api", switch_core_session_sprintf(fst_session, "%s none uuid_recv_dtmf %s %s", when, switch_core_session_get_uuid(fst_session), digits), NULL, &stream); \
switch_status_t api_result = switch_api_execute("sched_api", switch_core_session_sprintf(fst_session, "%s none uuid_recv_dtmf %s %s", when, switch_core_session_get_uuid(fst_session), digits), NULL, &stream); \
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fst_session), SWITCH_LOG_INFO, "Injecting DTMF %s at %s\n", digits, when); \
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fst_session), SWITCH_LOG_INFO, "Injecting DTMF %s at %s\n", digits, when); \
...
...
src/mod/event_handlers/mod_rayo/Makefile.am
浏览文件 @
2226c3c6
...
@@ -17,3 +17,5 @@ BUILT_SOURCES=$(IKS_LA)
...
@@ -17,3 +17,5 @@ BUILT_SOURCES=$(IKS_LA)
$(IKS_LA)
:
$(IKS_BUILDDIR) $(IKS_DIR) $(IKS_DIR)/.update
$(IKS_LA)
:
$(IKS_BUILDDIR) $(IKS_DIR) $(IKS_DIR)/.update
@
cd
$(IKS_BUILDDIR)
&&
$(MAKE)
@
cd
$(IKS_BUILDDIR)
&&
$(MAKE)
@
$(TOUCH_TARGET)
@
$(TOUCH_TARGET)
SUBDIRS
=
.
test
src/mod/event_handlers/mod_rayo/iks_helpers.h
浏览文件 @
2226c3c6
/*
/*
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2013, Grasshopper
* Copyright (C) 2013
-2018
, Grasshopper
*
*
* Version: MPL 1.1
* Version: MPL 1.1
*
*
...
@@ -51,50 +51,50 @@ struct xmpp_error {
...
@@ -51,50 +51,50 @@ struct xmpp_error {
#undef XMPP_ERROR
#undef XMPP_ERROR
#define XMPP_ERROR(def_name, name, type) \
#define XMPP_ERROR(def_name, name, type) \
extern const struct xmpp_error
def_name##_val; \
SWITCH_DECLARE(const struct xmpp_error)
def_name##_val; \
extern const struct xmpp_error *
def_name;
SWITCH_DECLARE(const struct xmpp_error *)
def_name;
#include "xmpp_errors.def"
#include "xmpp_errors.def"
/* See RFC-3920 XMPP core for error definitions */
/* See RFC-3920 XMPP core for error definitions */
extern
iks
*
iks_new_presence
(
const
char
*
name
,
const
char
*
namespace
,
const
char
*
from
,
const
char
*
to
);
SWITCH_DECLARE
(
iks
*
)
iks_new_presence
(
const
char
*
name
,
const
char
*
namespace
,
const
char
*
from
,
const
char
*
to
);
extern
iks
*
iks_new_error
(
iks
*
iq
,
const
struct
xmpp_error
*
err
);
SWITCH_DECLARE
(
iks
*
)
iks_new_error
(
iks
*
iq
,
const
struct
xmpp_error
*
err
);
extern
iks
*
iks_new_error_detailed
(
iks
*
iq
,
const
struct
xmpp_error
*
err
,
const
char
*
detail_text
);
SWITCH_DECLARE
(
iks
*
)
iks_new_error_detailed
(
iks
*
iq
,
const
struct
xmpp_error
*
err
,
const
char
*
detail_text
);
extern
iks
*
iks_new_error_detailed_printf
(
iks
*
iq
,
const
struct
xmpp_error
*
err
,
const
char
*
detail_text_format
,
...);
SWITCH_DECLARE
(
iks
*
)
iks_new_error_detailed_printf
(
iks
*
iq
,
const
struct
xmpp_error
*
err
,
const
char
*
detail_text_format
,
...);
extern
iks
*
iks_new_iq_result
(
iks
*
iq
);
SWITCH_DECLARE
(
iks
*
)
iks_new_iq_result
(
iks
*
iq
);
extern
const
char
*
iks_find_attrib_soft
(
iks
*
xml
,
const
char
*
attrib
);
SWITCH_DECLARE
(
const
char
*
)
iks_find_attrib_soft
(
iks
*
xml
,
const
char
*
attrib
);
extern
const
char
*
iks_find_attrib_default
(
iks
*
xml
,
const
char
*
attrib
,
const
char
*
def
);
SWITCH_DECLARE
(
const
char
*
)
iks_find_attrib_default
(
iks
*
xml
,
const
char
*
attrib
,
const
char
*
def
);
extern
int
iks_find_bool_attrib
(
iks
*
xml
,
const
char
*
attrib
);
SWITCH_DECLARE
(
int
)
iks_find_bool_attrib
(
iks
*
xml
,
const
char
*
attrib
);
extern
int
iks_find_int_attrib
(
iks
*
xml
,
const
char
*
attrib
);
SWITCH_DECLARE
(
int
)
iks_find_int_attrib
(
iks
*
xml
,
const
char
*
attrib
);
extern
char
iks_find_char_attrib
(
iks
*
xml
,
const
char
*
attrib
);
SWITCH_DECLARE
(
char
)
iks_find_char_attrib
(
iks
*
xml
,
const
char
*
attrib
);
extern
double
iks_find_decimal_attrib
(
iks
*
xml
,
const
char
*
attrib
);
SWITCH_DECLARE
(
double
)
iks_find_decimal_attrib
(
iks
*
xml
,
const
char
*
attrib
);
extern
const
char
*
iks_node_type_to_string
(
int
type
);
SWITCH_DECLARE
(
const
char
*
)
iks_node_type_to_string
(
int
type
);
extern
const
char
*
iks_net_error_to_string
(
int
err
);
SWITCH_DECLARE
(
const
char
*
)
iks_net_error_to_string
(
int
err
);
extern
iks
*
iks_insert_attrib_printf
(
iks
*
xml
,
const
char
*
name
,
const
char
*
fmt
,
...);
SWITCH_DECLARE
(
iks
*
)
iks_insert_attrib_printf
(
iks
*
xml
,
const
char
*
name
,
const
char
*
fmt
,
...);
extern
char
*
iks_server_dialback_key
(
const
char
*
secret
,
const
char
*
receiving_server
,
const
char
*
originating_server
,
const
char
*
stream_id
);
SWITCH_DECLARE
(
char
*
)
iks_server_dialback_key
(
const
char
*
secret
,
const
char
*
receiving_server
,
const
char
*
originating_server
,
const
char
*
stream_id
);
extern
void
iks_sha_print_base64
(
iksha
*
sha
,
char
*
buf
);
SWITCH_DECLARE
(
void
)
iks_sha_print_base64
(
iksha
*
sha
,
char
*
buf
);
/** A function to validate attribute value */
/** A function to validate attribute value */
typedef
int
(
*
iks_attrib_validation_function
)(
const
char
*
);
typedef
int
(
*
iks_attrib_validation_function
)(
const
char
*
);
extern
int
validate_optional_attrib
(
iks_attrib_validation_function
fn
,
const
char
*
attrib
);
SWITCH_DECLARE
(
int
)
validate_optional_attrib
(
iks_attrib_validation_function
fn
,
const
char
*
attrib
);
#define ELEMENT_DECL(name)
extern int
VALIDATE_##name(iks *node);
#define ELEMENT_DECL(name)
SWITCH_DECLARE(int)
VALIDATE_##name(iks *node);
#define ELEMENT(name) int VALIDATE_##name(iks *node) { int result = 1; if (!node) return 0;
#define ELEMENT(name) int VALIDATE_##name(iks *node) { int result = 1; if (!node) return 0;
#define ATTRIB(name, def, rule) result &= iks_attrib_is_##rule(iks_find_attrib_default(node, #name, #def));
#define ATTRIB(name, def, rule) result &= iks_attrib_is_##rule(iks_find_attrib_default(node, #name, #def));
#define OPTIONAL_ATTRIB(name, def, rule) result &= validate_optional_attrib(iks_attrib_is_##rule, iks_find_attrib_default(node, #name, #def));
#define OPTIONAL_ATTRIB(name, def, rule) result &= validate_optional_attrib(iks_attrib_is_##rule, iks_find_attrib_default(node, #name, #def));
#define STRING_ATTRIB(name, def, rule) result &= value_matches(iks_find_attrib_default(node, #name, #def), rule);
#define STRING_ATTRIB(name, def, rule) result &= value_matches(iks_find_attrib_default(node, #name, #def), rule);
#define ELEMENT_END return result; }
#define ELEMENT_END return result; }
extern
int
value_matches
(
const
char
*
value
,
const
char
*
rule
);
SWITCH_DECLARE
(
int
)
value_matches
(
const
char
*
value
,
const
char
*
rule
);
extern
int
iks_attrib_is_bool
(
const
char
*
value
);
SWITCH_DECLARE
(
int
)
iks_attrib_is_bool
(
const
char
*
value
);
extern
int
iks_attrib_is_not_negative
(
const
char
*
value
);
SWITCH_DECLARE
(
int
)
iks_attrib_is_not_negative
(
const
char
*
value
);
extern
int
iks_attrib_is_positive
(
const
char
*
value
);
SWITCH_DECLARE
(
int
)
iks_attrib_is_positive
(
const
char
*
value
);
extern
int
iks_attrib_is_positive_or_neg_one
(
const
char
*
value
);
SWITCH_DECLARE
(
int
)
iks_attrib_is_positive_or_neg_one
(
const
char
*
value
);
extern
int
iks_attrib_is_any
(
const
char
*
value
);
SWITCH_DECLARE
(
int
)
iks_attrib_is_any
(
const
char
*
value
);
extern
int
iks_attrib_is_decimal_between_zero_and_one
(
const
char
*
value
);
SWITCH_DECLARE
(
int
)
iks_attrib_is_decimal_between_zero_and_one
(
const
char
*
value
);
extern
int
iks_attrib_is_dtmf_digit
(
const
char
*
value
);
SWITCH_DECLARE
(
int
)
iks_attrib_is_dtmf_digit
(
const
char
*
value
);
#endif
#endif
...
...
src/mod/event_handlers/mod_rayo/mod_rayo.h
浏览文件 @
2226c3c6
/*
/*
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2013, Grasshopper
* Copyright (C) 2013
-2018
, Grasshopper
*
*
* Version: MPL 1.1
* Version: MPL 1.1
*
*
...
@@ -129,20 +129,20 @@ struct rayo_component {
...
@@ -129,20 +129,20 @@ struct rayo_component {
#define RAYO_CALL(x) ((struct rayo_call *)x)
#define RAYO_CALL(x) ((struct rayo_call *)x)
#define RAYO_MIXER(x) ((struct rayo_mixer *)x)
#define RAYO_MIXER(x) ((struct rayo_mixer *)x)
extern
void
rayo_message_send
(
struct
rayo_actor
*
from
,
const
char
*
to
,
iks
*
payload
,
int
dup
,
int
reply
,
const
char
*
file
,
int
line
);
SWITCH_DECLARE
(
void
)
rayo_message_send
(
struct
rayo_actor
*
from
,
const
char
*
to
,
iks
*
payload
,
int
dup
,
int
reply
,
const
char
*
file
,
int
line
);
extern
void
rayo_message_destroy
(
struct
rayo_message
*
msg
);
SWITCH_DECLARE
(
void
)
rayo_message_destroy
(
struct
rayo_message
*
msg
);
extern
iks
*
rayo_message_remove_payload
(
struct
rayo_message
*
msg
);
SWITCH_DECLARE
(
iks
*
)
rayo_message_remove_payload
(
struct
rayo_message
*
msg
);
#define RAYO_SEND_MESSAGE(from, to, payload) rayo_message_send(RAYO_ACTOR(from), to, payload, 0, 0, __FILE__, __LINE__)
#define RAYO_SEND_MESSAGE(from, to, payload) rayo_message_send(RAYO_ACTOR(from), to, payload, 0, 0, __FILE__, __LINE__)
#define RAYO_SEND_MESSAGE_DUP(from, to, payload) rayo_message_send(RAYO_ACTOR(from), to, payload, 1, 0, __FILE__, __LINE__)
#define RAYO_SEND_MESSAGE_DUP(from, to, payload) rayo_message_send(RAYO_ACTOR(from), to, payload, 1, 0, __FILE__, __LINE__)
#define RAYO_SEND_REPLY(from, to, payload) rayo_message_send(RAYO_ACTOR(from), to, payload, 0, 1, __FILE__, __LINE__)
#define RAYO_SEND_REPLY(from, to, payload) rayo_message_send(RAYO_ACTOR(from), to, payload, 0, 1, __FILE__, __LINE__)
#define RAYO_SEND_REPLY_DUP(from, to, payload) rayo_message_send(RAYO_ACTOR(from), to, payload, 1, 1, __FILE__, __LINE__)
#define RAYO_SEND_REPLY_DUP(from, to, payload) rayo_message_send(RAYO_ACTOR(from), to, payload, 1, 1, __FILE__, __LINE__)
extern
struct
rayo_actor
*
rayo_actor_locate
(
const
char
*
jid
,
const
char
*
file
,
int
line
);
SWITCH_DECLARE
(
struct
rayo_actor
*
)
rayo_actor_locate
(
const
char
*
jid
,
const
char
*
file
,
int
line
);
extern
struct
rayo_actor
*
rayo_actor_locate_by_id
(
const
char
*
id
,
const
char
*
file
,
int
line
);
SWITCH_DECLARE
(
struct
rayo_actor
*
)
rayo_actor_locate_by_id
(
const
char
*
id
,
const
char
*
file
,
int
line
);
extern
int
rayo_actor_seq_next
(
struct
rayo_actor
*
actor
);
SWITCH_DECLARE
(
int
)
rayo_actor_seq_next
(
struct
rayo_actor
*
actor
);
extern
void
rayo_actor_retain
(
struct
rayo_actor
*
actor
,
const
char
*
file
,
int
line
);
SWITCH_DECLARE
(
void
)
rayo_actor_retain
(
struct
rayo_actor
*
actor
,
const
char
*
file
,
int
line
);
extern
void
rayo_actor_release
(
struct
rayo_actor
*
actor
,
const
char
*
file
,
int
line
);
SWITCH_DECLARE
(
void
)
rayo_actor_release
(
struct
rayo_actor
*
actor
,
const
char
*
file
,
int
line
);
extern
void
rayo_actor_destroy
(
struct
rayo_actor
*
actor
,
const
char
*
file
,
int
line
);
SWITCH_DECLARE
(
void
)
rayo_actor_destroy
(
struct
rayo_actor
*
actor
,
const
char
*
file
,
int
line
);
#define RAYO_LOCATE(jid) rayo_actor_locate(jid, __FILE__, __LINE__)
#define RAYO_LOCATE(jid) rayo_actor_locate(jid, __FILE__, __LINE__)
#define RAYO_LOCATE_BY_ID(id) rayo_actor_locate_by_id(id, __FILE__, __LINE__)
#define RAYO_LOCATE_BY_ID(id) rayo_actor_locate_by_id(id, __FILE__, __LINE__)
...
@@ -156,21 +156,21 @@ extern void rayo_actor_destroy(struct rayo_actor *actor, const char *file, int l
...
@@ -156,21 +156,21 @@ extern void rayo_actor_destroy(struct rayo_actor *actor, const char *file, int l
#define RAYO_DESTROY(x) rayo_actor_destroy(RAYO_ACTOR(x), __FILE__, __LINE__)
#define RAYO_DESTROY(x) rayo_actor_destroy(RAYO_ACTOR(x), __FILE__, __LINE__)
#define RAYO_SEQ_NEXT(x) rayo_actor_seq_next(RAYO_ACTOR(x))
#define RAYO_SEQ_NEXT(x) rayo_actor_seq_next(RAYO_ACTOR(x))
extern
int
rayo_call_is_joined
(
struct
rayo_call
*
call
);
SWITCH_DECLARE
(
int
)
rayo_call_is_joined
(
struct
rayo_call
*
call
);
extern
int
rayo_call_is_faxing
(
struct
rayo_call
*
call
);
SWITCH_DECLARE
(
int
)
rayo_call_is_faxing
(
struct
rayo_call
*
call
);
extern
void
rayo_call_set_faxing
(
struct
rayo_call
*
call
,
int
faxing
);
SWITCH_DECLARE
(
void
)
rayo_call_set_faxing
(
struct
rayo_call
*
call
,
int
faxing
);
extern
const
char
*
rayo_call_get_dcp_jid
(
struct
rayo_call
*
call
);
SWITCH_DECLARE
(
const
char
*
)
rayo_call_get_dcp_jid
(
struct
rayo_call
*
call
);
#define rayo_mixer_get_name(mixer) RAYO_ID(mixer)
#define rayo_mixer_get_name(mixer) RAYO_ID(mixer)
#define rayo_component_init(component, pool, type, subtype, id, parent, client_jid) _rayo_component_init(component, pool, type, subtype, id, parent, client_jid, NULL, __FILE__, __LINE__)
#define rayo_component_init(component, pool, type, subtype, id, parent, client_jid) _rayo_component_init(component, pool, type, subtype, id, parent, client_jid, NULL, __FILE__, __LINE__)
#define rayo_component_init_cleanup(component, pool, type, subtype, id, parent, client_jid, cleanup) _rayo_component_init(component, pool, type, subtype, id, parent, client_jid, cleanup, __FILE__, __LINE__)
#define rayo_component_init_cleanup(component, pool, type, subtype, id, parent, client_jid, cleanup) _rayo_component_init(component, pool, type, subtype, id, parent, client_jid, cleanup, __FILE__, __LINE__)
extern
struct
rayo_component
*
_rayo_component_init
(
struct
rayo_component
*
component
,
switch_memory_pool_t
*
pool
,
const
char
*
type
,
const
char
*
subtype
,
const
char
*
id
,
struct
rayo_actor
*
parent
,
const
char
*
client_jid
,
rayo_actor_cleanup_fn
cleanup
,
const
char
*
file
,
int
line
);
SWITCH_DECLARE
(
struct
rayo_component
*
)
_rayo_component_init
(
struct
rayo_component
*
component
,
switch_memory_pool_t
*
pool
,
const
char
*
type
,
const
char
*
subtype
,
const
char
*
id
,
struct
rayo_actor
*
parent
,
const
char
*
client_jid
,
rayo_actor_cleanup_fn
cleanup
,
const
char
*
file
,
int
line
);
extern
switch_bool_t
is_component_actor
(
struct
rayo_actor
*
);
SWITCH_DECLARE
(
switch_bool_t
)
is_component_actor
(
struct
rayo_actor
*
);
typedef
iks
*
(
*
rayo_actor_xmpp_handler
)(
struct
rayo_actor
*
,
struct
rayo_message
*
,
void
*
);
typedef
iks
*
(
*
rayo_actor_xmpp_handler
)(
struct
rayo_actor
*
,
struct
rayo_message
*
,
void
*
);
extern
void
rayo_actor_command_handler_add
(
const
char
*
type
,
const
char
*
subtype
,
const
char
*
name
,
rayo_actor_xmpp_handler
fn
);
SWITCH_DECLARE
(
void
)
rayo_actor_command_handler_add
(
const
char
*
type
,
const
char
*
subtype
,
const
char
*
name
,
rayo_actor_xmpp_handler
fn
);
extern
void
rayo_actor_event_handler_add
(
const
char
*
from_type
,
const
char
*
from_subtype
,
const
char
*
to_type
,
const
char
*
to_subtype
,
const
char
*
name
,
rayo_actor_xmpp_handler
fn
);
SWITCH_DECLARE
(
void
)
rayo_actor_event_handler_add
(
const
char
*
from_type
,
const
char
*
from_subtype
,
const
char
*
to_type
,
const
char
*
to_subtype
,
const
char
*
name
,
rayo_actor_xmpp_handler
fn
);
#endif
#endif
...
...
src/mod/event_handlers/mod_rayo/nlsml.h
浏览文件 @
2226c3c6
/*
/*
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2013-201
4
, Grasshopper
* Copyright (C) 2013-201
8
, Grasshopper
*
*
* Version: MPL 1.1
* Version: MPL 1.1
*
*
...
@@ -39,12 +39,12 @@ enum nlsml_match_type {
...
@@ -39,12 +39,12 @@ enum nlsml_match_type {
NMT_NOMATCH
NMT_NOMATCH
};
};
extern
int
nlsml_init
(
void
);
SWITCH_DECLARE
(
int
)
nlsml_init
(
void
);
extern
void
nlsml_destroy
(
void
);
SWITCH_DECLARE
(
void
)
nlsml_destroy
(
void
);
enum
nlsml_match_type
nlsml_parse
(
const
char
*
result
,
const
char
*
uuid
);
SWITCH_DECLARE
(
enum
nlsml_match_type
)
nlsml_parse
(
const
char
*
result
,
const
char
*
uuid
);
iks
*
nlsml_normalize
(
const
char
*
result
);
SWITCH_DECLARE
(
iks
*
)
nlsml_normalize
(
const
char
*
result
);
extern
iks
*
nlsml_create_dtmf_match
(
const
char
*
digits
,
const
char
*
interpretation
);
SWITCH_DECLARE
(
iks
*
)
nlsml_create_dtmf_match
(
const
char
*
digits
,
const
char
*
interpretation
);
extern
iks
*
nlsml_create_match
(
const
char
*
digits
,
const
char
*
interpretation
,
const
char
*
mode
,
int
confidence
);
SWITCH_DECLARE
(
iks
*
)
nlsml_create_match
(
const
char
*
digits
,
const
char
*
interpretation
,
const
char
*
mode
,
int
confidence
);
#endif
#endif
...
...
src/mod/event_handlers/mod_rayo/rayo_components.h
浏览文件 @
2226c3c6
...
@@ -60,37 +60,37 @@
...
@@ -60,37 +60,37 @@
#define COMPONENT_COMPLETE_HANGUP "hangup", RAYO_EXT_COMPLETE_NS
#define COMPONENT_COMPLETE_HANGUP "hangup", RAYO_EXT_COMPLETE_NS
#define COMPONENT_COMPLETE_DONE "done", RAYO_EXT_COMPLETE_NS
#define COMPONENT_COMPLETE_DONE "done", RAYO_EXT_COMPLETE_NS
extern
switch_status_t
rayo_components_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_components_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
extern
switch_status_t
rayo_input_component_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_input_component_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
extern
switch_status_t
rayo_output_component_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_output_component_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
extern
switch_status_t
rayo_prompt_component_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_prompt_component_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
extern
switch_status_t
rayo_record_component_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_record_component_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
extern
switch_status_t
rayo_fax_components_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_fax_components_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
extern
switch_status_t
rayo_exec_component_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_exec_component_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
extern
switch_status_t
rayo_components_shutdown
(
void
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_components_shutdown
(
void
);
extern
switch_status_t
rayo_input_component_shutdown
(
void
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_input_component_shutdown
(
void
);
extern
switch_status_t
rayo_output_component_shutdown
(
void
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_output_component_shutdown
(
void
);
extern
switch_status_t
rayo_prompt_component_shutdown
(
void
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_prompt_component_shutdown
(
void
);
extern
switch_status_t
rayo_record_component_shutdown
(
void
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_record_component_shutdown
(
void
);
extern
switch_status_t
rayo_fax_components_shutdown
(
void
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_fax_components_shutdown
(
void
);
extern
switch_status_t
rayo_exec_component_shutdown
(
void
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_exec_component_shutdown
(
void
);
extern
void
rayo_component_send_start
(
struct
rayo_component
*
component
,
iks
*
iq
);
SWITCH_DECLARE
(
void
)
rayo_component_send_start
(
struct
rayo_component
*
component
,
iks
*
iq
);
extern
void
rayo_component_send_iq_error
(
struct
rayo_component
*
component
,
iks
*
iq
,
const
char
*
error_name
,
const
char
*
error_type
);
SWITCH_DECLARE
(
void
)
rayo_component_send_iq_error
(
struct
rayo_component
*
component
,
iks
*
iq
,
const
char
*
error_name
,
const
char
*
error_type
);
extern
void
rayo_component_send_iq_error_detailed
(
struct
rayo_component
*
component
,
iks
*
iq
,
const
char
*
error_name
,
const
char
*
error_type
,
const
char
*
detail
);
SWITCH_DECLARE
(
void
)
rayo_component_send_iq_error_detailed
(
struct
rayo_component
*
component
,
iks
*
iq
,
const
char
*
error_name
,
const
char
*
error_type
,
const
char
*
detail
);
extern
void
rayo_component_send_complete
(
struct
rayo_component
*
component
,
const
char
*
reason
,
const
char
*
reason_namespace
);
SWITCH_DECLARE
(
void
)
rayo_component_send_complete
(
struct
rayo_component
*
component
,
const
char
*
reason
,
const
char
*
reason_namespace
);
extern
void
rayo_component_send_complete_event
(
struct
rayo_component
*
component
,
iks
*
response
);
SWITCH_DECLARE
(
void
)
rayo_component_send_complete_event
(
struct
rayo_component
*
component
,
iks
*
response
);
extern
void
rayo_component_send_complete_with_metadata
(
struct
rayo_component
*
component
,
const
char
*
reason
,
const
char
*
reason_namespace
,
iks
*
meta
,
int
child_of_complete
);
SWITCH_DECLARE
(
void
)
rayo_component_send_complete_with_metadata
(
struct
rayo_component
*
component
,
const
char
*
reason
,
const
char
*
reason_namespace
,
iks
*
meta
,
int
child_of_complete
);
extern
void
rayo_component_send_complete_with_metadata_string
(
struct
rayo_component
*
component
,
const
char
*
reason
,
const
char
*
reason_namespace
,
const
char
*
meta
,
int
child_of_complete
);
SWITCH_DECLARE
(
void
)
rayo_component_send_complete_with_metadata_string
(
struct
rayo_component
*
component
,
const
char
*
reason
,
const
char
*
reason_namespace
,
const
char
*
meta
,
int
child_of_complete
);
extern
iks
*
rayo_component_create_complete_event
(
struct
rayo_component
*
component
,
const
char
*
reason
,
const
char
*
reason_namespace
);
SWITCH_DECLARE
(
iks
*
)
rayo_component_create_complete_event
(
struct
rayo_component
*
component
,
const
char
*
reason
,
const
char
*
reason_namespace
);
extern
iks
*
rayo_component_create_complete_event_with_metadata
(
struct
rayo_component
*
component
,
const
char
*
reason
,
const
char
*
reason_namespace
,
iks
*
meta
,
int
child_of_complete
);
SWITCH_DECLARE
(
iks
*
)
rayo_component_create_complete_event_with_metadata
(
struct
rayo_component
*
component
,
const
char
*
reason
,
const
char
*
reason_namespace
,
iks
*
meta
,
int
child_of_complete
);
extern
void
rayo_component_api_execute_async
(
struct
rayo_component
*
component
,
const
char
*
cmd
,
const
char
*
args
);
SWITCH_DECLARE
(
void
)
rayo_component_api_execute_async
(
struct
rayo_component
*
component
,
const
char
*
cmd
,
const
char
*
args
);
#define RAYO_COMPONENT_LOCATE(id) rayo_component_locate(id, __FILE__, __LINE__)
#define RAYO_COMPONENT_LOCATE(id) rayo_component_locate(id, __FILE__, __LINE__)
extern
struct
rayo_component
*
rayo_component_locate
(
const
char
*
id
,
const
char
*
file
,
int
line
);
SWITCH_DECLARE
(
struct
rayo_component
*
)
rayo_component_locate
(
const
char
*
id
,
const
char
*
file
,
int
line
);
#endif
#endif
...
...
src/mod/event_handlers/mod_rayo/rayo_cpa_component.h
浏览文件 @
2226c3c6
...
@@ -34,9 +34,9 @@
...
@@ -34,9 +34,9 @@
#include "mod_rayo.h"
#include "mod_rayo.h"
extern
switch_status_t
rayo_cpa_component_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_cpa_component_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
extern
void
rayo_cpa_component_shutdown
(
void
);
SWITCH_DECLARE
(
void
)
rayo_cpa_component_shutdown
(
void
);
extern
iks
*
rayo_cpa_component_start
(
struct
rayo_actor
*
call
,
struct
rayo_message
*
msg
,
void
*
session_data
);
SWITCH_DECLARE
(
iks
*
)
rayo_cpa_component_start
(
struct
rayo_actor
*
call
,
struct
rayo_message
*
msg
,
void
*
session_data
);
#endif
#endif
...
...
src/mod/event_handlers/mod_rayo/rayo_cpa_detector.h
浏览文件 @
2226c3c6
...
@@ -33,10 +33,10 @@
...
@@ -33,10 +33,10 @@
#include "mod_rayo.h"
#include "mod_rayo.h"
extern
switch_status_t
rayo_cpa_detector_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
SWITCH_DECLARE
(
switch_status_t
)
rayo_cpa_detector_load
(
switch_loadable_module_interface_t
**
module_interface
,
switch_memory_pool_t
*
pool
,
const
char
*
config_file
);
extern
void
rayo_cpa_detector_shutdown
(
void
);
SWITCH_DECLARE
(
void
)
rayo_cpa_detector_shutdown
(
void
);
extern
int
rayo_cpa_detector_start
(
const
char
*
call_uuid
,
const
char
*
signal_ns
,
const
char
**
error_detail
);
SWITCH_DECLARE
(
int
)
rayo_cpa_detector_start
(
const
char
*
call_uuid
,
const
char
*
signal_ns
,
const
char
**
error_detail
);
extern
void
rayo_cpa_detector_stop
(
const
char
*
call_uuid
,
const
char
*
signal_ns
);
SWITCH_DECLARE
(
void
)
rayo_cpa_detector_stop
(
const
char
*
call_uuid
,
const
char
*
signal_ns
);
#endif
#endif
...
...
src/mod/event_handlers/mod_rayo/sasl.h
浏览文件 @
2226c3c6
/*
/*
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2013, Grasshopper
* Copyright (C) 2013
-2018
, Grasshopper
*
*
* Version: MPL 1.1
* Version: MPL 1.1
*
*
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
#ifndef SASL_H
#ifndef SASL_H
#define SASL_H
#define SASL_H
extern
void
parse_plain_auth_message
(
const
char
*
message
,
char
**
authzid
,
char
**
authcid
,
char
**
password
);
SWITCH_DECLARE
(
void
)
parse_plain_auth_message
(
const
char
*
message
,
char
**
authzid
,
char
**
authcid
,
char
**
password
);
#endif
#endif
...
...
src/mod/event_handlers/mod_rayo/srgs.h
浏览文件 @
2226c3c6
/*
/*
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2013-201
4
, Grasshopper
* Copyright (C) 2013-201
8
, Grasshopper
*
*
* Version: MPL 1.1
* Version: MPL 1.1
*
*
...
@@ -45,15 +45,15 @@ enum srgs_match_type {
...
@@ -45,15 +45,15 @@ enum srgs_match_type {
SMT_MATCH_END
SMT_MATCH_END
};
};
extern
int
srgs_init
(
void
);
SWITCH_DECLARE
(
int
)
srgs_init
(
void
);
extern
void
srgs_destroy
(
void
);
SWITCH_DECLARE
(
void
)
srgs_destroy
(
void
);
extern
struct
srgs_parser
*
srgs_parser_new
(
const
char
*
uuid
);
SWITCH_DECLARE
(
struct
srgs_parser
*
)
srgs_parser_new
(
const
char
*
uuid
);
extern
struct
srgs_grammar
*
srgs_parse
(
struct
srgs_parser
*
parser
,
const
char
*
document
);
SWITCH_DECLARE
(
struct
srgs_grammar
*
)
srgs_parse
(
struct
srgs_parser
*
parser
,
const
char
*
document
);
extern
const
char
*
srgs_grammar_to_regex
(
struct
srgs_grammar
*
grammar
);
SWITCH_DECLARE
(
const
char
*
)
srgs_grammar_to_regex
(
struct
srgs_grammar
*
grammar
);
extern
const
char
*
srgs_grammar_to_jsgf
(
struct
srgs_grammar
*
grammar
);
SWITCH_DECLARE
(
const
char
*
)
srgs_grammar_to_jsgf
(
struct
srgs_grammar
*
grammar
);
extern
const
char
*
srgs_grammar_to_jsgf_file
(
struct
srgs_grammar
*
grammar
,
const
char
*
basedir
,
const
char
*
ext
);
SWITCH_DECLARE
(
const
char
*
)
srgs_grammar_to_jsgf_file
(
struct
srgs_grammar
*
grammar
,
const
char
*
basedir
,
const
char
*
ext
);
extern
enum
srgs_match_type
srgs_grammar_match
(
struct
srgs_grammar
*
grammar
,
const
char
*
input
,
const
char
**
interpretation
);
SWITCH_DECLARE
(
enum
srgs_match_type
)
srgs_grammar_match
(
struct
srgs_grammar
*
grammar
,
const
char
*
input
,
const
char
**
interpretation
);
extern
void
srgs_parser_destroy
(
struct
srgs_parser
*
parser
);
SWITCH_DECLARE
(
void
)
srgs_parser_destroy
(
struct
srgs_parser
*
parser
);
#endif
#endif
...
...
src/mod/event_handlers/mod_rayo/test.h
deleted
100644 → 0
浏览文件 @
e0b5df10
/*
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2013, Grasshopper
*
* 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 mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is Grasshopper
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Chris Rienzo <chris.rienzo@grasshopper.com>
*
* test.h -- simple unit testing macros
*
*/
#ifndef TEST_H
#define TEST_H
#define assert_equals(test, expected_str, expected, actual, file, line) \
{ \
int actual_val = actual; \
if (expected != actual_val) { \
printf("TEST\t%s\tFAIL\t%s\t%i\t!=\t%i\t%s:%i\n", test, expected_str, expected, actual_val, file, line); \
exit(1); \
} else { \
printf("TEST\t%s\tPASS\n", test); \
} \
}
#define assert_string_equals(test, expected, actual, file, line) \
{ \
const char *actual_str = actual; \
if (!actual_str || strcmp(expected, actual_str)) { \
printf("TEST\t%s\tFAIL\t\t%s\t!=\t%s\t%s:%i\n", test, expected, actual_str, file, line); \
exit(1); \
} else { \
printf("TEST\t%s\tPASS\n", test); \
} \
}
#define assert_not_null(test, actual, file, line) \
{ \
const void *actual_val = actual; \
if (!actual_val) { \
printf("TEST\t%s\tFAIL\t\t\t\t\t%s:%i\n", test, file, line); \
exit(1); \
} else { \
printf("TEST\t%s\tPASS\n", test); \
} \
}
#define assert_null(test, actual, file, line) \
{ \
const void *actual_val = actual; \
if (actual_val) { \
printf("TEST\t%s\tFAIL\t\t\t\t\t%s:%i\n", test, file, line); \
exit(1); \
} else { \
printf("TEST\t%s\tPASS\n", test); \
} \
}
#define ASSERT_EQUALS(expected, actual) assert_equals(#actual, #expected, expected, actual, __FILE__, __LINE__)
#define ASSERT_STRING_EQUALS(expected, actual) assert_string_equals(#actual, expected, actual, __FILE__, __LINE__)
#define ASSERT_NOT_NULL(actual) assert_not_null(#actual " not null", actual, __FILE__, __LINE__)
#define ASSERT_NULL(actual) assert_null(#actual " is null", actual, __FILE__, __LINE__)
#define SKIP_ASSERT_EQUALS(expected, actual) if (0) { ASSERT_EQUALS(expected, actual); }
#define TEST(name) printf("TEST BEGIN\t" #name "\n"); name(); printf("TEST END\t"#name "\tPASS\n");
#define SKIP_TEST(name) if (0) { TEST(name) };
#define TEST_INIT switch_core_init(0, SWITCH_TRUE, &err);
#endif
/* 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 noet
*/
src/mod/event_handlers/mod_rayo/test/Makefile.am
0 → 100644
浏览文件 @
2226c3c6
include
$(top_srcdir)/build/modmake.rulesam
bin_PROGRAMS
=
test_iks test_nlsml test_srgs
test_iks_CFLAGS
=
$(AM_CFLAGS)
-I
../
-I
$(switch_builddir)
/libs/iksemel/include
$(PCRE_CFLAGS)
test_iks_LDFLAGS
=
$(AM_LDFLAGS)
-avoid-version
-no-undefined
$(freeswitch_LDFLAGS)
../mod_rayo.la
$(switch_builddir)
/libfreeswitch.la
$(CORE_LIBS)
$(APR_LIBS)
test_nlsml_CFLAGS
=
$(AM_CFLAGS)
-I
../
-I
$(switch_builddir)
/libs/iksemel/include
$(PCRE_CFLAGS)
test_nlsml_LDFLAGS
=
$(AM_LDFLAGS)
-avoid-version
-no-undefined
$(freeswitch_LDFLAGS)
../mod_rayo.la
$(switch_builddir)
/libfreeswitch.la
$(CORE_LIBS)
$(APR_LIBS)
test_srgs_CFLAGS
=
$(AM_CFLAGS)
-I
../
-I
$(switch_builddir)
/libs/iksemel/include
$(PCRE_CFLAGS)
test_srgs_LDFLAGS
=
$(AM_LDFLAGS)
-avoid-version
-no-undefined
$(freeswitch_LDFLAGS)
../mod_rayo.la
$(switch_builddir)
/libfreeswitch.la
$(CORE_LIBS)
$(APR_LIBS)
TESTS
=
$(bin_PROGRAMS)
src/mod/event_handlers/mod_rayo/test
_iks/main
.c
→
src/mod/event_handlers/mod_rayo/test
/test_iks
.c
浏览文件 @
2226c3c6
差异被折叠。
点击展开。
src/mod/event_handlers/mod_rayo/test
_nlsml/main
.c
→
src/mod/event_handlers/mod_rayo/test
/test_nlsml
.c
浏览文件 @
2226c3c6
#include <switch.h>
#include <switch.h>
#include
"test.h"
#include
<test/switch_test.h>
#include
"nlsml.h"
#include
<nlsml.h>
static
const
char
*
nlsml_good
=
static
const
char
*
nlsml_good
=
"<result x-model=
\"
http://theYesNoModel
\"
"
"<result x-model=
\"
http://theYesNoModel
\"
"
...
@@ -224,22 +224,6 @@ static const char *nlsml_no_match =
...
@@ -224,22 +224,6 @@ static const char *nlsml_no_match =
" </interpretation>
\n
"
" </interpretation>
\n
"
"</result>
\n
"
;
"</result>
\n
"
;
/**
* Test parsing NLSML example results
*/
static
void
test_parse_nlsml_examples
(
void
)
{
ASSERT_EQUALS
(
NMT_MATCH
,
nlsml_parse
(
nlsml_good
,
"1234"
));
ASSERT_EQUALS
(
NMT_BAD_XML
,
nlsml_parse
(
nlsml_bad
,
"1234"
));
ASSERT_EQUALS
(
NMT_MATCH
,
nlsml_parse
(
nlsml_match_with_model_instance
,
"1234"
));
ASSERT_EQUALS
(
NMT_MATCH
,
nlsml_parse
(
nlsml_multi_input
,
"1234"
));
ASSERT_EQUALS
(
NMT_NOINPUT
,
nlsml_parse
(
nlsml_no_input
,
"1234"
));
ASSERT_EQUALS
(
NMT_MATCH
,
nlsml_parse
(
nlsml_multi_input_dtmf
,
"1234"
));
ASSERT_EQUALS
(
NMT_MATCH
,
nlsml_parse
(
nlsml_meta
,
"1234"
));
ASSERT_EQUALS
(
NMT_MATCH
,
nlsml_parse
(
nlsml_simple_ambiguity
,
"1234"
));
ASSERT_EQUALS
(
NMT_MATCH
,
nlsml_parse
(
nlsml_mixed_initiative
,
"1234"
));
ASSERT_EQUALS
(
NMT_NOMATCH
,
nlsml_parse
(
nlsml_no_match
,
"1234"
));
}
static
const
char
*
nlsml_dtmf_result
=
static
const
char
*
nlsml_dtmf_result
=
"<result xmlns='http://www.ietf.org/xml/ns/mrcpv2' "
"<result xmlns='http://www.ietf.org/xml/ns/mrcpv2' "
...
@@ -248,76 +232,105 @@ static const char *nlsml_dtmf_result =
...
@@ -248,76 +232,105 @@ static const char *nlsml_dtmf_result =
"<instance>1 2 3 4</instance>"
"<instance>1 2 3 4</instance>"
"</interpretation></result>"
;
"</interpretation></result>"
;
static
const
char
*
nlsml_good_normalized
=
"<result x-model='http://theYesNoModel'"
" xmlns:xf='http://www.w3.org/2000/xforms'"
" grammar='http://theYesNoGrammar'"
" xmlns='http://www.ietf.org/xml/ns/mrcpv2'>"
"<interpretation>"
"<xf:instance>"
"<myApp:yes_no>"
"<response>yes</response>"
"</myApp:yes_no>"
"</xf:instance>"
"<input>ok</input>"
"</interpretation>"
"</result>"
;
static
const
char
*
nlsml_dtmf_instance_result
=
"<result xmlns='http://www.ietf.org/xml/ns/mrcpv2' "
"xmlns:xf='http://www.w3.org/2000/xforms'><interpretation>"
"<input mode='dtmf' confidence='100'>1</input>"
"<instance>foo</instance>"
"</interpretation></result>"
;
FST_BEGIN
()
FST_SUITE_BEGIN
(
nlsml
)
FST_SETUP_BEGIN
()
{
fst_requires
(
nlsml_init
());
}
FST_SETUP_END
()
FST_TEARDOWN_BEGIN
()
{
}
FST_TEARDOWN_END
()
/**
* Test parsing NLSML example results
*/
FST_TEST_BEGIN
(
parse_nlsml_examples
)
{
fst_check
(
NMT_MATCH
==
nlsml_parse
(
nlsml_good
,
"1234"
));
fst_check
(
NMT_BAD_XML
==
nlsml_parse
(
nlsml_bad
,
"1234"
));
fst_check
(
NMT_MATCH
==
nlsml_parse
(
nlsml_match_with_model_instance
,
"1234"
));
fst_check
(
NMT_MATCH
==
nlsml_parse
(
nlsml_multi_input
,
"1234"
));
fst_check
(
NMT_NOINPUT
==
nlsml_parse
(
nlsml_no_input
,
"1234"
));
fst_check
(
NMT_MATCH
==
nlsml_parse
(
nlsml_multi_input_dtmf
,
"1234"
));
fst_check
(
NMT_MATCH
==
nlsml_parse
(
nlsml_meta
,
"1234"
));
fst_check
(
NMT_MATCH
==
nlsml_parse
(
nlsml_simple_ambiguity
,
"1234"
));
fst_check
(
NMT_MATCH
==
nlsml_parse
(
nlsml_mixed_initiative
,
"1234"
));
fst_check
(
NMT_NOMATCH
==
nlsml_parse
(
nlsml_no_match
,
"1234"
));
}
FST_TEST_END
()
/**
/**
* Test creating DTMF match result
* Test creating DTMF match result
*/
*/
static
void
test_create_dtmf_match
(
void
)
FST_TEST_BEGIN
(
create_dtmf_match
)
{
{
iks
*
result
=
nlsml_create_dtmf_match
(
"1234"
,
NULL
);
iks
*
result
=
nlsml_create_dtmf_match
(
"1234"
,
NULL
);
char
*
result_str
;
char
*
result_str
;
ASSERT_NOT_NULL
(
result
);
fst_requires
(
result
);
result_str
=
iks_string
(
NULL
,
result
);
result_str
=
iks_string
(
NULL
,
result
);
ASSERT_STRING_EQUALS
(
nlsml_dtmf_result
,
result_str
);
fst_check_string_equals
(
nlsml_dtmf_result
,
result_str
);
iks_free
(
result_str
);
iks_free
(
result_str
);
}
}
FST_TEST_END
()
static
const
char
*
nlsml_dtmf_instance_result
=
"<result xmlns='http://www.ietf.org/xml/ns/mrcpv2' "
"xmlns:xf='http://www.w3.org/2000/xforms'><interpretation>"
"<input mode='dtmf' confidence='100'>1</input>"
"<instance>foo</instance>"
"</interpretation></result>"
;
/**
/**
* Test creating DTMF match result with instance interpretation
* Test creating DTMF match result with instance interpretation
*/
*/
static
void
test_create_dtmf_instance
(
void
)
FST_TEST_BEGIN
(
create_dtmf_instance
)
{
{
iks
*
result
=
nlsml_create_dtmf_match
(
"1"
,
"foo"
);
iks
*
result
=
nlsml_create_dtmf_match
(
"1"
,
"foo"
);
char
*
result_str
;
char
*
result_str
;
ASSERT_NOT_NULL
(
result
);
fst_requires
(
result
);
result_str
=
iks_string
(
NULL
,
result
);
result_str
=
iks_string
(
NULL
,
result
);
ASSERT_STRING_EQUALS
(
nlsml_dtmf_instance_result
,
result_str
);
fst_check_string_equals
(
nlsml_dtmf_instance_result
,
result_str
);
iks_free
(
result_str
);
iks_free
(
result_str
);
}
}
FST_TEST_END
()
static
const
char
*
nlsml_good_normalized
=
"<result x-model='http://theYesNoModel'"
" xmlns:xf='http://www.w3.org/2000/xforms'"
" grammar='http://theYesNoGrammar'"
" xmlns='http://www.ietf.org/xml/ns/mrcpv2'>"
"<interpretation>"
"<xf:instance>"
"<myApp:yes_no>"
"<response>yes</response>"
"</myApp:yes_no>"
"</xf:instance>"
"<input>ok</input>"
"</interpretation>"
"</result>"
;
/**
/**
* Test NLSML normalization
* Test NLSML normalization
*/
*/
static
void
test_normalize
(
void
)
FST_TEST_BEGIN
(
normalize
)
{
{
iks
*
result
=
nlsml_normalize
(
nlsml_good
);
iks
*
result
=
nlsml_normalize
(
nlsml_good
);
ASSERT_NOT_NULL
(
result
);
fst_requires
(
result
);
ASSERT_STRING_EQUALS
(
nlsml_good_normalized
,
iks_string
(
NULL
,
result
));
fst_check_string_equals
(
nlsml_good_normalized
,
iks_string
(
NULL
,
result
));
}
}
FST_TEST_END
()
/**
* main program
*/
int
main
(
int
argc
,
char
**
argv
)
{
const
char
*
err
;
TEST_INIT
nlsml_init
();
TEST
(
test_parse_nlsml_examples
);
TEST
(
test_create_dtmf_match
);
TEST
(
test_create_dtmf_instance
);
TEST
(
test_normalize
);
return
0
;
}
FST_SUITE_END
()
FST_END
()
src/mod/event_handlers/mod_rayo/test
_srgs/main
.c
→
src/mod/event_handlers/mod_rayo/test
/test_srgs
.c
浏览文件 @
2226c3c6
差异被折叠。
点击展开。
src/mod/event_handlers/mod_rayo/test_iks/Makefile
deleted
100644 → 0
浏览文件 @
e0b5df10
BASE
=
../../../../..
IKS_DIR
=
$(BASE)
/libs/iksemel
IKS_LA
=
$(IKS_DIR)
/src/libiksemel.la
LOCAL_CFLAGS
+=
-I
../
-I
$(BASE)
/libs/iksemel/include
LOCAL_OBJS
=
$(PCRE_LA)
$(IKS_LA)
main.o ../iks_helpers.o
LOCAL_SOURCES
=
main.c
include
$(BASE)/build/modmake.rules
$(IKS_LA)
:
$(IKS_DIR) $(IKS_DIR)/.update
@
cd
$(IKS_DIR)
&&
$(MAKE)
@
$(TOUCH_TARGET)
local_all
:
libtool
--mode
=
link
gcc main.o ../iks_helpers.o
-o
test
test_iks.la
local_clean
:
-
rm test
src/mod/event_handlers/mod_rayo/test_iks/test_iks.c
deleted
100644 → 0
浏览文件 @
e0b5df10
int
dummy
(
int
i
)
{
return
0
;
}
src/mod/event_handlers/mod_rayo/test_nlsml/Makefile
deleted
100644 → 0
浏览文件 @
e0b5df10
BASE
=
../../../../..
IKS_DIR
=
$(BASE)
/libs/iksemel
IKS_LA
=
$(IKS_DIR)
/src/libiksemel.la
LOCAL_CFLAGS
+=
-I
../
-I
$(BASE)
/libs/iksemel/include
LOCAL_OBJS
=
$(PCRE_LA)
$(IKS_LA)
main.o ../nlsml.o ../iks_helpers.o
LOCAL_SOURCES
=
main.c
include
$(BASE)/build/modmake.rules
$(IKS_LA)
:
$(IKS_DIR) $(IKS_DIR)/.update
@
cd
$(IKS_DIR)
&&
$(MAKE)
@
$(TOUCH_TARGET)
local_all
:
libtool
--mode
=
link
gcc main.o ../nlsml.o ../iks_helpers.o test_nlsml.la ../../../../../.libs/libfreeswitch.la ../../../../../libs/iksemel/src/.libs/libiksemel.a
-lpcre
-lssl
-lcrypto
-g
-ggdb
-O2
-pthread
-o
test
local_clean
:
-
rm test
src/mod/event_handlers/mod_rayo/test_nlsml/test_nlsml.c
deleted
100644 → 0
浏览文件 @
e0b5df10
int
dummy
(
int
i
)
{
return
0
;
}
src/mod/event_handlers/mod_rayo/test_srgs/Makefile
deleted
100644 → 0
浏览文件 @
e0b5df10
BASE
=
../../../../..
IKS_DIR
=
$(BASE)
/libs/iksemel
IKS_LA
=
$(IKS_DIR)
/src/libiksemel.la
LOCAL_CFLAGS
+=
-I
../
-I
$(BASE)
/libs/iksemel/include
LOCAL_OBJS
=
$(PCRE_LA)
$(IKS_LA)
main.o ../srgs.o
LOCAL_SOURCES
=
main.c
include
$(BASE)/build/modmake.rules
$(IKS_LA)
:
$(IKS_DIR) $(IKS_DIR)/.update
@
cd
$(IKS_DIR)
&&
$(MAKE)
@
$(TOUCH_TARGET)
local_all
:
libtool
--mode
=
link
gcc main.o ../srgs.o
-o
test
test_srgs.la
local_clean
:
-
rm test
src/mod/event_handlers/mod_rayo/test_srgs/test_srgs.c
deleted
100644 → 0
浏览文件 @
e0b5df10
int
dummy
(
int
i
)
{
return
0
;
}
src/mod/event_handlers/mod_rayo/xmpp_streams.h
浏览文件 @
2226c3c6
/*
/*
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2013-201
5
, Grasshopper
* Copyright (C) 2013-201
8
, Grasshopper
*
*
* Version: MPL 1.1
* Version: MPL 1.1
*
*
...
@@ -37,22 +37,22 @@ typedef int (* xmpp_stream_ready_callback)(struct xmpp_stream *stream);
...
@@ -37,22 +37,22 @@ typedef int (* xmpp_stream_ready_callback)(struct xmpp_stream *stream);
typedef
void
(
*
xmpp_stream_recv_callback
)(
struct
xmpp_stream
*
stream
,
iks
*
stanza
);
typedef
void
(
*
xmpp_stream_recv_callback
)(
struct
xmpp_stream
*
stream
,
iks
*
stanza
);
typedef
void
(
*
xmpp_stream_destroy_callback
)(
struct
xmpp_stream
*
stream
);
typedef
void
(
*
xmpp_stream_destroy_callback
)(
struct
xmpp_stream
*
stream
);
extern
struct
xmpp_stream_context
*
xmpp_stream_context_create
(
const
char
*
domain
,
const
char
*
domain_secret
,
xmpp_stream_bind_callback
bind_cb
,
xmpp_stream_ready_callback
ready
,
xmpp_stream_recv_callback
recv
,
xmpp_stream_destroy_callback
destroy
);
SWITCH_DECLARE
(
struct
xmpp_stream_context
*
)
xmpp_stream_context_create
(
const
char
*
domain
,
const
char
*
domain_secret
,
xmpp_stream_bind_callback
bind_cb
,
xmpp_stream_ready_callback
ready
,
xmpp_stream_recv_callback
recv
,
xmpp_stream_destroy_callback
destroy
);
extern
void
xmpp_stream_context_add_cert
(
struct
xmpp_stream_context
*
context
,
const
char
*
cert_pem_file
);
SWITCH_DECLARE
(
void
)
xmpp_stream_context_add_cert
(
struct
xmpp_stream_context
*
context
,
const
char
*
cert_pem_file
);
extern
void
xmpp_stream_context_add_key
(
struct
xmpp_stream_context
*
context
,
const
char
*
key_pem_file
);
SWITCH_DECLARE
(
void
)
xmpp_stream_context_add_key
(
struct
xmpp_stream_context
*
context
,
const
char
*
key_pem_file
);
extern
void
xmpp_stream_context_add_user
(
struct
xmpp_stream_context
*
context
,
const
char
*
user
,
const
char
*
password
);
SWITCH_DECLARE
(
void
)
xmpp_stream_context_add_user
(
struct
xmpp_stream_context
*
context
,
const
char
*
user
,
const
char
*
password
);
extern
void
xmpp_stream_context_dump
(
struct
xmpp_stream_context
*
context
,
switch_stream_handle_t
*
stream
);
SWITCH_DECLARE
(
void
)
xmpp_stream_context_dump
(
struct
xmpp_stream_context
*
context
,
switch_stream_handle_t
*
stream
);
extern
void
xmpp_stream_context_destroy
(
struct
xmpp_stream_context
*
context
);
SWITCH_DECLARE
(
void
)
xmpp_stream_context_destroy
(
struct
xmpp_stream_context
*
context
);
extern
void
xmpp_stream_context_send
(
struct
xmpp_stream_context
*
context
,
const
char
*
jid
,
iks
*
stanza
);
SWITCH_DECLARE
(
void
)
xmpp_stream_context_send
(
struct
xmpp_stream_context
*
context
,
const
char
*
jid
,
iks
*
stanza
);
extern
switch_status_t
xmpp_stream_context_listen
(
struct
xmpp_stream_context
*
context
,
const
char
*
addr
,
int
port
,
int
is_s2s
,
const
char
*
acl
);
SWITCH_DECLARE
(
switch_status_t
)
xmpp_stream_context_listen
(
struct
xmpp_stream_context
*
context
,
const
char
*
addr
,
int
port
,
int
is_s2s
,
const
char
*
acl
);
extern
switch_status_t
xmpp_stream_context_connect
(
struct
xmpp_stream_context
*
context
,
const
char
*
peer_domain
,
const
char
*
peer_address
,
int
peer_port
);
SWITCH_DECLARE
(
switch_status_t
)
xmpp_stream_context_connect
(
struct
xmpp_stream_context
*
context
,
const
char
*
peer_domain
,
const
char
*
peer_address
,
int
peer_port
);
extern
int
xmpp_stream_is_s2s
(
struct
xmpp_stream
*
stream
);
SWITCH_DECLARE
(
int
)
xmpp_stream_is_s2s
(
struct
xmpp_stream
*
stream
);
extern
int
xmpp_stream_is_incoming
(
struct
xmpp_stream
*
stream
);
SWITCH_DECLARE
(
int
)
xmpp_stream_is_incoming
(
struct
xmpp_stream
*
stream
);
extern
const
char
*
xmpp_stream_get_jid
(
struct
xmpp_stream
*
stream
);
SWITCH_DECLARE
(
const
char
*
)
xmpp_stream_get_jid
(
struct
xmpp_stream
*
stream
);
extern
void
xmpp_stream_set_private
(
struct
xmpp_stream
*
stream
,
void
*
user_private
);
SWITCH_DECLARE
(
void
)
xmpp_stream_set_private
(
struct
xmpp_stream
*
stream
,
void
*
user_private
);
extern
void
*
xmpp_stream_get_private
(
struct
xmpp_stream
*
stream
);
SWITCH_DECLARE
(
void
*
)
xmpp_stream_get_private
(
struct
xmpp_stream
*
stream
);
#endif
#endif
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论