Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b485f25f
提交
b485f25f
authored
7月 30, 2010
作者:
Moises Silva
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
freetdm: add PRI tapping starting code
上级
fd254766
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
711 行增加
和
7 行删除
+711
-7
Makefile.am
libs/freetdm/Makefile.am
+11
-0
configure.ac
libs/freetdm/configure.ac
+7
-0
mod_freetdm.c
libs/freetdm/mod_freetdm/mod_freetdm.c
+53
-0
ftdm_io.c
libs/freetdm/src/ftdm_io.c
+14
-7
ftmod_pritap.c
libs/freetdm/src/ftmod/ftmod_pritap/ftmod_pritap.c
+626
-0
没有找到文件。
libs/freetdm/Makefile.am
浏览文件 @
b485f25f
...
@@ -172,6 +172,10 @@ if LIBPRI
...
@@ -172,6 +172,10 @@ if LIBPRI
mod_LTLIBRARIES
+=
ftmod_libpri.la
mod_LTLIBRARIES
+=
ftmod_libpri.la
endif
endif
if
PRITAP
mod_LTLIBRARIES
+=
ftmod_pritap.la
endif
if
SNGSS7
if
SNGSS7
mod_LTLIBRARIES
+=
ftmod_sangoma_ss7.la
mod_LTLIBRARIES
+=
ftmod_sangoma_ss7.la
endif
endif
...
@@ -252,6 +256,13 @@ ftmod_libpri_la_LDFLAGS = -module -avoid-version -lpri
...
@@ -252,6 +256,13 @@ ftmod_libpri_la_LDFLAGS = -module -avoid-version -lpri
ftmod_libpri_la_LIBADD
=
$(MYLIB)
ftmod_libpri_la_LIBADD
=
$(MYLIB)
endif
endif
if
PRITAP
ftmod_pritap_la_SOURCES
=
$(SRC)
/ftmod/ftmod_pritap/ftmod_pritap.c
ftmod_pritap_la_CFLAGS
=
$(AM_CFLAGS)
$(MY_CFLAGS)
ftmod_pritap_la_LDFLAGS
=
-module
-avoid-version
-lpri
ftmod_pritap_la_LIBADD
=
$(MYLIB)
endif
if
SNGSS7
if
SNGSS7
ftmod_sangoma_ss7_la_SOURCES
=
$(SRC)
/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c
\
ftmod_sangoma_ss7_la_SOURCES
=
$(SRC)
/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c
\
$(SRC)
/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c
\
$(SRC)
/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c
\
...
...
libs/freetdm/configure.ac
浏览文件 @
b485f25f
...
@@ -165,6 +165,11 @@ AC_ARG_WITH([libpri],
...
@@ -165,6 +165,11 @@ AC_ARG_WITH([libpri],
[AS_HELP_STRING([--with-libpri], [Install ftmod_libpri])], [enable_libpri="yes"], [enable_libpri="no"])
[AS_HELP_STRING([--with-libpri], [Install ftmod_libpri])], [enable_libpri="yes"], [enable_libpri="no"])
AC_SUBST(enable_libpri)
AC_SUBST(enable_libpri)
# pritap?
AC_ARG_WITH([pritap],
[AS_HELP_STRING([--with-pritap], [Install ftmod_pritap])], [enable_pritap="yes"], [enable_pritap="no"])
AC_SUBST(enable_pritap)
# debug dtmf?
# debug dtmf?
AC_ARG_WITH([debugdtmf],
AC_ARG_WITH([debugdtmf],
[AS_HELP_STRING([--with-debugdtmf], [Debug DTMF])], [enable_debugdtmf="yes"], [enable_debugdtmf="no"])
[AS_HELP_STRING([--with-debugdtmf], [Debug DTMF])], [enable_debugdtmf="yes"], [enable_debugdtmf="no"])
...
@@ -175,6 +180,8 @@ AM_CONDITIONAL([LIBSANGOMA],[test "${have_libsangoma}" = "yes"])
...
@@ -175,6 +180,8 @@ AM_CONDITIONAL([LIBSANGOMA],[test "${have_libsangoma}" = "yes"])
AM_CONDITIONAL([LIBPRI],[test "${enable_libpri}" = "yes"])
AM_CONDITIONAL([LIBPRI],[test "${enable_libpri}" = "yes"])
AM_CONDITIONAL([PRITAP],[test "${enable_pritap}" = "yes"])
AM_CONDITIONAL([DEBUGDTMF],[test "${enable_debugdtmf}" = "yes"])
AM_CONDITIONAL([DEBUGDTMF],[test "${enable_debugdtmf}" = "yes"])
AC_CHECK_LIB([sng_ss7], [sng_isup_init], [have_sng_ss7="yes"])
AC_CHECK_LIB([sng_ss7], [sng_isup_init], [have_sng_ss7="yes"])
...
...
libs/freetdm/mod_freetdm/mod_freetdm.c
浏览文件 @
b485f25f
...
@@ -2938,6 +2938,59 @@ static switch_status_t load_config(void)
...
@@ -2938,6 +2938,59 @@ static switch_status_t load_config(void)
}
}
}
}
if
((
spans
=
switch_xml_child
(
cfg
,
"pritap_spans"
)))
{
for
(
myspan
=
switch_xml_child
(
spans
,
"span"
);
myspan
;
myspan
=
myspan
->
next
)
{
char
*
name
=
(
char
*
)
switch_xml_attr
(
myspan
,
"name"
);
ftdm_status_t
zstatus
=
FTDM_FAIL
;
unsigned
paramindex
=
0
;
ftdm_conf_parameter_t
spanparameters
[
10
];
const
char
*
context
=
"default"
;
const
char
*
dialplan
=
"XML"
;
ftdm_span_t
*
span
=
NULL
;
int
span_id
=
0
;
if
(
!
name
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"span missing required attribute 'name'
\n
"
);
continue
;
}
for
(
param
=
switch_xml_child
(
myspan
,
"param"
);
param
;
param
=
param
->
next
)
{
char
*
var
=
(
char
*
)
switch_xml_attr_soft
(
param
,
"name"
);
char
*
val
=
(
char
*
)
switch_xml_attr_soft
(
param
,
"value"
);
if
(
!
strcasecmp
(
var
,
"context"
))
{
context
=
val
;
}
else
if
(
!
strcasecmp
(
var
,
"dialplan"
))
{
dialplan
=
val
;
}
else
{
spanparameters
[
paramindex
].
var
=
var
;
spanparameters
[
paramindex
].
val
=
val
;
paramindex
++
;
}
}
zstatus
=
ftdm_span_find_by_name
(
name
,
&
span
);
if
(
zstatus
!=
FTDM_SUCCESS
)
{
ftdm_log
(
FTDM_LOG_ERROR
,
"Error finding FreeTDM span %s
\n
"
,
name
);
continue
;
}
span_id
=
ftdm_span_get_id
(
span
);
if
(
ftdm_configure_span_signaling
(
span
,
"pritap"
,
on_clear_channel_signal
,
spanparameters
)
!=
FTDM_SUCCESS
)
{
ftdm_log
(
FTDM_LOG_ERROR
,
"Error configuring FreeTDM span %s
\n
"
,
name
);
continue
;
}
SPAN_CONFIG
[
span_id
].
span
=
span
;
switch_copy_string
(
SPAN_CONFIG
[
span_id
].
context
,
context
,
sizeof
(
SPAN_CONFIG
[
span_id
].
context
));
switch_copy_string
(
SPAN_CONFIG
[
span_id
].
dialplan
,
dialplan
,
sizeof
(
SPAN_CONFIG
[
span_id
].
dialplan
));
switch_copy_string
(
SPAN_CONFIG
[
span_id
].
type
,
"isdn"
,
sizeof
(
SPAN_CONFIG
[
span_id
].
type
));
ftdm_span_start
(
span
);
}
}
if
((
spans
=
switch_xml_child
(
cfg
,
"libpri_spans"
)))
{
if
((
spans
=
switch_xml_child
(
cfg
,
"libpri_spans"
)))
{
...
...
libs/freetdm/src/ftdm_io.c
浏览文件 @
b485f25f
...
@@ -1334,21 +1334,28 @@ static __inline__ int chan_is_avail(ftdm_channel_t *check)
...
@@ -1334,21 +1334,28 @@ static __inline__ int chan_is_avail(ftdm_channel_t *check)
ftdm_test_flag
(
check
,
FTDM_CHANNEL_INUSE
)
||
ftdm_test_flag
(
check
,
FTDM_CHANNEL_INUSE
)
||
ftdm_test_flag
(
check
,
FTDM_CHANNEL_SUSPENDED
)
||
ftdm_test_flag
(
check
,
FTDM_CHANNEL_SUSPENDED
)
||
ftdm_test_flag
(
check
,
FTDM_CHANNEL_IN_ALARM
)
||
ftdm_test_flag
(
check
,
FTDM_CHANNEL_IN_ALARM
)
||
check
->
state
!=
FTDM_CHANNEL_STATE_DOWN
||
check
->
state
!=
FTDM_CHANNEL_STATE_DOWN
)
{
!
FTDM_IS_VOICE_CHANNEL
(
check
))
{
return
0
;
return
0
;
}
}
return
1
;
return
1
;
}
}
static
__inline__
int
request_channel
(
ftdm_channel_t
*
check
,
ftdm_channel_t
**
ftdmchan
,
static
__inline__
int
chan_voice_is_avail
(
ftdm_channel_t
*
check
)
{
if
(
!
FTDM_IS_VOICE_CHANNEL
(
check
))
{
return
0
;
}
return
chan_is_avail
(
check
);
}
static
__inline__
int
request_voice_channel
(
ftdm_channel_t
*
check
,
ftdm_channel_t
**
ftdmchan
,
ftdm_caller_data_t
*
caller_data
,
ftdm_direction_t
direction
)
ftdm_caller_data_t
*
caller_data
,
ftdm_direction_t
direction
)
{
{
ftdm_status_t
status
;
ftdm_status_t
status
;
if
(
chan_is_avail
(
check
))
{
if
(
chan_
voice_
is_avail
(
check
))
{
/* unlocked testing passed, try again with the channel locked */
/* unlocked testing passed, try again with the channel locked */
ftdm_mutex_lock
(
check
->
mutex
);
ftdm_mutex_lock
(
check
->
mutex
);
if
(
chan_is_avail
(
check
))
{
if
(
chan_
voice_
is_avail
(
check
))
{
if
(
check
->
span
&&
check
->
span
->
channel_request
)
{
if
(
check
->
span
&&
check
->
span
->
channel_request
)
{
/* I am only unlocking here cuz this function is called
/* I am only unlocking here cuz this function is called
* sometimes with the group or span lock held and were
* sometimes with the group or span lock held and were
...
@@ -1468,7 +1475,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_open_by_group(uint32_t group_id, ftdm_dir
...
@@ -1468,7 +1475,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_open_by_group(uint32_t group_id, ftdm_dir
break
;
break
;
}
}
if
(
request_channel
(
check
,
ftdmchan
,
caller_data
,
direction
))
{
if
(
request_
voice_
channel
(
check
,
ftdmchan
,
caller_data
,
direction
))
{
status
=
FTDM_SUCCESS
;
status
=
FTDM_SUCCESS
;
break
;
break
;
}
}
...
@@ -1579,7 +1586,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_open_by_span(uint32_t span_id, ftdm_direc
...
@@ -1579,7 +1586,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_open_by_span(uint32_t span_id, ftdm_direc
break
;
break
;
}
}
if
(
request_channel
(
check
,
ftdmchan
,
caller_data
,
direction
))
{
if
(
request_
voice_
channel
(
check
,
ftdmchan
,
caller_data
,
direction
))
{
status
=
FTDM_SUCCESS
;
status
=
FTDM_SUCCESS
;
break
;
break
;
}
}
...
...
libs/freetdm/src/ftmod/ftmod_pritap/ftmod_pritap.c
0 → 100644
浏览文件 @
b485f25f
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论