Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
9d44ed04
提交
9d44ed04
authored
7月 17, 2010
作者:
Andrew Thompson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make XML fetch reply ACKs distinguishable, update freeswitch.erl
上级
1277ac47
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
25 行增加
和
5 行删除
+25
-5
freeswitch.erl
src/mod/event_handlers/mod_erlang_event/freeswitch.erl
+14
-3
handle_msg.c
src/mod/event_handlers/mod_erlang_event/handle_msg.c
+6
-2
mod_erlang_event.c
src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c
+5
-0
没有找到文件。
src/mod/event_handlers/mod_erlang_event/freeswitch.erl
浏览文件 @
9d44ed04
...
...
@@ -19,7 +19,7 @@
get_event_header
/
2
,
get_event_body
/
1
,
get_event_name
/
1
,
getpid
/
1
,
sendmsg
/
3
,
sendevent
/
3
,
sendevent_custom
/
3
,
handlecall
/
2
,
handlecall
/
3
,
start_fetch_handler
/
5
,
start_log_handler
/
4
,
start_event_handler
/
4
]).
start_log_handler
/
4
,
start_event_handler
/
4
,
fetch_reply
/
3
]).
-
define
(
TIMEOUT
,
5000
).
%% @doc Return the value for a specific header in an event or `{error,notfound}'.
...
...
@@ -55,9 +55,21 @@ send(Node, Term) ->
Response
->
Response
after
?
TIMEOUT
->
timeout
timeout
end
.
fetch_reply
(
Node
,
FetchID
,
Reply
)
->
{
send
,
Node
}
!
{
fetch_reply
,
FetchID
,
Reply
},
receive
{
ok
,
FetchID
}
->
ok
;
{
error
,
FetchID
,
Reason
}
->
{
error
,
Reason
}
after
?
TIMEOUT
->
timeout
end
.
%% @doc Make a blocking API call to FreeSWITCH. The result of the API call is
%% returned or `timeout' if FreeSWITCH fails to respond.
api
(
Node
,
Cmd
,
Args
)
->
...
...
@@ -268,7 +280,6 @@ start_handler(Node, Type, Module, Function, State) ->
{
foo
,
Node
}
!
Type
,
receive
ok
->
io
:
format
(
"OK!!!!!!!
~n
"
),
Self
!
{
Type
,
{
ok
,
self
()}},
apply
(
Module
,
Function
,
[
Node
,
State
]);
{
error
,
Reason
}
->
...
...
src/mod/event_handlers/mod_erlang_event/handle_msg.c
浏览文件 @
9d44ed04
...
...
@@ -205,18 +205,22 @@ static switch_status_t handle_msg_fetch_reply(listener_t *listener, ei_x_buff *
/* Relay the status back to the fetch responder. */
if
(
status
==
is_waiting
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Found waiting slot for %s
\n
"
,
uuid_str
);
ei_x_encode_tuple_header
(
rbuf
,
2
);
ei_x_encode_atom
(
rbuf
,
"ok"
);
_ei_x_encode_string
(
rbuf
,
uuid_str
);
/* Return here to avoid freeing the reply. */
return
SWITCH_STATUS_SUCCESS
;
}
else
if
(
status
==
is_timeout
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Handler for %s timed out
\n
"
,
uuid_str
);
ei_x_encode_tuple_header
(
rbuf
,
2
);
ei_x_encode_tuple_header
(
rbuf
,
3
);
ei_x_encode_atom
(
rbuf
,
"error"
);
_ei_x_encode_string
(
rbuf
,
uuid_str
);
ei_x_encode_atom
(
rbuf
,
"timeout"
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Found filled slot for %s
\n
"
,
uuid_str
);
ei_x_encode_tuple_header
(
rbuf
,
2
);
ei_x_encode_tuple_header
(
rbuf
,
3
);
ei_x_encode_atom
(
rbuf
,
"error"
);
_ei_x_encode_string
(
rbuf
,
uuid_str
);
ei_x_encode_atom
(
rbuf
,
"duplicate_response"
);
}
}
else
{
...
...
src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c
浏览文件 @
9d44ed04
...
...
@@ -460,6 +460,11 @@ static switch_xml_t erlang_fetch(const char *sectionstr, const char *tag_name, c
ei_get_type
(
rep
->
buff
,
&
rep
->
index
,
&
type
,
&
size
);
if
(
type
==
ERL_NIL_EXT
)
{
// empty string returned
goto
cleanup
;
}
if
(
type
!=
ERL_STRING_EXT
&&
type
!=
ERL_BINARY_EXT
)
{
/* XXX no unicode or character codes > 255 */
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"XML fetch response contained non ASCII characters? (was type %d of size %d)
\n
"
,
type
,
size
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论