Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
917609df
提交
917609df
authored
8月 23, 2012
作者:
Kapil Gupta
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
removing "raw_ftdm_chan_open" API as we have M2UA sig type
上级
33e0b717
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
1 行增加
和
138 行删除
+1
-138
tdm.c
libs/freetdm/mod_freetdm/tdm.c
+1
-1
ftdm_io.c
libs/freetdm/src/ftdm_io.c
+0
-135
freetdm.h
libs/freetdm/src/include/freetdm.h
+0
-2
没有找到文件。
libs/freetdm/mod_freetdm/tdm.c
浏览文件 @
917609df
...
@@ -334,7 +334,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
...
@@ -334,7 +334,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
channel
=
switch_core_session_get_channel
(
*
new_session
);
channel
=
switch_core_session_get_channel
(
*
new_session
);
if
(
ftdm_
raw_
channel_open
(
span_id
,
chan_id
,
&
chan
)
!=
FTDM_SUCCESS
)
{
if
(
ftdm_channel_open
(
span_id
,
chan_id
,
&
chan
)
!=
FTDM_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't open span or channel.
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't open span or channel.
\n
"
);
goto
fail
;
goto
fail
;
}
}
...
...
libs/freetdm/src/ftdm_io.c
浏览文件 @
917609df
...
@@ -1893,130 +1893,6 @@ done:
...
@@ -1893,130 +1893,6 @@ done:
return
status
;
return
status
;
}
}
static
ftdm_status_t
_ftdm_raw_channel_open
(
uint32_t
span_id
,
uint32_t
chan_id
,
ftdm_channel_t
**
ftdmchan
)
{
ftdm_channel_t
*
check
=
NULL
;
ftdm_span_t
*
span
=
NULL
;
ftdm_channel_t
*
best_rated
=
NULL
;
ftdm_status_t
status
=
FTDM_FAIL
;
int
best_rate
=
0
;
*
ftdmchan
=
NULL
;
ftdm_mutex_lock
(
globals
.
mutex
);
ftdm_span_find
(
span_id
,
&
span
);
if
(
!
span
)
{
ftdm_log
(
FTDM_LOG_CRIT
,
"Could not find span!
\n
"
);
goto
done
;
}
if
(
!
ftdm_test_flag
(
span
,
FTDM_SPAN_CONFIGURED
))
{
ftdm_log
(
FTDM_LOG_CRIT
,
"Span %d is not configured
\n
"
,
span_id
);
goto
done
;
}
if
(
span
->
channel_request
)
{
ftdm_log
(
FTDM_LOG_ERROR
,
"Individual channel selection not implemented on this span.
\n
"
);
goto
done
;
}
if
(
chan_id
<
1
||
chan_id
>
span
->
chan_count
)
{
ftdm_log
(
FTDM_LOG_ERROR
,
"Invalid channel %d to open in span %d
\n
"
,
chan_id
,
span_id
);
goto
done
;
}
if
(
!
(
check
=
span
->
channels
[
chan_id
]))
{
ftdm_log
(
FTDM_LOG_CRIT
,
"Wow, no channel %d in span %d
\n
"
,
chan_id
,
span_id
);
goto
done
;
}
ftdm_channel_lock
(
check
);
if
(
ftdm_test_flag
(
check
,
FTDM_CHANNEL_OPEN
))
{
/* let them know is already open, but return the channel anyway */
status
=
FTDM_EBUSY
;
*
ftdmchan
=
check
;
goto
unlockchan
;
}
/* The following if's and gotos replace a big if (this || this || this || this) else { nothing; } */
/* if it is not a voice channel, nothing else to check to open it */
if
(
!
FTDM_IS_VOICE_CHANNEL
(
check
))
{
goto
openchan
;
}
/* if it's an FXS device with a call active and has callwaiting enabled, we allow to open it twice */
if
(
check
->
type
==
FTDM_CHAN_TYPE_FXS
&&
check
->
token_count
==
1
&&
ftdm_channel_test_feature
(
check
,
FTDM_CHANNEL_FEATURE_CALLWAITING
))
{
goto
openchan
;
}
/* chan_is_avail API without signaling check */
if
(
check
->
span
->
signal_type
==
FTDM_SIGTYPE_NONE
)
{
if
(
!
ftdm_test_flag
(
check
,
FTDM_CHANNEL_READY
)
||
ftdm_test_flag
(
check
,
FTDM_CHANNEL_INUSE
)
||
ftdm_test_flag
(
check
,
FTDM_CHANNEL_SUSPENDED
)
||
ftdm_test_flag
(
check
,
FTDM_CHANNEL_IN_ALARM
)
||
check
->
state
!=
FTDM_CHANNEL_STATE_DOWN
)
{
ftdm_log
(
FTDM_LOG_ERROR
,
"channel %d not available to open in span %d
\n
"
,
chan_id
,
span_id
);
goto
done
;
}
}
else
if
(
!
ftdm_test_flag
(
check
,
FTDM_CHANNEL_READY
)
||
ftdm_test_flag
(
check
,
FTDM_CHANNEL_INUSE
)
||
ftdm_test_flag
(
check
,
FTDM_CHANNEL_SUSPENDED
)
||
ftdm_test_flag
(
check
,
FTDM_CHANNEL_IN_ALARM
)
||
check
->
state
!=
FTDM_CHANNEL_STATE_DOWN
)
{
ftdm_log
(
FTDM_LOG_ERROR
,
"channel %d not available to open in span %d
\n
"
,
chan_id
,
span_id
);
goto
done
;
}
else
{
/* channel is ready to open */
ftdm_log
(
FTDM_LOG_INFO
,
"channel %d available to open in span %d
\n
"
,
chan_id
,
span_id
);
goto
openchan
;
}
/* not available, but still might be available ... */
calculate_best_rate
(
check
,
&
best_rated
,
&
best_rate
);
if
(
best_rated
)
{
goto
openchan
;
}
/* channel is unavailable, do not open the channel */
goto
unlockchan
;
openchan
:
if
(
!
ftdm_test_flag
(
check
,
FTDM_CHANNEL_OPEN
))
{
status
=
check
->
fio
->
open
(
check
);
if
(
status
==
FTDM_SUCCESS
)
{
ftdm_set_flag
(
check
,
FTDM_CHANNEL_OPEN
);
}
}
else
{
status
=
FTDM_SUCCESS
;
}
ftdm_set_flag
(
check
,
FTDM_CHANNEL_INUSE
);
ftdm_set_flag
(
check
,
FTDM_CHANNEL_OUTBOUND
);
*
ftdmchan
=
check
;
/* we've got the channel, do not unlock it */
goto
done
;
unlockchan
:
ftdm_channel_unlock
(
check
);
done
:
ftdm_mutex_unlock
(
globals
.
mutex
);
if
(
status
!=
FTDM_SUCCESS
)
{
ftdm_log
(
FTDM_LOG_ERROR
,
"Failed to open channel %d:%d
\n
"
,
span_id
,
chan_id
);
}
return
status
;
}
static
ftdm_status_t
_ftdm_channel_open
(
uint32_t
span_id
,
uint32_t
chan_id
,
ftdm_channel_t
**
ftdmchan
)
static
ftdm_status_t
_ftdm_channel_open
(
uint32_t
span_id
,
uint32_t
chan_id
,
ftdm_channel_t
**
ftdmchan
)
{
{
ftdm_channel_t
*
check
=
NULL
;
ftdm_channel_t
*
check
=
NULL
;
...
@@ -2132,17 +2008,6 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_open(uint32_t span_id, uint32_t chan_id,
...
@@ -2132,17 +2008,6 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_open(uint32_t span_id, uint32_t chan_id,
return
status
;
return
status
;
}
}
FT_DECLARE
(
ftdm_status_t
)
ftdm_raw_channel_open
(
uint32_t
span_id
,
uint32_t
chan_id
,
ftdm_channel_t
**
ftdmchan
)
{
ftdm_status_t
status
;
status
=
_ftdm_raw_channel_open
(
span_id
,
chan_id
,
ftdmchan
);
if
(
status
==
FTDM_SUCCESS
)
{
ftdm_channel_t
*
fchan
=
*
ftdmchan
;
ftdm_channel_unlock
(
fchan
);
}
return
status
;
}
FT_DECLARE
(
uint32_t
)
ftdm_channel_get_id
(
const
ftdm_channel_t
*
ftdmchan
)
FT_DECLARE
(
uint32_t
)
ftdm_channel_get_id
(
const
ftdm_channel_t
*
ftdmchan
)
{
{
return
ftdmchan
->
chan_id
;
return
ftdmchan
->
chan_id
;
...
...
libs/freetdm/src/include/freetdm.h
浏览文件 @
917609df
...
@@ -1374,8 +1374,6 @@ FT_DECLARE(uint32_t) ftdm_group_get_id(const ftdm_group_t *group);
...
@@ -1374,8 +1374,6 @@ FT_DECLARE(uint32_t) ftdm_group_get_id(const ftdm_group_t *group);
*/
*/
FT_DECLARE
(
ftdm_status_t
)
ftdm_channel_open
(
uint32_t
span_id
,
uint32_t
chan_id
,
ftdm_channel_t
**
ftdmchan
);
FT_DECLARE
(
ftdm_status_t
)
ftdm_channel_open
(
uint32_t
span_id
,
uint32_t
chan_id
,
ftdm_channel_t
**
ftdmchan
);
FT_DECLARE
(
ftdm_status_t
)
ftdm_raw_channel_open
(
uint32_t
span_id
,
uint32_t
chan_id
,
ftdm_channel_t
**
ftdmchan
);
/*!
/*!
* \brief Hunts and opens a channel specifying the span id only
* \brief Hunts and opens a channel specifying the span id only
*
*
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论