Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
c15c0924
提交
c15c0924
authored
6月 25, 2013
作者:
Chris Rienzo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mod_rayo: added message delivery threads
上级
0f0f2781
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
172 行增加
和
114 行删除
+172
-114
mod_rayo.c
src/mod/event_handlers/mod_rayo/mod_rayo.c
+154
-96
mod_rayo.h
src/mod/event_handlers/mod_rayo/mod_rayo.h
+9
-9
rayo_components.c
src/mod/event_handlers/mod_rayo/rayo_components.c
+2
-2
rayo_input_component.c
src/mod/event_handlers/mod_rayo/rayo_input_component.c
+1
-1
rayo_prompt_component.c
src/mod/event_handlers/mod_rayo/rayo_prompt_component.c
+6
-6
没有找到文件。
src/mod/event_handlers/mod_rayo/mod_rayo.c
浏览文件 @
c15c0924
差异被折叠。
点击展开。
src/mod/event_handlers/mod_rayo/mod_rayo.h
浏览文件 @
c15c0924
...
...
@@ -64,14 +64,17 @@ struct rayo_component;
*/
struct
rayo_message
{
iks
*
payload
;
char
*
to_jid
;
char
*
from_jid
;
char
*
from_type
;
char
*
from_subtype
;
int
is_reply
;
char
*
file
;
int
line
;
};
typedef
void
(
*
rayo_actor_cleanup_fn
)(
struct
rayo_actor
*
);
typedef
void
(
*
rayo_actor_send_fn
)(
struct
rayo_actor
*
,
struct
rayo_message
*
,
const
char
*
file
,
int
line
);
typedef
void
(
*
rayo_actor_send_fn
)(
struct
rayo_actor
*
,
struct
rayo_message
*
);
/**
* A rayo actor - this is an entity that can be controlled by a rayo client
...
...
@@ -126,19 +129,17 @@ struct rayo_component {
#define RAYO_CALL(x) ((struct rayo_call *)x)
#define RAYO_MIXER(x) ((struct rayo_mixer *)x)
extern
struct
rayo_message
*
rayo_message_create
(
struct
rayo_actor
*
from
,
iks
*
xml
,
int
dup
,
int
reply
);
extern
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
);
extern
iks
*
rayo_message_remove_payload
(
struct
rayo_message
*
msg
);
#define RAYO_MESSAGE_CREATE(from, msg) rayo_message_create(RAYO_ACTOR(from), msg, 0, 0)
#define RAYO_MESSAGE_CREATE_DUP(from, msg) rayo_message_create(RAYO_ACTOR(from), msg, 1, 0)
#define RAYO_REPLY_CREATE(from, msg) rayo_message_create(RAYO_ACTOR(from), msg, 0, 1)
#define RAYO_REPLY_CREATE_DUP(from, msg) rayo_message_create(RAYO_ACTOR(from), msg, 1, 1)
#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_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__)
extern
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
);
extern
int
rayo_actor_seq_next
(
struct
rayo_actor
*
actor
);
extern
void
rayo_actor_send
(
const
char
*
jid
,
struct
rayo_message
*
msg
,
const
char
*
file
,
int
line
);
extern
void
rayo_actor_rdlock
(
struct
rayo_actor
*
actor
,
const
char
*
file
,
int
line
);
extern
void
rayo_actor_unlock
(
struct
rayo_actor
*
actor
,
const
char
*
file
,
int
line
);
extern
void
rayo_actor_destroy
(
struct
rayo_actor
*
actor
,
const
char
*
file
,
int
line
);
...
...
@@ -154,7 +155,6 @@ extern void rayo_actor_destroy(struct rayo_actor *actor, const char *file, int l
#define RAYO_UNLOCK(x) rayo_actor_unlock(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_SEND(to, msg) rayo_actor_send(to, msg, __FILE__, __LINE__)
extern
const
char
*
rayo_call_get_dcp_jid
(
struct
rayo_call
*
call
);
...
...
src/mod/event_handlers/mod_rayo/rayo_components.c
浏览文件 @
c15c0924
...
...
@@ -63,7 +63,7 @@ void rayo_component_send_start(struct rayo_component *component, iks *iq)
#else
iks_insert_attrib_printf
(
ref
,
"uri"
,
"xmpp:%s"
,
RAYO_JID
(
component
));
#endif
RAYO_SEND
(
iks_find_attrib
(
response
,
"to"
),
RAYO_REPLY_CREATE
(
component
,
response
)
);
RAYO_SEND
_REPLY
(
component
,
iks_find_attrib
(
response
,
"to"
),
response
);
}
/**
...
...
@@ -116,7 +116,7 @@ iks *rayo_component_create_complete_event(struct rayo_component *component, cons
*/
void
rayo_component_send_complete_event
(
struct
rayo_component
*
component
,
iks
*
response
)
{
RAYO_SEND
(
iks_find_attrib
(
response
,
"to"
),
RAYO_REPLY_CREATE
(
component
,
response
)
);
RAYO_SEND
_REPLY
(
component
,
iks_find_attrib
(
response
,
"to"
),
response
);
RAYO_UNLOCK
(
component
);
RAYO_DESTROY
(
component
);
}
...
...
src/mod/event_handlers/mod_rayo/rayo_input_component.c
浏览文件 @
c15c0924
...
...
@@ -187,7 +187,7 @@ static void send_barge_event(struct rayo_component *component)
iks_insert_attrib
(
event
,
"to"
,
component
->
client_jid
);
x
=
iks_insert
(
event
,
"start-of-input"
);
iks_insert_attrib
(
x
,
"xmlns"
,
RAYO_INPUT_NS
);
RAYO_SEND
(
component
->
client_jid
,
RAYO_REPLY_CREATE
(
component
,
event
)
);
RAYO_SEND
_REPLY
(
component
,
component
->
client_jid
,
event
);
}
/**
...
...
src/mod/event_handlers/mod_rayo/rayo_prompt_component.c
浏览文件 @
c15c0924
...
...
@@ -99,7 +99,7 @@ static void rayo_component_send_stop(struct rayo_actor *from, const char *to)
iks_insert_attrib_printf
(
stop
,
"id"
,
"mod_rayo-%d"
,
RAYO_SEQ_NEXT
(
from
));
x
=
iks_insert
(
stop
,
"stop"
);
iks_insert_attrib
(
x
,
"xmlns"
,
RAYO_EXT_NS
);
RAYO_SEND
(
to
,
RAYO_MESSAGE_CREATE
(
from
,
stop
)
);
RAYO_SEND
_MESSAGE
(
from
,
to
,
stop
);
}
/**
...
...
@@ -118,7 +118,7 @@ static void start_input(struct prompt_component *prompt, int start_timers, int b
iks_insert_attrib
(
input
,
"start-timers"
,
start_timers
?
"true"
:
"false"
);
iks_insert_attrib
(
input
,
"barge-event"
,
barge_event
?
"true"
:
"false"
);
iks_insert_node
(
iq
,
input
);
RAYO_SEND
(
RAYO_JID
(
RAYO_COMPONENT
(
prompt
)
->
parent
),
RAYO_MESSAGE_CREATE
(
prompt
,
iq
)
);
RAYO_SEND
_MESSAGE
(
prompt
,
RAYO_JID
(
RAYO_COMPONENT
(
prompt
)
->
parent
),
iq
);
}
/**
...
...
@@ -134,7 +134,7 @@ static void start_input_timers(struct prompt_component *prompt)
iks_insert_attrib_printf
(
iq
,
"id"
,
"mod_rayo-%d"
,
RAYO_SEQ_NEXT
(
prompt
));
x
=
iks_insert
(
iq
,
"start-timers"
);
iks_insert_attrib
(
x
,
"xmlns"
,
RAYO_INPUT_NS
);
RAYO_SEND
(
prompt
->
input_jid
,
RAYO_MESSAGE_CREATE
(
prompt
,
iq
)
);
RAYO_SEND
_MESSAGE
(
prompt
,
prompt
->
input_jid
,
iq
);
}
/**
...
...
@@ -317,7 +317,7 @@ static iks *prompt_component_handle_output_error(struct rayo_actor *prompt, stru
iks_insert_attrib
(
iq
,
"from"
,
RAYO_JID
(
RAYO_COMPONENT
(
prompt
)
->
parent
));
iks_insert_attrib
(
iq
,
"to"
,
RAYO_COMPONENT
(
prompt
)
->
client_jid
);
iks_insert_node
(
iq
,
iks_copy_within
(
error
,
iks_stack
(
iq
)));
RAYO_SEND
(
RAYO_COMPONENT
(
prompt
)
->
client_jid
,
RAYO_REPLY_CREATE
(
prompt
,
iq
)
);
RAYO_SEND
_REPLY
(
prompt
,
RAYO_COMPONENT
(
prompt
)
->
client_jid
,
iq
);
/* done */
RAYO_UNLOCK
(
prompt
);
...
...
@@ -516,7 +516,7 @@ static iks *start_call_prompt_component(struct rayo_actor *call, struct rayo_mes
iks_insert_attrib
(
cmd
,
"type"
,
"set"
);
output
=
iks_copy_within
(
output
,
iks_stack
(
cmd
));
iks_insert_node
(
cmd
,
output
);
RAYO_SEND
(
RAYO_JID
(
call
),
RAYO_MESSAGE_CREATE
(
prompt_component
,
cmd
)
);
RAYO_SEND
_MESSAGE
(
prompt_component
,
RAYO_JID
(
call
),
cmd
);
return
NULL
;
}
...
...
@@ -583,7 +583,7 @@ static iks *forward_output_component_request(struct rayo_actor *prompt, struct r
/* forward request to output component */
iks_insert_attrib
(
iq
,
"from"
,
RAYO_JID
(
prompt
));
iks_insert_attrib
(
iq
,
"to"
,
RAYO_JID
(
PROMPT_COMPONENT
(
prompt
)
->
output_jid
));
RAYO_SEND
(
PROMPT_COMPONENT
(
prompt
)
->
output_jid
,
RAYO_MESSAGE_CREATE_DUP
(
prompt
,
iq
)
);
RAYO_SEND
_MESSAGE_DUP
(
prompt
,
PROMPT_COMPONENT
(
prompt
)
->
output_jid
,
iq
);
return
NULL
;
}
case
PCS_START_INPUT_TIMERS
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论