Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
89b4b0c4
提交
89b4b0c4
authored
8月 28, 2014
作者:
Chris Rienzo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mod_rayo: fix nested join to calls and conferences
上级
1c058e0f
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
19 行增加
和
26 行删除
+19
-26
mod_rayo.c
src/mod/event_handlers/mod_rayo/mod_rayo.c
+19
-26
没有找到文件。
src/mod/event_handlers/mod_rayo/mod_rayo.c
浏览文件 @
89b4b0c4
...
@@ -2668,11 +2668,10 @@ static void *SWITCH_THREAD_FUNC rayo_dial_thread(switch_thread_t *thread, void *
...
@@ -2668,11 +2668,10 @@ static void *SWITCH_THREAD_FUNC rayo_dial_thread(switch_thread_t *thread, void *
if
(
gateway
)
{
if
(
gateway
)
{
iks
*
join
=
iks_find
(
dial
,
"join"
);
iks
*
join
=
iks_find
(
dial
,
"join"
);
const
char
*
dial_to_stripped
=
dial_to
+
gateway
->
strip
;
const
char
*
dial_to_stripped
=
dial_to
+
gateway
->
strip
;
switch_core_session_t
*
calle
r
_session
=
NULL
;
switch_core_session_t
*
calle
d
_session
=
NULL
;
switch_call_cause_t
cause
=
SWITCH_CAUSE_NORMAL_CLEARING
;
switch_call_cause_t
cause
=
SWITCH_CAUSE_NORMAL_CLEARING
;
const
char
*
dialstring
=
NULL
;
const
char
*
dialstring
=
NULL
;
const
char
*
app
=
NULL
;
const
char
*
rayo_app_args
=
""
;
const
char
*
app_args
=
NULL
;
if
(
join
)
{
if
(
join
)
{
/* check join args */
/* check join args */
...
@@ -2689,47 +2688,41 @@ static void *SWITCH_THREAD_FUNC rayo_dial_thread(switch_thread_t *thread, void *
...
@@ -2689,47 +2688,41 @@ static void *SWITCH_THREAD_FUNC rayo_dial_thread(switch_thread_t *thread, void *
goto
done
;
goto
done
;
}
else
if
(
!
zstr
(
call_uri
))
{
}
else
if
(
!
zstr
(
call_uri
))
{
/* bridge */
/* bridge */
struct
rayo_call
*
b
_call
=
RAYO_CALL_LOCATE
(
call_uri
);
struct
rayo_call
*
peer
_call
=
RAYO_CALL_LOCATE
(
call_uri
);
/* is
b-leg
available? */
/* is
peer call
available? */
if
(
!
b
_call
)
{
if
(
!
peer
_call
)
{
response
=
iks_new_error_detailed
(
iq
,
STANZA_ERROR_SERVICE_UNAVAILABLE
,
"
b-leg
not found"
);
response
=
iks_new_error_detailed
(
iq
,
STANZA_ERROR_SERVICE_UNAVAILABLE
,
"
peer call
not found"
);
goto
done
;
goto
done
;
}
else
if
(
b
_call
->
joined
)
{
}
else
if
(
peer
_call
->
joined
)
{
response
=
iks_new_error_detailed
(
iq
,
STANZA_ERROR_SERVICE_UNAVAILABLE
,
"
b-leg already joined to another call
"
);
response
=
iks_new_error_detailed
(
iq
,
STANZA_ERROR_SERVICE_UNAVAILABLE
,
"
peer call already joined
"
);
RAYO_RELEASE
(
b
_call
);
RAYO_RELEASE
(
peer
_call
);
goto
done
;
goto
done
;
}
}
app
=
"bridge"
;
rayo_app_args
=
switch_core_sprintf
(
dtdata
->
pool
,
"bridge %s"
,
rayo_call_get_uuid
(
peer_call
));
app_args
=
switch_core_strdup
(
dtdata
->
pool
,
rayo_call_get_uuid
(
b_call
));
RAYO_RELEASE
(
peer_call
);
RAYO_RELEASE
(
b_call
);
}
else
{
}
else
{
/* conference */
/* conference */
app
=
"conference"
;
rayo_app_args
=
switch_core_sprintf
(
dtdata
->
pool
,
"conference %s@%s"
,
mixer_name
,
globals
.
mixer_conf_profile
);
app_args
=
switch_core_sprintf
(
dtdata
->
pool
,
"%s@%s"
,
mixer_name
,
globals
.
mixer_conf_profile
);
}
}
}
else
{
/* default one-legged call */
app
=
"rayo"
;
app_args
=
""
;
}
}
dialstring
=
switch_core_sprintf
(
dtdata
->
pool
,
"%s%s"
,
gateway
->
dial_prefix
,
dial_to_stripped
);
dialstring
=
switch_core_sprintf
(
dtdata
->
pool
,
"%s%s"
,
gateway
->
dial_prefix
,
dial_to_stripped
);
switch_log_printf
(
SWITCH_CHANNEL_UUID_LOG
(
rayo_call_get_uuid
(
call
)),
SWITCH_LOG_DEBUG
,
"dial: Using dialstring: %s
\n
"
,
dialstring
);
switch_log_printf
(
SWITCH_CHANNEL_UUID_LOG
(
rayo_call_get_uuid
(
call
)),
SWITCH_LOG_DEBUG
,
"dial: Using dialstring: %s
\n
"
,
dialstring
);
/* <iq><ref> response will be sent when originate event is received- otherwise error is returned */
/* <iq><ref> response will be sent when originate event is received- otherwise error is returned */
if
(
switch_ivr_originate
(
NULL
,
&
calle
r_session
,
&
cause
,
dialstring
,
dial_timeout_sec
,
NULL
,
NULL
,
NULL
,
NULL
,
originate_vars
,
SOF_NONE
,
NULL
)
==
SWITCH_STATUS_SUCCESS
&&
caller
_session
)
{
if
(
switch_ivr_originate
(
NULL
,
&
calle
d_session
,
&
cause
,
dialstring
,
dial_timeout_sec
,
NULL
,
NULL
,
NULL
,
NULL
,
originate_vars
,
SOF_NONE
,
NULL
)
==
SWITCH_STATUS_SUCCESS
&&
called
_session
)
{
/* start APP */
/* start APP */
switch_caller_extension_t
*
extension
=
NULL
;
switch_caller_extension_t
*
extension
=
NULL
;
switch_channel_t
*
calle
r_channel
=
switch_core_session_get_channel
(
caller
_session
);
switch_channel_t
*
calle
d_channel
=
switch_core_session_get_channel
(
called
_session
);
switch_log_printf
(
SWITCH_CHANNEL_UUID_LOG
(
uuid
),
SWITCH_LOG_DEBUG
,
"dial: Call originated
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_UUID_LOG
(
uuid
),
SWITCH_LOG_DEBUG
,
"dial: Call originated
\n
"
);
if
((
extension
=
switch_caller_extension_new
(
calle
r_session
,
app
,
app_args
))
==
0
)
{
if
((
extension
=
switch_caller_extension_new
(
calle
d_session
,
"rayo"
,
rayo_
app_args
))
==
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_UUID_LOG
(
rayo_call_get_uuid
(
call
)),
SWITCH_LOG_CRIT
,
"Memory Error!
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_UUID_LOG
(
rayo_call_get_uuid
(
call
)),
SWITCH_LOG_CRIT
,
"Memory Error!
\n
"
);
abort
();
abort
();
}
}
switch_caller_extension_add_application
(
calle
r_session
,
extension
,
app
,
app_args
);
switch_caller_extension_add_application
(
calle
d_session
,
extension
,
"rayo"
,
rayo_
app_args
);
switch_channel_set_caller_extension
(
calle
r
_channel
,
extension
);
switch_channel_set_caller_extension
(
calle
d
_channel
,
extension
);
switch_channel_set_state
(
calle
r
_channel
,
CS_EXECUTE
);
switch_channel_set_state
(
calle
d
_channel
,
CS_EXECUTE
);
switch_core_session_rwunlock
(
calle
r
_session
);
switch_core_session_rwunlock
(
calle
d
_session
);
}
else
{
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_UUID_LOG
(
uuid
),
SWITCH_LOG_DEBUG
,
"dial: Failed to originate call: %s
\n
"
,
switch_channel_cause2str
(
cause
));
switch_log_printf
(
SWITCH_CHANNEL_UUID_LOG
(
uuid
),
SWITCH_LOG_DEBUG
,
"dial: Failed to originate call: %s
\n
"
,
switch_channel_cause2str
(
cause
));
switch_mutex_lock
(
RAYO_ACTOR
(
call
)
->
mutex
);
switch_mutex_lock
(
RAYO_ACTOR
(
call
)
->
mutex
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论