Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
360ef648
提交
360ef648
authored
1月 31, 2014
作者:
Chris Rienzo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-6171 mod_rayo: added support for normal/groupchat/headline message types for console testing
上级
4380453a
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
7 行删除
+10
-7
mod_rayo.c
src/mod/event_handlers/mod_rayo/mod_rayo.c
+10
-7
没有找到文件。
src/mod/event_handlers/mod_rayo/mod_rayo.c
浏览文件 @
360ef648
...
@@ -4006,14 +4006,14 @@ static int alias_api(struct rayo_cmd_alias *alias, char *args, switch_stream_han
...
@@ -4006,14 +4006,14 @@ static int alias_api(struct rayo_cmd_alias *alias, char *args, switch_stream_han
/**
/**
* Send message from console
* Send message from console
*/
*/
static
void
send_console_message
(
struct
rayo_client
*
client
,
const
char
*
to
,
const
char
*
message_str
)
static
void
send_console_message
(
struct
rayo_client
*
client
,
const
char
*
to
,
const
char
*
type
,
const
char
*
message_str
)
{
{
iks
*
message
=
NULL
,
*
x
;
iks
*
message
=
NULL
,
*
x
;
message
=
iks_new
(
"message"
);
message
=
iks_new
(
"message"
);
iks_insert_attrib
(
message
,
"to"
,
to
);
iks_insert_attrib
(
message
,
"to"
,
to
);
iks_insert_attrib
(
message
,
"from"
,
RAYO_JID
(
client
));
iks_insert_attrib
(
message
,
"from"
,
RAYO_JID
(
client
));
iks_insert_attrib_printf
(
message
,
"id"
,
"console-%i"
,
RAYO_SEQ_NEXT
(
client
));
iks_insert_attrib_printf
(
message
,
"id"
,
"console-%i"
,
RAYO_SEQ_NEXT
(
client
));
iks_insert_attrib
(
message
,
"type"
,
"chat"
);
iks_insert_attrib
(
message
,
"type"
,
type
);
x
=
iks_insert
(
message
,
"body"
);
x
=
iks_insert
(
message
,
"body"
);
iks_insert_cdata
(
x
,
message_str
,
strlen
(
message_str
));
iks_insert_cdata
(
x
,
message_str
,
strlen
(
message_str
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"
\n
SEND: to %s, %s
\n
"
,
to
,
iks_string
(
iks_stack
(
message
),
message
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"
\n
SEND: to %s, %s
\n
"
,
to
,
iks_string
(
iks_stack
(
message
),
message
));
...
@@ -4025,10 +4025,10 @@ static void send_console_message(struct rayo_client *client, const char *to, con
...
@@ -4025,10 +4025,10 @@ static void send_console_message(struct rayo_client *client, const char *to, con
*/
*/
static
int
message_api
(
char
*
cmd
,
switch_stream_handle_t
*
stream
)
static
int
message_api
(
char
*
cmd
,
switch_stream_handle_t
*
stream
)
{
{
char
*
argv
[
2
]
=
{
0
};
char
*
argv
[
3
]
=
{
0
};
if
(
!
zstr
(
cmd
))
{
if
(
!
zstr
(
cmd
))
{
int
argc
=
switch_separate_string
(
cmd
,
' '
,
argv
,
sizeof
(
argv
)
/
sizeof
(
argv
[
0
]));
int
argc
=
switch_separate_string
(
cmd
,
' '
,
argv
,
sizeof
(
argv
)
/
sizeof
(
argv
[
0
]));
if
(
argc
!=
2
)
{
if
(
argc
!=
3
)
{
return
0
;
return
0
;
}
}
}
else
{
}
else
{
...
@@ -4036,7 +4036,7 @@ static int message_api(char *cmd, switch_stream_handle_t *stream)
...
@@ -4036,7 +4036,7 @@ static int message_api(char *cmd, switch_stream_handle_t *stream)
}
}
/* send message */
/* send message */
send_console_message
(
globals
.
console
,
argv
[
0
],
argv
[
1
]);
send_console_message
(
globals
.
console
,
argv
[
0
],
argv
[
1
]
,
argv
[
2
]
);
stream
->
write_function
(
stream
,
"+OK
\n
"
);
stream
->
write_function
(
stream
,
"+OK
\n
"
);
return
1
;
return
1
;
...
@@ -4383,8 +4383,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_rayo_load)
...
@@ -4383,8 +4383,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_rayo_load)
globals
.
console
=
rayo_console_client_create
();
globals
.
console
=
rayo_console_client_create
();
switch_console_set_complete
(
"add rayo status"
);
switch_console_set_complete
(
"add rayo status"
);
switch_console_set_complete
(
"add rayo msg ::rayo::list_external"
);
switch_console_set_complete
(
"add rayo msg ::rayo::list_all"
);
switch_console_set_complete
(
"add rayo cmd ::rayo::list_all"
);
switch_console_set_complete
(
"add rayo msg ::rayo::list_all chat"
);
switch_console_set_complete
(
"add rayo msg ::rayo::list_all groupchat"
);
switch_console_set_complete
(
"add rayo msg ::rayo::list_all headline"
);
switch_console_set_complete
(
"add rayo msg ::rayo::list_all normal"
);
switch_console_set_complete
(
"add rayo presence ::rayo::list_server online"
);
switch_console_set_complete
(
"add rayo presence ::rayo::list_server online"
);
switch_console_set_complete
(
"add rayo presence ::rayo::list_server offline"
);
switch_console_set_complete
(
"add rayo presence ::rayo::list_server offline"
);
switch_console_add_complete_func
(
"::rayo::list_all"
,
list_all
);
switch_console_add_complete_func
(
"::rayo::list_all"
,
list_all
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论