Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d1ad4d47
提交
d1ad4d47
authored
10月 31, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add no_loopback flag to apps so they can tell mod_loopback to bow out
上级
a4a44fb1
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
44 行增加
和
3 行删除
+44
-3
switch_types.h
src/include/switch_types.h
+2
-1
mod_spandsp.c
src/mod/applications/mod_spandsp/mod_spandsp.c
+2
-2
mod_loopback.c
src/mod/endpoints/mod_loopback/mod_loopback.c
+40
-0
没有找到文件。
src/include/switch_types.h
浏览文件 @
d1ad4d47
...
@@ -1304,7 +1304,8 @@ typedef enum {
...
@@ -1304,7 +1304,8 @@ typedef enum {
SAF_SUPPORT_NOMEDIA
=
(
1
<<
0
),
SAF_SUPPORT_NOMEDIA
=
(
1
<<
0
),
SAF_ROUTING_EXEC
=
(
1
<<
1
),
SAF_ROUTING_EXEC
=
(
1
<<
1
),
SAF_MEDIA_TAP
=
(
1
<<
2
),
SAF_MEDIA_TAP
=
(
1
<<
2
),
SAF_ZOMBIE_EXEC
=
(
1
<<
3
)
SAF_ZOMBIE_EXEC
=
(
1
<<
3
),
SAF_NO_LOOPBACK
=
(
1
<<
4
)
}
switch_application_flag_enum_t
;
}
switch_application_flag_enum_t
;
typedef
uint32_t
switch_application_flag_t
;
typedef
uint32_t
switch_application_flag_t
;
...
...
src/mod/applications/mod_spandsp/mod_spandsp.c
浏览文件 @
d1ad4d47
...
@@ -714,9 +714,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_spandsp_init)
...
@@ -714,9 +714,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_spandsp_init)
t38_gateway_function
,
""
,
SAF_MEDIA_TAP
);
t38_gateway_function
,
""
,
SAF_MEDIA_TAP
);
SWITCH_ADD_APP
(
app_interface
,
"rxfax"
,
"FAX Receive Application"
,
"FAX Receive Application"
,
spanfax_rx_function
,
SPANFAX_RX_USAGE
,
SWITCH_ADD_APP
(
app_interface
,
"rxfax"
,
"FAX Receive Application"
,
"FAX Receive Application"
,
spanfax_rx_function
,
SPANFAX_RX_USAGE
,
SAF_SUPPORT_NOMEDIA
);
SAF_SUPPORT_NOMEDIA
|
SAF_NO_LOOPBACK
);
SWITCH_ADD_APP
(
app_interface
,
"txfax"
,
"FAX Transmit Application"
,
"FAX Transmit Application"
,
spanfax_tx_function
,
SPANFAX_TX_USAGE
,
SWITCH_ADD_APP
(
app_interface
,
"txfax"
,
"FAX Transmit Application"
,
"FAX Transmit Application"
,
spanfax_tx_function
,
SPANFAX_TX_USAGE
,
SAF_SUPPORT_NOMEDIA
);
SAF_SUPPORT_NOMEDIA
|
SAF_NO_LOOPBACK
);
SWITCH_ADD_APP
(
app_interface
,
"spandsp_stop_dtmf"
,
"stop inband dtmf"
,
"Stop detecting inband dtmf."
,
stop_dtmf_session_function
,
""
,
SAF_NONE
);
SWITCH_ADD_APP
(
app_interface
,
"spandsp_stop_dtmf"
,
"stop inband dtmf"
,
"Stop detecting inband dtmf."
,
stop_dtmf_session_function
,
""
,
SAF_NONE
);
SWITCH_ADD_APP
(
app_interface
,
"spandsp_start_dtmf"
,
"Detect dtmf"
,
"Detect inband dtmf on the session"
,
dtmf_session_function
,
""
,
SAF_MEDIA_TAP
);
SWITCH_ADD_APP
(
app_interface
,
"spandsp_start_dtmf"
,
"Detect dtmf"
,
"Detect inband dtmf on the session"
,
dtmf_session_function
,
""
,
SAF_MEDIA_TAP
);
...
...
src/mod/endpoints/mod_loopback/mod_loopback.c
浏览文件 @
d1ad4d47
...
@@ -42,6 +42,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_loopback_load);
...
@@ -42,6 +42,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_loopback_load);
SWITCH_MODULE_SHUTDOWN_FUNCTION
(
mod_loopback_shutdown
);
SWITCH_MODULE_SHUTDOWN_FUNCTION
(
mod_loopback_shutdown
);
SWITCH_MODULE_DEFINITION
(
mod_loopback
,
mod_loopback_load
,
mod_loopback_shutdown
,
NULL
);
SWITCH_MODULE_DEFINITION
(
mod_loopback
,
mod_loopback_load
,
mod_loopback_shutdown
,
NULL
);
static
switch_status_t
find_non_loopback_bridge
(
switch_core_session_t
*
session
,
switch_core_session_t
**
br_session
,
const
char
**
br_uuid
);
static
switch_endpoint_interface_t
*
loopback_endpoint_interface
=
NULL
;
static
switch_endpoint_interface_t
*
loopback_endpoint_interface
=
NULL
;
typedef
enum
{
typedef
enum
{
...
@@ -409,6 +411,8 @@ static switch_status_t channel_on_execute(switch_core_session_t *session)
...
@@ -409,6 +411,8 @@ static switch_status_t channel_on_execute(switch_core_session_t *session)
{
{
switch_channel_t
*
channel
=
NULL
;
switch_channel_t
*
channel
=
NULL
;
private_t
*
tech_pvt
=
NULL
;
private_t
*
tech_pvt
=
NULL
;
switch_caller_extension_t
*
exten
;
int
bow
=
0
;
channel
=
switch_core_session_get_channel
(
session
);
channel
=
switch_core_session_get_channel
(
session
);
assert
(
channel
!=
NULL
);
assert
(
channel
!=
NULL
);
...
@@ -418,6 +422,37 @@ static switch_status_t channel_on_execute(switch_core_session_t *session)
...
@@ -418,6 +422,37 @@ 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
((
exten
=
switch_channel_get_caller_extension
(
channel
)))
{
switch_caller_application_t
*
app_p
;
for
(
app_p
=
exten
->
applications
;
app_p
;
app_p
=
app_p
->
next
)
{
int32_t
flags
;
switch_core_session_get_app_flags
(
app_p
->
application_name
,
&
flags
);
if
((
flags
&
SAF_NO_LOOPBACK
))
{
bow
=
1
;
break
;
}
}
}
if
(
bow
)
{
switch_core_session_t
*
other_session
;
const
char
*
other_uuid
;
if
((
find_non_loopback_bridge
(
tech_pvt
->
other_session
,
&
other_session
,
&
other_uuid
)
==
SWITCH_STATUS_SUCCESS
))
{
switch_caller_extension_t
*
extension
;
switch_channel_t
*
other_channel
=
switch_core_session_get_channel
(
other_session
);
switch_caller_extension_clone
(
&
extension
,
exten
,
switch_core_session_get_pool
(
other_session
));
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_INFO
,
"BOWOUT Transfering current extension to non-loopback leg.
\n
"
);
switch_channel_transfer_to_extension
(
other_channel
,
extension
);
switch_core_session_rwunlock
(
other_session
);
}
}
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
@@ -1126,11 +1161,16 @@ static switch_io_routines_t channel_io_routines = {
...
@@ -1126,11 +1161,16 @@ static switch_io_routines_t channel_io_routines = {
/*.receive_message */
channel_receive_message
/*.receive_message */
channel_receive_message
};
};
SWITCH_STANDARD_APP
(
unloop_function
)
{
/* NOOP */
}
SWITCH_MODULE_LOAD_FUNCTION
(
mod_loopback_load
)
SWITCH_MODULE_LOAD_FUNCTION
(
mod_loopback_load
)
{
{
switch_application_interface_t
*
app_interface
;
memset
(
&
globals
,
0
,
sizeof
(
globals
));
memset
(
&
globals
,
0
,
sizeof
(
globals
));
SWITCH_ADD_APP
(
app_interface
,
"unloop"
,
"Tell loopback to unfold"
,
"Tell loopback to unfold"
,
unloop_function
,
""
,
SAF_NO_LOOPBACK
);
/* connect my internal structure to the blank pointer passed to me */
/* connect my internal structure to the blank pointer passed to me */
*
module_interface
=
switch_loadable_module_create_module_interface
(
pool
,
modname
);
*
module_interface
=
switch_loadable_module_create_module_interface
(
pool
,
modname
);
loopback_endpoint_interface
=
switch_loadable_module_create_interface
(
*
module_interface
,
SWITCH_ENDPOINT_INTERFACE
);
loopback_endpoint_interface
=
switch_loadable_module_create_interface
(
*
module_interface
,
SWITCH_ENDPOINT_INTERFACE
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论