Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
2ae688a3
提交
2ae688a3
authored
9月 06, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add sendmsg function to esl
上级
96ddc51f
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
51 行增加
和
0 行删除
+51
-0
esl.c
libs/esl/src/esl.c
+33
-0
esl_oop.cpp
libs/esl/src/esl_oop.cpp
+9
-0
esl.h
libs/esl/src/include/esl.h
+8
-0
esl_oop.h
libs/esl/src/include/esl_oop.h
+1
-0
没有找到文件。
libs/esl/src/esl.c
浏览文件 @
2ae688a3
...
...
@@ -534,6 +534,39 @@ ESL_DECLARE(esl_status_t) esl_execute(esl_handle_t *handle, const char *app, con
}
ESL_DECLARE
(
esl_status_t
)
esl_sendmsg
(
esl_handle_t
*
handle
,
esl_event_t
*
event
,
const
char
*
uuid
)
{
char
cmd_buf
[
128
]
=
"sendmsg"
;
char
send_buf
[
1292
]
=
""
;
char
*
txt
;
if
(
!
handle
||
!
handle
->
connected
||
handle
->
sock
==
ESL_SOCK_INVALID
)
{
return
ESL_FAIL
;
}
if
(
uuid
)
{
snprintf
(
cmd_buf
,
sizeof
(
cmd_buf
),
"sendmsg %s"
,
uuid
);
}
esl_event_serialize
(
event
,
&
txt
,
ESL_FALSE
);
esl_log
(
ESL_LOG_DEBUG
,
"SENDMSG
\n
%s
\n
"
,
txt
);
if
(
send
(
handle
->
sock
,
txt
,
strlen
(
txt
),
0
)
<=
0
)
goto
fail
;
free
(
txt
);
return
esl_recv
(
handle
);
fail
:
handle
->
connected
=
0
;
free
(
txt
);
return
ESL_FAIL
;
}
ESL_DECLARE
(
esl_status_t
)
esl_filter
(
esl_handle_t
*
handle
,
const
char
*
header
,
const
char
*
value
)
{
char
send_buf
[
1024
]
=
""
;
...
...
libs/esl/src/esl_oop.cpp
浏览文件 @
2ae688a3
...
...
@@ -205,6 +205,15 @@ ESLevent *ESLconnection::sendEvent(ESLevent *send_me)
return
new
ESLevent
(
"server_disconnected"
);
}
int
ESLconnection
::
sendMSG
(
ESLevent
*
send_me
,
const
char
*
uuid
)
{
if
(
esl_sendmsg
(
&
handle
,
send_me
->
event
,
uuid
)
==
ESL_SUCCESS
)
{
return
0
;
}
return
1
;
}
ESLevent
*
ESLconnection
::
recvEvent
()
{
if
(
esl_recv_event
(
&
handle
,
1
,
NULL
)
==
ESL_SUCCESS
)
{
...
...
libs/esl/src/include/esl.h
浏览文件 @
2ae688a3
...
...
@@ -397,6 +397,14 @@ ESL_DECLARE(esl_status_t) esl_execute(esl_handle_t *handle, const char *app, con
*/
ESL_DECLARE
(
esl_status_t
)
esl_sendevent
(
esl_handle_t
*
handle
,
esl_event_t
*
event
);
/*!
\brief Send an event as a message to be parsed
\param handle Handle to which the event should be sent
\param event Event to be sent
\param uuid a specific uuid if not the default
*/
ESL_DECLARE
(
esl_status_t
)
esl_sendmsg
(
esl_handle_t
*
handle
,
esl_event_t
*
event
,
const
char
*
uuid
);
/*!
\brief Connect a handle to a host/port with a specific password. This will also authenticate against the server
\param handle Handle to connect
...
...
libs/esl/src/include/esl_oop.h
浏览文件 @
2ae688a3
...
...
@@ -86,6 +86,7 @@ class ESLconnection {
ESLevent
*
api
(
const
char
*
cmd
,
const
char
*
arg
=
NULL
);
ESLevent
*
bgapi
(
const
char
*
cmd
,
const
char
*
arg
=
NULL
,
const
char
*
job_uuid
=
NULL
);
ESLevent
*
sendEvent
(
ESLevent
*
send_me
);
int
sendMSG
(
ESLevent
*
send_me
,
const
char
*
uuid
=
NULL
);
ESLevent
*
recvEvent
();
ESLevent
*
recvEventTimed
(
int
ms
);
ESLevent
*
filter
(
const
char
*
header
,
const
char
*
value
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论