Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b8ce4d9c
提交
b8ce4d9c
authored
10月 11, 2008
作者:
Brian West
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NEXT...
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@9968
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
458f430f
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
1 行增加
和
31 行删除
+1
-31
mod_loopback.c
src/mod/endpoints/mod_loopback/mod_loopback.c
+1
-31
没有找到文件。
src/mod/endpoints/mod_loopback/mod_loopback.c
浏览文件 @
b8ce4d9c
...
...
@@ -44,7 +44,6 @@ static switch_endpoint_interface_t *loopback_endpoint_interface = NULL;
static
switch_memory_pool_t
*
module_pool
=
NULL
;
typedef
enum
{
TFLAG_LINKED
=
(
1
<<
0
),
TFLAG_OUTBOUND
=
(
1
<<
1
),
...
...
@@ -77,13 +76,13 @@ struct private_object {
switch_caller_profile_t
*
caller_profile
;
int32_t
bowout_frame_count
;
};
typedef
struct
private_object
private_t
;
static
struct
{
int
debug
;
}
globals
;
static
switch_status_t
channel_on_init
(
switch_core_session_t
*
session
);
static
switch_status_t
channel_on_hangup
(
switch_core_session_t
*
session
);
static
switch_status_t
channel_on_routing
(
switch_core_session_t
*
session
);
...
...
@@ -155,7 +154,6 @@ static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *ses
tech_pvt
->
read_frame
.
buflen
=
sizeof
(
tech_pvt
->
databuf
);
tech_pvt
->
read_frame
.
codec
=
&
tech_pvt
->
read_codec
;
tech_pvt
->
write_frame
.
data
=
tech_pvt
->
write_databuf
;
tech_pvt
->
write_frame
.
buflen
=
sizeof
(
tech_pvt
->
write_databuf
);
...
...
@@ -194,9 +192,6 @@ static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *ses
return
status
;
}
/*
State methods they get called when the state changes to the specific state
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
...
...
@@ -235,7 +230,6 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
switch_core_session_destroy
(
&
b_session
);
goto
end
;
}
caller_profile
=
switch_caller_profile_clone
(
b_session
,
tech_pvt
->
caller_profile
);
caller_profile
->
source
=
switch_core_strdup
(
caller_profile
->
pool
,
modname
);
...
...
@@ -272,14 +266,12 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
goto
end
;
}
switch_channel_set_variable
(
channel
,
"loopback_leg"
,
switch_test_flag
(
tech_pvt
,
TFLAG_OUTBOUND
)
?
"B"
:
"A"
);
switch_channel_set_state
(
channel
,
CS_ROUTING
);
end:
return
SWITCH_STATUS_SUCCESS
;
}
static
void
do_reset
(
private_t
*
tech_pvt
)
...
...
@@ -313,7 +305,6 @@ static switch_status_t channel_on_routing(switch_core_session_t *session)
static
switch_status_t
channel_on_execute
(
switch_core_session_t
*
session
)
{
switch_channel_t
*
channel
=
NULL
;
private_t
*
tech_pvt
=
NULL
;
...
...
@@ -325,7 +316,6 @@ static switch_status_t channel_on_execute(switch_core_session_t *session)
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s CHANNEL EXECUTE
\n
"
,
switch_channel_get_name
(
channel
));
return
SWITCH_STATUS_SUCCESS
;
}
...
...
@@ -391,7 +381,6 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s CHANNEL KILL
\n
"
,
switch_channel_get_name
(
channel
));
return
SWITCH_STATUS_SUCCESS
;
}
...
...
@@ -417,7 +406,6 @@ static switch_status_t channel_on_exchange_media(switch_core_session_t *session)
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
channel_on_reset
(
switch_core_session_t
*
session
)
{
private_t
*
tech_pvt
=
(
private_t
*
)
switch_core_session_get_private
(
session
);
...
...
@@ -429,7 +417,6 @@ static switch_status_t channel_on_reset(switch_core_session_t *session)
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
channel_on_hibernate
(
switch_core_session_t
*
session
)
{
private_t
*
tech_pvt
=
switch_core_session_get_private
(
session
);
...
...
@@ -440,8 +427,6 @@ static switch_status_t channel_on_hibernate(switch_core_session_t *session)
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
channel_on_consume_media
(
switch_core_session_t
*
session
)
{
switch_channel_t
*
channel
=
NULL
;
...
...
@@ -458,7 +443,6 @@ static switch_status_t channel_on_consume_media(switch_core_session_t *session)
return
SWITCH_STATUS_FALSE
;
}
static
switch_status_t
channel_send_dtmf
(
switch_core_session_t
*
session
,
const
switch_dtmf_t
*
dtmf
)
{
private_t
*
tech_pvt
=
NULL
;
...
...
@@ -554,7 +538,6 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
if
(
switch_test_flag
(
frame
,
SFF_CNG
)
||
switch_test_flag
(
tech_pvt
,
TFLAG_CNG
)
||
switch_test_flag
(
tech_pvt
,
TFLAG_BOWOUT
))
{
return
SWITCH_STATUS_SUCCESS
;
}
if
(
!
switch_test_flag
(
tech_pvt
,
TFLAG_BOWOUT
)
&&
tech_pvt
->
other_tech_pvt
&&
...
...
@@ -615,7 +598,6 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
tech_pvt
=
switch_core_session_get_private
(
session
);
assert
(
tech_pvt
!=
NULL
);
switch
(
msg
->
message_id
)
{
case
SWITCH_MESSAGE_INDICATE_ANSWER
:
...
...
@@ -648,14 +630,12 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_call_cause_t
channel_outgoing_channel
(
switch_core_session_t
*
session
,
switch_event_t
*
var_event
,
switch_caller_profile_t
*
outbound_profile
,
switch_core_session_t
**
new_session
,
switch_memory_pool_t
**
pool
,
switch_originate_flag_t
flags
)
{
char
name
[
128
];
if
(
session
)
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_channel_clear_flag
(
channel
,
CF_PROXY_MEDIA
);
...
...
@@ -730,7 +710,6 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
}
return
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
;
}
static
switch_state_handler_table_t
channel_event_handlers
=
{
...
...
@@ -754,13 +733,8 @@ static switch_io_routines_t channel_io_routines = {
/*.receive_message */
channel_receive_message
};
SWITCH_MODULE_LOAD_FUNCTION
(
mod_loopback_load
)
{
//switch_status_t status;
if
(
switch_core_new_memory_pool
(
&
module_pool
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"OH OH no pool
\n
"
);
return
SWITCH_STATUS_TERM
;
...
...
@@ -775,19 +749,15 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_loopback_load)
loopback_endpoint_interface
->
io_routines
=
&
channel_io_routines
;
loopback_endpoint_interface
->
state_handler
=
&
channel_event_handlers
;
/* indicate that the module should continue to be loaded */
return
SWITCH_STATUS_SUCCESS
;
}
SWITCH_MODULE_SHUTDOWN_FUNCTION
(
mod_loopback_shutdown
)
{
return
SWITCH_STATUS_SUCCESS
;
}
/* For Emacs:
* Local Variables:
* mode:c
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论