Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
50e1f58d
提交
50e1f58d
authored
6月 17, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add deflect parsing support for mod_loopback and fix unloop bug
上级
80669e84
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
32 行增加
和
8 行删除
+32
-8
mod_loopback.c
src/mod/endpoints/mod_loopback/mod_loopback.c
+32
-8
没有找到文件。
src/mod/endpoints/mod_loopback/mod_loopback.c
浏览文件 @
50e1f58d
...
@@ -429,20 +429,20 @@ static switch_status_t channel_on_execute(switch_core_session_t *session)
...
@@ -429,20 +429,20 @@ static switch_status_t channel_on_execute(switch_core_session_t *session)
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"%s CHANNEL EXECUTE
\n
"
,
switch_channel_get_name
(
channel
));
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"%s CHANNEL EXECUTE
\n
"
,
switch_channel_get_name
(
channel
));
if
((
bowout
=
switch_channel_get_variable
(
tech_pvt
->
channel
,
"loopback_bowout_on_execute"
))
&&
switch_true
(
bowout
))
{
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_BOWOUT
)
||
switch_test_flag
(
tech_pvt
,
TFLAG_BLEG
))
{
bow
=
0
;
}
else
if
((
bowout
=
switch_channel_get_variable
(
tech_pvt
->
channel
,
"loopback_bowout_on_execute"
))
&&
switch_true
(
bowout
))
{
/* loopback_bowout_on_execute variable is set */
/* loopback_bowout_on_execute variable is set */
bow
=
1
;
bow
=
1
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_CRIT
,
"WILL BOW
\n
"
);
}
else
if
((
exten
=
switch_channel_get_caller_extension
(
channel
)))
{
}
else
if
((
exten
=
switch_channel_get_caller_extension
(
channel
)))
{
/* check for bowout flag */
/* check for bowout flag */
switch_caller_application_t
*
app_p
;
switch_caller_application_t
*
app_p
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_CRIT
,
"CHEKCING APPS
\n
"
);
for
(
app_p
=
exten
->
applications
;
app_p
;
app_p
=
app_p
->
next
)
{
for
(
app_p
=
exten
->
applications
;
app_p
;
app_p
=
app_p
->
next
)
{
int32_t
flags
;
int32_t
flags
;
switch_core_session_get_app_flags
(
app_p
->
application_name
,
&
flags
);
switch_core_session_get_app_flags
(
app_p
->
application_name
,
&
flags
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_CRIT
,
"CHECK %s %d
\n
"
,
app_p
->
application_name
,
(
flags
&
SAF_NO_LOOPBACK
));
if
((
flags
&
SAF_NO_LOOPBACK
))
{
if
((
flags
&
SAF_NO_LOOPBACK
))
{
bow
=
1
;
bow
=
1
;
...
@@ -455,14 +455,16 @@ static switch_status_t channel_on_execute(switch_core_session_t *session)
...
@@ -455,14 +455,16 @@ static switch_status_t channel_on_execute(switch_core_session_t *session)
switch_core_session_t
*
other_session
=
NULL
;
switch_core_session_t
*
other_session
=
NULL
;
switch_caller_profile_t
*
cp
,
*
clone
;
switch_caller_profile_t
*
cp
,
*
clone
;
const
char
*
other_uuid
=
NULL
;
const
char
*
other_uuid
=
NULL
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_CRIT
,
"BOWING
\n
"
);
switch_set_flag
(
tech_pvt
,
TFLAG_BOWOUT
);
switch_set_flag
(
tech_pvt
,
TFLAG_BOWOUT
);
if
((
find_non_loopback_bridge
(
tech_pvt
->
other_session
,
&
other_session
,
&
other_uuid
)
==
SWITCH_STATUS_SUCCESS
))
{
if
((
find_non_loopback_bridge
(
tech_pvt
->
other_session
,
&
other_session
,
&
other_uuid
)
==
SWITCH_STATUS_SUCCESS
))
{
switch_channel_t
*
other_channel
=
switch_core_session_get_channel
(
other_session
);
switch_channel_t
*
other_channel
=
switch_core_session_get_channel
(
other_session
);
/* Wait for real channel to be exchanging media */
if
(
switch_channel_test_flag
(
other_channel
,
CF_BRIDGED
))
{
switch_channel_wait_for_state
(
other_channel
,
channel
,
CS_EXCHANGE_MEDIA
);
/* Wait for real channel to be exchanging media */
switch_channel_wait_for_state
(
other_channel
,
channel
,
CS_EXCHANGE_MEDIA
);
}
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_INFO
,
"BOWOUT Replacing loopback channel with real channel: %s
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_INFO
,
"BOWOUT Replacing loopback channel with real channel: %s
\n
"
,
switch_channel_get_name
(
other_channel
));
switch_channel_get_name
(
other_channel
));
...
@@ -929,6 +931,7 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
...
@@ -929,6 +931,7 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
switch_channel_t
*
channel
;
switch_channel_t
*
channel
;
loopback_private_t
*
tech_pvt
;
loopback_private_t
*
tech_pvt
;
int
done
=
1
,
pass
=
0
;
int
done
=
1
,
pass
=
0
;
switch_core_session_t
*
other_session
;
channel
=
switch_core_session_get_channel
(
session
);
channel
=
switch_core_session_get_channel
(
session
);
switch_assert
(
channel
!=
NULL
);
switch_assert
(
channel
!=
NULL
);
...
@@ -1011,16 +1014,37 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
...
@@ -1011,16 +1014,37 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
pass
=
1
;
pass
=
1
;
}
}
break
;
break
;
case
SWITCH_MESSAGE_INDICATE_DEFLECT
:
{
pass
=
0
;
if
(
!
zstr
(
msg
->
string_arg
)
&&
switch_core_session_get_partner
(
tech_pvt
->
other_session
,
&
other_session
)
==
SWITCH_STATUS_SUCCESS
)
{
char
*
ext
=
switch_core_session_strdup
(
other_session
,
msg
->
string_arg
);
char
*
context
=
NULL
,
*
dp
=
NULL
;
if
((
context
=
strchr
(
ext
,
' '
)))
{
*
context
++
=
'\0'
;
if
((
dp
=
strchr
(
context
,
' '
)))
{
*
dp
++
=
'\0'
;
}
}
switch_ivr_session_transfer
(
other_session
,
ext
,
context
,
dp
);
switch_core_session_rwunlock
(
other_session
);
}
}
break
;
default:
default:
break
;
break
;
}
}
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_CRIT
,
"done:%d pass:%d running:%d
\n
"
,
done
,
pass
,
switch_test_flag
(
tech_pvt
,
TFLAG_RUNNING_APP
));
if
(
!
done
&&
tech_pvt
->
other_session
&&
(
pass
||
switch_test_flag
(
tech_pvt
,
TFLAG_RUNNING_APP
)))
{
if
(
!
done
&&
tech_pvt
->
other_session
&&
(
pass
||
switch_test_flag
(
tech_pvt
,
TFLAG_RUNNING_APP
)))
{
switch_status_t
r
=
SWITCH_STATUS_FALSE
;
switch_status_t
r
=
SWITCH_STATUS_FALSE
;
switch_core_session_t
*
other_session
;
if
(
switch_core_session_get_partner
(
tech_pvt
->
other_session
,
&
other_session
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_core_session_get_partner
(
tech_pvt
->
other_session
,
&
other_session
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_CRIT
,
"PASS TO %s
\n
"
,
switch_core_session_get_name
(
other_session
));
r
=
switch_core_session_receive_message
(
other_session
,
msg
);
r
=
switch_core_session_receive_message
(
other_session
,
msg
);
switch_core_session_rwunlock
(
other_session
);
switch_core_session_rwunlock
(
other_session
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论