Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
61aa6ab4
提交
61aa6ab4
authored
11月 08, 2013
作者:
Chris Rienzo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mod_rayo: send/receivefax bugfixes, also allow outbound calls not created with <dial> to be offered
上级
0339e807
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
22 行增加
和
20 行删除
+22
-20
mod_rayo.c
src/mod/event_handlers/mod_rayo/mod_rayo.c
+10
-16
mod_rayo.h
src/mod/event_handlers/mod_rayo/mod_rayo.h
+1
-1
rayo_fax_components.c
src/mod/event_handlers/mod_rayo/rayo_fax_components.c
+11
-3
没有找到文件。
src/mod/event_handlers/mod_rayo/mod_rayo.c
浏览文件 @
61aa6ab4
...
...
@@ -983,18 +983,13 @@ int rayo_call_is_faxing(struct rayo_call *call)
}
/**
* Set faxing flag
if faxing is not in progress
* Set faxing flag
* @param call the call to flag
* @param faxing true if faxing is in progress
* @return true if set, false if can't set because faxing is already in progress. Reset always succeeds.
*/
int
rayo_call_set_faxing
(
struct
rayo_call
*
call
,
int
faxing
)
void
rayo_call_set_faxing
(
struct
rayo_call
*
call
,
int
faxing
)
{
if
(
!
faxing
||
(
faxing
&&
!
call
->
faxing
))
{
call
->
faxing
=
faxing
;
return
1
;
}
return
0
;
call
->
faxing
=
faxing
;
}
#define RAYO_MIXER_LOCATE(mixer_name) rayo_mixer_locate(mixer_name, __FILE__, __LINE__)
...
...
@@ -3174,18 +3169,17 @@ SWITCH_STANDARD_APP(rayo_app)
}
}
if
(
!
call
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_CRIT
,
"Missing rayo call!!
\n
"
);
goto
done
;
/* this scenario can only happen if a call was originated through a mechanism other than <dial>
and then the rayo APP was executed to offer control */
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_INFO
,
"Outbound call that wasn't created with <dial>, will try to offer control
\n
"
);
}
ok
=
1
;
}
else
{
/* inbound call - offer control */
}
if
(
!
call
)
{
/* offer control */
switch_hash_index_t
*
hi
=
NULL
;
iks
*
offer
=
NULL
;
if
(
call
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_INFO
,
"Call is already under Rayo 3PCC!
\n
"
);
goto
done
;
}
call
=
rayo_call_create
(
switch_core_session_get_uuid
(
session
));
switch_channel_set_variable
(
switch_core_session_get_channel
(
session
),
"rayo_call_jid"
,
RAYO_JID
(
call
));
...
...
src/mod/event_handlers/mod_rayo/mod_rayo.h
浏览文件 @
61aa6ab4
...
...
@@ -155,7 +155,7 @@ extern void rayo_actor_destroy(struct rayo_actor *actor, const char *file, int l
extern
int
rayo_call_is_joined
(
struct
rayo_call
*
call
);
extern
int
rayo_call_is_faxing
(
struct
rayo_call
*
call
);
extern
int
rayo_call_set_faxing
(
struct
rayo_call
*
call
,
int
faxing
);
extern
void
rayo_call_set_faxing
(
struct
rayo_call
*
call
,
int
faxing
);
extern
const
char
*
rayo_call_get_dcp_jid
(
struct
rayo_call
*
call
);
#define rayo_mixer_get_name(mixer) RAYO_ID(mixer)
...
...
src/mod/event_handlers/mod_rayo/rayo_fax_components.c
浏览文件 @
61aa6ab4
...
...
@@ -92,7 +92,7 @@ static iks *start_sendfax_component(struct rayo_actor *call, struct rayo_message
return
iks_new_error_detailed
(
iq
,
STANZA_ERROR_UNEXPECTED_REQUEST
,
"can't send fax on a joined call"
);
}
if
(
!
rayo_call_set_faxing
(
RAYO_CALL
(
call
),
1
))
{
if
(
rayo_call_is_faxing
(
RAYO_CALL
(
call
)
))
{
return
iks_new_error_detailed
(
iq
,
STANZA_ERROR_UNEXPECTED_REQUEST
,
"fax already in progress"
);
}
...
...
@@ -199,6 +199,8 @@ static iks *start_sendfax_component(struct rayo_actor *call, struct rayo_message
/* clear fax interrupt variable */
switch_channel_set_variable
(
switch_core_session_get_channel
(
session
),
"rayo_read_frame_interrupt"
,
NULL
);
rayo_call_set_faxing
(
RAYO_CALL
(
call
),
1
);
/* execute txfax APP */
if
(
switch_event_create
(
&
execute_event
,
SWITCH_EVENT_COMMAND
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
execute_event
,
SWITCH_STACK_BOTTOM
,
"call-command"
,
"execute"
);
...
...
@@ -214,6 +216,7 @@ static iks *start_sendfax_component(struct rayo_actor *call, struct rayo_message
if
(
execute_event
)
{
switch_event_destroy
(
&
execute_event
);
}
rayo_call_set_faxing
(
RAYO_CALL
(
call
),
0
);
RAYO_UNLOCK
(
sendfax_component
);
}
else
{
/* component starting... */
...
...
@@ -221,6 +224,7 @@ static iks *start_sendfax_component(struct rayo_actor *call, struct rayo_message
}
}
else
{
response
=
iks_new_error_detailed
(
iq
,
STANZA_ERROR_INTERNAL_SERVER_ERROR
,
"failed to create txfax event"
);
rayo_call_set_faxing
(
RAYO_CALL
(
call
),
0
);
RAYO_UNLOCK
(
sendfax_component
);
}
...
...
@@ -255,7 +259,7 @@ static iks *start_receivefax_component(struct rayo_actor *call, struct rayo_mess
return
iks_new_error_detailed
(
iq
,
STANZA_ERROR_UNEXPECTED_REQUEST
,
"can't receive fax on a joined call"
);
}
if
(
!
rayo_call_set_faxing
(
RAYO_CALL
(
call
),
1
))
{
if
(
rayo_call_is_faxing
(
RAYO_CALL
(
call
)
))
{
return
iks_new_error_detailed
(
iq
,
STANZA_ERROR_UNEXPECTED_REQUEST
,
"fax already in progress"
);
}
...
...
@@ -264,7 +268,7 @@ static iks *start_receivefax_component(struct rayo_actor *call, struct rayo_mess
receivefax_component
=
switch_core_alloc
(
pool
,
sizeof
(
*
receivefax_component
));
rayo_component_init
((
struct
rayo_component
*
)
receivefax_component
,
pool
,
RAT_CALL_COMPONENT
,
"receivefax"
,
NULL
,
call
,
iks_find_attrib
(
iq
,
"from"
));
file_no
=
rayo_actor_seq_next
(
call
);
receivefax_component
->
filename
=
switch_core_sprintf
(
pool
,
"%s%s%s-%d"
,
receivefax_component
->
filename
=
switch_core_sprintf
(
pool
,
"%s%s%s-%d
.tif
"
,
globals
.
file_prefix
,
SWITCH_PATH_SEPARATOR
,
switch_core_session_get_uuid
(
session
),
file_no
);
if
(
!
strncmp
(
receivefax_component
->
filename
,
"http://"
,
7
)
||
!
strncmp
(
receivefax_component
->
filename
,
"https://"
,
8
))
{
/* This is an HTTP URL, need to PUT after fax is received */
...
...
@@ -298,6 +302,8 @@ static iks *start_receivefax_component(struct rayo_actor *call, struct rayo_mess
/* clear fax interrupt variable */
switch_channel_set_variable
(
switch_core_session_get_channel
(
session
),
"rayo_read_frame_interrupt"
,
NULL
);
rayo_call_set_faxing
(
RAYO_CALL
(
call
),
1
);
/* execute rxfax APP */
if
(
switch_event_create
(
&
execute_event
,
SWITCH_EVENT_COMMAND
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
execute_event
,
SWITCH_STACK_BOTTOM
,
"call-command"
,
"execute"
);
...
...
@@ -313,6 +319,7 @@ static iks *start_receivefax_component(struct rayo_actor *call, struct rayo_mess
if
(
execute_event
)
{
switch_event_destroy
(
&
execute_event
);
}
rayo_call_set_faxing
(
RAYO_CALL
(
call
),
0
);
RAYO_UNLOCK
(
receivefax_component
);
}
else
{
/* component starting... */
...
...
@@ -320,6 +327,7 @@ static iks *start_receivefax_component(struct rayo_actor *call, struct rayo_mess
}
}
else
{
response
=
iks_new_error_detailed
(
iq
,
STANZA_ERROR_INTERNAL_SERVER_ERROR
,
"failed to create rxfax event"
);
rayo_call_set_faxing
(
RAYO_CALL
(
call
),
0
);
RAYO_UNLOCK
(
receivefax_component
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论