Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
40413633
提交
40413633
authored
10月 01, 2008
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tweak
git-svn-id:
http://svn.openzap.org/svn/openzap/trunk@575
a93c3328-9c30-0410-af19-c9cd2b2d52af
上级
88f09d59
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
78 行增加
和
33 行删除
+78
-33
ozmod_wanpipe.c
libs/freetdm/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.c
+10
-3
wanpipe_tdm_api_iface.h
libs/freetdm/src/ozmod/ozmod_wanpipe/wanpipe_tdm_api_iface.h
+68
-30
没有找到文件。
libs/freetdm/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.c
浏览文件 @
40413633
...
@@ -525,7 +525,16 @@ static ZIO_OPEN_FUNCTION(wanpipe_open)
...
@@ -525,7 +525,16 @@ static ZIO_OPEN_FUNCTION(wanpipe_open)
zchan
->
native_codec
=
zchan
->
effective_codec
=
ZAP_CODEC_NONE
;
zchan
->
native_codec
=
zchan
->
effective_codec
=
ZAP_CODEC_NONE
;
}
else
{
}
else
{
tdm_api
.
wp_tdm_cmd
.
cmd
=
SIOC_WP_TDM_SET_CODEC
;
tdm_api
.
wp_tdm_cmd
.
cmd
=
SIOC_WP_TDM_SET_CODEC
;
if
(
zchan
->
native_codec
==
ZAP_CODEC_ULAW
)
{
tdm_api
.
wp_tdm_cmd
.
tdm_codec
=
0
;
tdm_api
.
wp_tdm_cmd
.
tdm_codec
=
0
;
}
else
if
(
zchan
->
native_codec
==
ZAP_CODEC_ALAW
)
{
tdm_api
.
wp_tdm_cmd
.
tdm_codec
=
1
;
}
else
{
tdm_api
.
wp_tdm_cmd
.
tdm_codec
=
2
;
}
zchan
->
effective_codec
=
zchan
->
native_codec
;
wp_tdm_cmd_exec
(
zchan
,
&
tdm_api
);
wp_tdm_cmd_exec
(
zchan
,
&
tdm_api
);
tdm_api
.
wp_tdm_cmd
.
cmd
=
SIOC_WP_TDM_SET_USR_PERIOD
;
tdm_api
.
wp_tdm_cmd
.
cmd
=
SIOC_WP_TDM_SET_USR_PERIOD
;
...
@@ -534,8 +543,6 @@ static ZIO_OPEN_FUNCTION(wanpipe_open)
...
@@ -534,8 +543,6 @@ static ZIO_OPEN_FUNCTION(wanpipe_open)
zap_channel_set_feature
(
zchan
,
ZAP_CHANNEL_FEATURE_INTERVAL
);
zap_channel_set_feature
(
zchan
,
ZAP_CHANNEL_FEATURE_INTERVAL
);
zchan
->
effective_interval
=
zchan
->
native_interval
=
wp_globals
.
codec_ms
;
zchan
->
effective_interval
=
zchan
->
native_interval
=
wp_globals
.
codec_ms
;
zchan
->
packet_len
=
zchan
->
native_interval
*
8
;
zchan
->
packet_len
=
zchan
->
native_interval
*
8
;
zchan
->
native_codec
=
zchan
->
effective_codec
;
}
}
return
ZAP_SUCCESS
;
return
ZAP_SUCCESS
;
...
...
libs/freetdm/src/ozmod/ozmod_wanpipe/wanpipe_tdm_api_iface.h
浏览文件 @
40413633
/*****************************************************************************
/*****************************************************************************
* wanpipe_tdm_api.h
* wanpipe_tdm_api
_iface
.h
*
*
* WANPIPE(tm) AFT TE1 Hardware Support
* WANPIPE(tm) AFT TE1 Hardware Support
*
*
* Authors: Nenad Corbic <ncorbic@sangoma.com>
* Authors: Nenad Corbic <ncorbic@sangoma.com>
*
*
* Copyright (c) 2007, Sangoma Technologies
* Copyright (c) 2007
- 08
, Sangoma Technologies
* All rights reserved.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without
...
@@ -46,6 +46,12 @@ typedef HANDLE sng_fd_t;
...
@@ -46,6 +46,12 @@ typedef HANDLE sng_fd_t;
typedef
int
sng_fd_t
;
typedef
int
sng_fd_t
;
#endif
#endif
/* Indicate to library that new features exist */
#define WP_TDM_FEATURE_DTMF_EVENTS 1
#define WP_TDM_FEATURE_FE_ALARM 1
#define WP_TDM_FEATURE_EVENTS 1
#define WP_TDM_FEATURE_LINK_STATUS 1
enum
wanpipe_tdm_api_cmds
{
enum
wanpipe_tdm_api_cmds
{
SIOC_WP_TDM_GET_USR_MTU_MRU
,
/* 0x00 */
SIOC_WP_TDM_GET_USR_MTU_MRU
,
/* 0x00 */
...
@@ -82,23 +88,29 @@ enum wanpipe_tdm_api_cmds {
...
@@ -82,23 +88,29 @@ enum wanpipe_tdm_api_cmds {
SIOC_WP_TDM_READ_EVENT
,
/* 0x15 */
SIOC_WP_TDM_READ_EVENT
,
/* 0x15 */
SIOC_WP_TDM_SET_EVENT
,
SIOC_WP_TDM_SET_EVENT
,
/* 0x16 */
SIOC_WP_TDM_SET_RX_GAINS
,
SIOC_WP_TDM_SET_RX_GAINS
,
/* 0x17 */
SIOC_WP_TDM_SET_TX_GAINS
,
SIOC_WP_TDM_SET_TX_GAINS
,
/* 0x18 */
SIOC_WP_TDM_CLEAR_RX_GAINS
,
SIOC_WP_TDM_CLEAR_RX_GAINS
,
/* 0x19 */
SIOC_WP_TDM_CLEAR_TX_GAINS
,
SIOC_WP_TDM_CLEAR_TX_GAINS
,
/* 0x1A */
SIOC_WP_TDM_GET_FE_ALARMS
,
SIOC_WP_TDM_GET_FE_ALARMS
,
/* 0x1B */
SIOC_WP_TDM_ENABLE_HWEC
,
SIOC_WP_TDM_ENABLE_HWEC
,
/* 0x1C */
SIOC_WP_TDM_DISABLE_HWEC
,
SIOC_WP_TDM_DISABLE_HWEC
,
/* 0x1D */
SIOC_WP_TDM_NOTSUPP
/* */
SIOC_WP_TDM_SET_FE_STATUS
,
/* 0x1E */
SIOC_WP_TDM_GET_FE_STATUS
,
/* 0x1F */
SIOC_WP_TDM_GET_HW_DTMF
,
/* 0x20 */
SIOC_WP_TDM_NOTSUPP
/* */
};
};
#define SIOC_WP_TDM_GET_LINK_STATUS SIOC_WP_TDM_GET_FE_STATUS
enum
wanpipe_tdm_api_events
{
enum
wanpipe_tdm_api_events
{
WP_TDMAPI_EVENT_NONE
,
WP_TDMAPI_EVENT_NONE
,
WP_TDMAPI_EVENT_RBS
,
WP_TDMAPI_EVENT_RBS
,
...
@@ -115,9 +127,14 @@ enum wanpipe_tdm_api_events {
...
@@ -115,9 +127,14 @@ enum wanpipe_tdm_api_events {
WP_TDMAPI_EVENT_TXSIG_OFFHOOK
,
WP_TDMAPI_EVENT_TXSIG_OFFHOOK
,
WP_TDMAPI_EVENT_TXSIG_ONHOOK
,
WP_TDMAPI_EVENT_TXSIG_ONHOOK
,
WP_TDMAPI_EVENT_ONHOOKTRANSFER
,
WP_TDMAPI_EVENT_ONHOOKTRANSFER
,
WP_TDMAPI_EVENT_SETPOLARITY
WP_TDMAPI_EVENT_SETPOLARITY
,
WP_TDMAPI_EVENT_BRI_CHAN_LOOPBACK
,
WP_TDMAPI_EVENT_LINK_STATUS
};
};
#define WP_TDMAPI_EVENT_FE_ALARM WP_TDMAPI_EVENT_ALARM
#define WP_TDMAPI_EVENT_ENABLE 0x01
#define WP_TDMAPI_EVENT_ENABLE 0x01
#define WP_TDMAPI_EVENT_DISABLE 0x02
#define WP_TDMAPI_EVENT_DISABLE 0x02
#define WP_TDMAPI_EVENT_MODE_DECODE(mode) \
#define WP_TDMAPI_EVENT_MODE_DECODE(mode) \
...
@@ -150,45 +167,61 @@ enum wanpipe_tdm_api_events {
...
@@ -150,45 +167,61 @@ enum wanpipe_tdm_api_events {
((state) == WP_TDMAPI_EVENT_RING_TRIP_PRESENT) ? "Ring Present" : \
((state) == WP_TDMAPI_EVENT_RING_TRIP_PRESENT) ? "Ring Present" : \
((state) == WP_TDMAPI_EVENT_RING_TRIP_STOP) ? "Ring Stop" : \
((state) == WP_TDMAPI_EVENT_RING_TRIP_STOP) ? "Ring Stop" : \
"(Unknown state)"
"(Unknown state)"
/*Link Status */
#define WP_TDMAPI_EVENT_LINK_STATUS_CONNECTED 0x01
#define WP_TDMAPI_EVENT_LINK_STATUS_DISCONNECTED 0x02
#define WP_TDMAPI_EVENT_LINK_STATUS_DECODE(status) \
((status) == WP_TDMAPI_EVENT_LINK_STATUS_CONNECTED) ? "Connected" : \
((status) == WP_TDMAPI_EVENT_LINK_STATUS_DISCONNECTED) ? "Disconnected" : \
"Unknown"
#define WP_TDMAPI_EVENT_TONE_DIAL 0x01
#define WP_TDMAPI_EVENT_TONE_DIAL 0x01
#define WP_TDMAPI_EVENT_TONE_BUSY 0x02
#define WP_TDMAPI_EVENT_TONE_BUSY 0x02
#define WP_TDMAPI_EVENT_TONE_RING 0x03
#define WP_TDMAPI_EVENT_TONE_RING 0x03
#define WP_TDMAPI_EVENT_TONE_CONGESTION 0x04
#define WP_TDMAPI_EVENT_TONE_CONGESTION 0x04
/* BRI channels list */
#define WAN_BRI_BCHAN1 0x01
#define WAN_BRI_BCHAN2 0x02
#define WAN_BRI_DCHAN 0x03
typedef
struct
{
typedef
struct
{
uint8_t
type
;
u_int8_t
type
;
uint8_t
mode
;
u_int8_t
mode
;
uint32_t
time_stamp
;
u_int32_t
time_stamp
;
uint16_t
channel
;
u_int8_t
channel
;
uint32_t
chan_map
;
u_int32_t
chan_map
;
u_int8_t
span
;
union
{
union
{
struct
{
struct
{
uint8_t
alarm
;
u
_
int8_t
alarm
;
}
te1_alarm
;
}
te1_alarm
;
struct
{
struct
{
uint8_t
rbs_bits
;
u
_
int8_t
rbs_bits
;
}
te1_rbs
;
}
te1_rbs
;
struct
{
struct
{
uint8_t
state
;
u
_
int8_t
state
;
uint8_t
sig
;
u
_
int8_t
sig
;
}
rm_hook
;
}
rm_hook
;
struct
{
struct
{
uint8_t
state
;
u
_
int8_t
state
;
}
rm_ring
;
}
rm_ring
;
struct
{
struct
{
uint8_t
type
;
u
_
int8_t
type
;
}
rm_tone
;
}
rm_tone
;
struct
{
struct
{
uint8_t
digit
;
/* DTMF: digit */
u
_
int8_t
digit
;
/* DTMF: digit */
uint8_t
port
;
/* DTMF: SOUT/ROUT */
u
_
int8_t
port
;
/* DTMF: SOUT/ROUT */
uint8_t
type
;
/* DTMF: PRESET/STOP */
u
_
int8_t
type
;
/* DTMF: PRESET/STOP */
}
dtmf
;
}
dtmf
;
struct
{
struct
{
uint16_t
polarity
;
u
_
int16_t
polarity
;
uint16_t
ohttimer
;
u
_
int16_t
ohttimer
;
}
rm_common
;
}
rm_common
;
struct
{
u_int16_t
status
;
}
linkstatus
;
}
wp_tdm_api_event_u
;
}
wp_tdm_api_event_u
;
#define wp_tdm_api_event_type type
#define wp_tdm_api_event_type type
#define wp_tdm_api_event_mode mode
#define wp_tdm_api_event_mode mode
...
@@ -204,6 +237,7 @@ typedef struct {
...
@@ -204,6 +237,7 @@ typedef struct {
#define wp_tdm_api_event_dtmf_port wp_tdm_api_event_u.dtmf.port
#define wp_tdm_api_event_dtmf_port wp_tdm_api_event_u.dtmf.port
#define wp_tdm_api_event_ohttimer wp_tdm_api_event_u.rm_common.ohttimer
#define wp_tdm_api_event_ohttimer wp_tdm_api_event_u.rm_common.ohttimer
#define wp_tdm_api_event_polarity wp_tdm_api_event_u.rm_common.polarity
#define wp_tdm_api_event_polarity wp_tdm_api_event_u.rm_common.polarity
#define wp_tdm_api_event_link_status wp_tdm_api_event_u.linkstatus.status
}
wp_tdm_api_event_t
;
}
wp_tdm_api_event_t
;
typedef
struct
{
typedef
struct
{
...
@@ -290,9 +324,12 @@ typedef struct wanpipe_tdm_api_cmd{
...
@@ -290,9 +324,12 @@ typedef struct wanpipe_tdm_api_cmd{
unsigned
int
idle_flag
;
/* IDLE flag to Tx */
unsigned
int
idle_flag
;
/* IDLE flag to Tx */
unsigned
int
fe_alarms
;
/* FE Alarms detected */
unsigned
int
fe_alarms
;
/* FE Alarms detected */
wp_tdm_chan_stats_t
stats
;
/* TDM Statistics */
wp_tdm_chan_stats_t
stats
;
/* TDM Statistics */
/* Do NOT add anything above this! Important for binary backward compatibility. */
wp_tdm_api_event_t
event
;
/* TDM Event */
wp_tdm_api_event_t
event
;
/* TDM Event */
unsigned
int
data_len
;
unsigned
int
data_len
;
void
*
data
;
void
*
data
;
unsigned
char
fe_status
;
/* FE status - Connected or Disconnected */
unsigned
int
hw_dtmf
;
/* HW DTMF enabled */
}
wanpipe_tdm_api_cmd_t
;
}
wanpipe_tdm_api_cmd_t
;
typedef
struct
wanpipe_tdm_api_event
{
typedef
struct
wanpipe_tdm_api_event
{
...
@@ -302,6 +339,7 @@ typedef struct wanpipe_tdm_api_event{
...
@@ -302,6 +339,7 @@ typedef struct wanpipe_tdm_api_event{
int
(
*
wp_ring_detect_event
)(
sng_fd_t
fd
,
unsigned
char
ring_state
);
int
(
*
wp_ring_detect_event
)(
sng_fd_t
fd
,
unsigned
char
ring_state
);
int
(
*
wp_ring_trip_detect_event
)(
sng_fd_t
fd
,
unsigned
char
ring_state
);
int
(
*
wp_ring_trip_detect_event
)(
sng_fd_t
fd
,
unsigned
char
ring_state
);
int
(
*
wp_fe_alarm_event
)(
sng_fd_t
fd
,
unsigned
char
fe_alarm_event
);
int
(
*
wp_fe_alarm_event
)(
sng_fd_t
fd
,
unsigned
char
fe_alarm_event
);
int
(
*
wp_link_status_event
)(
sng_fd_t
fd
,
unsigned
char
link_status_event
);
}
wanpipe_tdm_api_event_t
;
}
wanpipe_tdm_api_event_t
;
typedef
struct
wanpipe_tdm_api
{
typedef
struct
wanpipe_tdm_api
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论