Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
004cc9d7
提交
004cc9d7
authored
12月 06, 2010
作者:
Moises Silva
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'moy.iodump'
上级
e85ef4ce
e37ce444
全部展开
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
672 行增加
和
217 行删除
+672
-217
Makefile.am
libs/freetdm/Makefile.am
+0
-4
freetdm.conf
libs/freetdm/conf/freetdm.conf
+26
-0
freetdm.conf.xml
libs/freetdm/conf/freetdm.conf.xml
+215
-47
configure.ac
libs/freetdm/configure.ac
+0
-11
mod_freetdm.c
libs/freetdm/mod_freetdm/mod_freetdm.c
+23
-20
ftdm_io.c
libs/freetdm/src/ftdm_io.c
+278
-93
ftmod_r2.c
libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c
+84
-30
freetdm.h
libs/freetdm/src/include/freetdm.h
+30
-0
ftdm_core.h
libs/freetdm/src/include/private/ftdm_core.h
+15
-12
ftdm_types.h
libs/freetdm/src/include/private/ftdm_types.h
+1
-0
没有找到文件。
libs/freetdm/Makefile.am
浏览文件 @
004cc9d7
...
@@ -55,10 +55,6 @@ COMPILE = $(CC) $(FTDM_CFLAGS)
...
@@ -55,10 +55,6 @@ COMPILE = $(CC) $(FTDM_CFLAGS)
LTCOMPILE
=
$(LIBTOOL)
--mode
=
compile
--tag
=
CC
$(COMPILE)
LTCOMPILE
=
$(LIBTOOL)
--mode
=
compile
--tag
=
CC
$(COMPILE)
LINK
=
$(LIBTOOL)
--mode
=
link
--tag
=
CC
$(CC)
$(FTDM_CFLAGS)
$(LDFLAGS)
-o
$@
LINK
=
$(LIBTOOL)
--mode
=
link
--tag
=
CC
$(CC)
$(FTDM_CFLAGS)
$(LDFLAGS)
-o
$@
if
WANT_DEBUGDTMF
FTDM_CFLAGS
+=
-DFTDM_DEBUG_DTMF
endif
#
#
# GNU pkgconfig file
# GNU pkgconfig file
...
...
libs/freetdm/conf/freetdm.conf
浏览文件 @
004cc9d7
...
@@ -45,3 +45,29 @@ fxs-channel => 1
...
@@ -45,3 +45,29 @@ fxs-channel => 1
number
=>
2
number
=>
2
fxo
-
channel
=>
3
fxo
-
channel
=>
3
;
MFC
-
R2
typical
span
configuration
;
MFC
-
R2
with
wanpipe
(
Sangoma
)
[
span
wanpipe
myWanpipeSpan
]
trunk_type
=>
E1
cas
-
channel
=>
1
-
15
:
1101
cas
-
channel
=>
17
-
31
:
1101
;
MFC
-
R2
with
Zaptel
/
DAHDI
[
span
zt
myWanpipeSpan
]
trunk_type
=>
E1
cas
-
channel
=>
1
-
15
:
1101
cas
-
channel
=>
17
-
31
:
1101
;
generic
channel
parameters
;
this
parameters
are
accepted
by
any
type
of
span
/
channel
;
remember
that
for
generic
channel
parameters
only
channels
;
below
the
parameter
within
the
span
will
be
affected
;
Channel
audio
gain
;
rxgain
=>
0
.
0
;
txgain
=>
0
.
0
;
Whether
to
perform
media
dumps
for
DTMF
debugging
;
debugdtmf
=>
yes
libs/freetdm/conf/freetdm.conf.xml
浏览文件 @
004cc9d7
<!-- Please refer to http://wiki.freeswitch.org/wiki/FreeTDM for further documentation -->
<!-- Please refer to http://wiki.freeswitch.org/wiki/FreeTDM for further documentation -->
<!--
This is a sample FreeSWITCH XML configuration for FreeTDM
Remember you still need to configure freetdm.conf (no XML extension) in $prefix/conf/
directory of FreeSWITCH. The freetdm.conf (no XML extension) is a simple text file
definining the I/O interfaces (Sangoma, DAHDI etc). This file (freetdm.conf.xml) deals
with the signaling protocols that you can run on top of your I/O interfaces.
-->
<configuration
name=
"freetdm.conf"
description=
"FreeTDM Configuration"
>
<configuration
name=
"freetdm.conf"
description=
"FreeTDM Configuration"
>
<settings>
<settings>
<param
name=
"debug"
value=
"0"
/>
<param
name=
"debug"
value=
"0"
/>
<!--<param name="hold-music" value="$${moh_uri}"/>-->
<!--<param name="hold-music" value="$${moh_uri}"/>-->
...
@@ -8,30 +16,9 @@
...
@@ -8,30 +16,9 @@
<!--<param name="enable-analog-option" value="3-way"/>-->
<!--<param name="enable-analog-option" value="3-way"/>-->
</settings>
</settings>
<!-- use the <pri_spans> tag for native ISDN support (most likely broken at this point, check sangoma_pri_spans or libpri_spans for alternatives) -->
<!-- Sample analog configuration -->
<pri_spans>
<span
name=
"PRI_1"
>
<!-- Log Levels: none, alert, crit, err, warning, notice, info, debug -->
<param
name=
"q921loglevel"
value=
"alert"
/>
<param
name=
"q931loglevel"
value=
"alert"
/>
<param
name=
"mode"
value=
"user"
/>
<param
name=
"dialect"
value=
"5ess"
/>
<param
name=
"dialplan"
value=
"XML"
/>
<param
name=
"context"
value=
"default"
/>
</span>
<span
name=
"PRI_2"
>
<param
name=
"q921loglevel"
value=
"alert"
/>
<param
name=
"q931loglevel"
value=
"alert"
/>
<param
name=
"mode"
value=
"user"
/>
<param
name=
"dialect"
value=
"5ess"
/>
<param
name=
"dialplan"
value=
"XML"
/>
<param
name=
"context"
value=
"default"
/>
</span>
</pri_spans>
<!-- Analog spans go here -->
<analog_spans>
<analog_spans>
<!-- The span name must match the name in your freetdm.conf -->
<span
name=
"myAnalog"
>
<span
name=
"myAnalog"
>
<!--<param name="hold-music" value="$${moh_uri}"/>-->
<!--<param name="hold-music" value="$${moh_uri}"/>-->
<!--<param name="enable-analog-option" value="call-swap"/>-->
<!--<param name="enable-analog-option" value="call-swap"/>-->
...
@@ -49,4 +36,185 @@
...
@@ -49,4 +36,185 @@
</span>
</span>
</analog_spans>
</analog_spans>
<!-- openr2 (MFC-R2 signaling) spans
MFC-R2 signaling has lots of variants from country to country and even sometimes
minor variants inside the same country. The only mandatory parameters here are:
variant, but typically you also want to set max_ani and max_dnis.
IT IS RECOMMENDED that you leave the default values (leaving them commented) for the
other parameters unless you have problems or you have been instructed to change some
parameter. OpenR2 library uses the 'variant' parameter to try to determine the
best defaults for your country. If you want to contribute your configs for a particular
country send them to the e-mail of the primary OpenR2 developer that you can find in the
AUTHORS file of the OpenR2 package, they will be added to the samples directory of openr2.
-->
<r2_spans>
<span
name=
"wp1"
cfgprofile=
"testr2"
>
<!--
MFC/R2 variant. This depends on the OpenR2 supported variants
A list of values can be found by executing the openr2 command r2test -l
some valid values are:
mx (Mexico)
ar (Argentina)
br (Brazil)
ph (Philippines)
itu (per ITU spec)
-->
<param
name=
"variant"
value=
"mx"
/>
<!-- switch parameters (required), where to send calls to -->
<param
name=
"dialplan"
value=
"XML"
/>
<param
name=
"context"
value=
"default"
/>
<!--
Max amount of ANI (caller id digits) to ask for
<param name="max_ani" value="4"/>
-->
<!--
Max amount of DNIS to ask for
<param name="max_dnis" value="4"/>
-->
<!-- Do not set parameters below this line unless you desire to tweak it because is not working -->
<!--
Whether or not to get the ANI before getting DNIS (only affects incoming calls)
Some telcos require ANI first some others do not care, if default go wrong on
incoming calls, change this value
<param name="get_ani_first" value="yes"/>
-->
<!--
Caller Category to send. Accepted values:
- national_subscriber
- national_priority_subscriber
- international_subscriber
- international_priority_subscriber
- collect_call
Usually national_subscriber (the default) works just fine
<param name="category" value="national_subscriber"/>
-->
<!--
Brazil uses a special calling party category for collect calls (llamadas por cobrar)
instead of using the operator (as in Mexico). The R2 spec in Brazil says a special GB tone
should be used to reject collect calls. If you want to ALLOW collect calls specify 'yes',
if you want to BLOCK collect calls then say 'no'. Default is to block collect calls.
(see also 'double_answer')
<param name="allow_collect_calls" value="yes"/>
-->
<!--
This feature is related but independent of allow_collect_calls
Some PBX's require a double-answer process to block collect calls, if
you ever have problems blocking collect calls using Group B signals (allow_collect_calls=no)
then you may want to try with double_answer=yes, this will cause that every answer signal
is changed to perform 'answer -> clear back -> answer' (sort of a flash)
(see also 'allow_collect_calls')
<param name="double_answer" value="yes"/>
-->
<!--
This feature allows to skip the use of Group B/II signals and go directly
to the accepted state for incoming calls
<param name="immediate_accept" value="yes"/>
-->
<!--
Skip request of calling party category and ANI
<param name="skip_category" value="yes"/>
-->
<!--
Brazil use a special signal to force the release of the line (hangup) from the
backward perspective. When forced_release=no, the normal clear back signal
will be sent on hangup, which is OK for all mfcr2 variants I know of, except for
Brazilian variant, where the central will leave the line up for several seconds (30, 60)
which sometimes is not what people really want. When forced_release=yes, a different
signal will be sent to hangup the call indicating that the line should be released immediately
<param name="forced_release" value="yes"/>
-->
<!--
Whether or not report to the other end 'accept call with charge'
This setting has no effect with most telecos, usually is safe
leave the default (yes), but once in a while when interconnecting with
old PBXs this may be useful.
Concretely this affects the Group B signal used to accept calls
<param name="charge_calls" value="yes"/>
-->
<!--
MFC/R2 value in milliseconds for the MF timeout. Any negative value
means 'default', smaller values than 500ms are not recommended
and can cause malfunctioning. If you experience protocol error
due to MF timeout try incrementing this value in 500ms steps
<param name="mfback_timeout" value="1500"/>
-->
<!--
MFC/R2 value in milliseconds for the metering pulse timeout.
Metering pulses are sent by some telcos for some R2 variants
during a call presumably for billing purposes to indicate costs,
however this pulses use the same signal that is used to indicate
call hangup, therefore a timeout is sometimes required to distinguish
between a *real* hangup and a billing pulse that should not
last more than 500ms, If you experience call drops after some
minutes of being stablished try setting a value of some ms here,
values greater than 500ms are not recommended.
BE AWARE that choosing the proper protocol variant parameter
implicitly sets a good recommended value for this timer, use this
parameter only when you *really* want to override the default, otherwise
just comment out this value.
<param name="metering_pulse_timeout" value="1000"/>
-->
<!--
WARNING: advanced users only! I really mean it
this parameter is commented by default because
YOU DON'T NEED IT UNLESS YOU REALLY GROK MFC/R2
READ COMMENTS on doc/r2proto.conf in openr2 package
for more info
<param name="advanced_protocol_file" value="/usr/local/freeswitch/conf/r2proto.conf"/>
-->
<!-- USE THIS FOR DEBUGGING MFC-R2 PROTOCOL -->
<!--
Where to dump advanced call file protocol logs
<param name="logdir" value="$${base_dir}/log/mfcr2"/>
-->
<!--
MFC/R2 valid logging values are: all,error,warning,debug,notice,cas,mf,nothing
error,warning,debug and notice are self-descriptive
'cas' is for logging ABCD CAS tx and rx
'mf' is for logging of the Multi Frequency tones
You can mix up values, like: loglevel=error,debug,mf to log just error, debug and
multi frequency messages
'all' is a special value to log all the activity
'nothing' is a clean-up value, in case you want to not log any activity for
a channel or group of channels
BE AWARE that the level of output logged will ALSO depend on
the value you have in FreeSWITCH logging configurations, if you disable output FreeSWITCH
then it does not matter if you specify 'all' here, nothing will be logged
so FreeSWITCH has the last word on what is going to be logged
<param name="logging" value="debug,notice,warning,error,mf,cas"/>
-->
<!--
whether or not to drop protocol call files into 'logdir'
<param name="call_files" value="yes"/>
-->
<!--
Use only for very technical debugging
This is the size (if 0, dumps are disabled) of MF dump files. MF dump files
are audio files that are dumped when a protocol error occurs.
The files are dumped in whatever you set in the logdir parameter.
Value -1 uses a default recommended size (which stores 5 seconds of audio)
<param name="mf_dump_size" value="-1"/>
-->
</span>
</r2_spans>
</configuration>
</configuration>
libs/freetdm/configure.ac
浏览文件 @
004cc9d7
...
@@ -167,17 +167,6 @@ AC_ARG_WITH([pritap],
...
@@ -167,17 +167,6 @@ AC_ARG_WITH([pritap],
HAVE_PRITAP="${enable_pritap}"
HAVE_PRITAP="${enable_pritap}"
AM_CONDITIONAL([HAVE_PRITAP],[test "${enable_pritap}" = "yes"])
AM_CONDITIONAL([HAVE_PRITAP],[test "${enable_pritap}" = "yes"])
# debug dtmf?
AC_ARG_WITH([debugdtmf],
[AS_HELP_STRING([--with-debugdtmf], [Debug DTMF])],
[case "${withval}" in
no) enable_debugdtmf="no" ;;
*) enable_debugdtmf="yes" ;;
esac],
[enable_debugdtmf="no"]
)
AM_CONDITIONAL([WANT_DEBUGDTMF], [test "${enable_debugdtmf}" = "yes"])
##
##
# OpenR2 stack
# OpenR2 stack
#
#
...
...
libs/freetdm/mod_freetdm/mod_freetdm.c
浏览文件 @
004cc9d7
...
@@ -1417,6 +1417,24 @@ fail:
...
@@ -1417,6 +1417,24 @@ fail:
}
}
static
void
ftdm_enable_channel_dtmf
(
ftdm_channel_t
*
fchan
,
switch_channel_t
*
channel
)
{
if
(
channel
)
{
const
char
*
var
;
if
((
var
=
switch_channel_get_variable
(
channel
,
"freetdm_disable_dtmf"
)))
{
if
(
switch_true
(
var
))
{
ftdm_channel_command
(
fchan
,
FTDM_COMMAND_DISABLE_DTMF_DETECT
,
NULL
);
ftdm_log
(
FTDM_LOG_INFO
,
"DTMF detection disabled in channel %d:%d
\n
"
,
ftdm_channel_get_span_id
(
fchan
),
ftdm_channel_get_id
(
fchan
));
return
;
}
}
/* the variable is not present or has a negative value then proceed to enable DTMF ... */
}
if
(
ftdm_channel_command
(
fchan
,
FTDM_COMMAND_ENABLE_DTMF_DETECT
,
NULL
)
!=
FTDM_SUCCESS
)
{
ftdm_log
(
FTDM_LOG_ERROR
,
"Failed to enable DTMF detection in channel %d:%d
\n
"
,
ftdm_channel_get_span_id
(
fchan
),
ftdm_channel_get_id
(
fchan
));
}
}
ftdm_status_t
ftdm_channel_from_event
(
ftdm_sigmsg_t
*
sigmsg
,
switch_core_session_t
**
sp
)
ftdm_status_t
ftdm_channel_from_event
(
ftdm_sigmsg_t
*
sigmsg
,
switch_core_session_t
**
sp
)
{
{
switch_core_session_t
*
session
=
NULL
;
switch_core_session_t
*
session
=
NULL
;
...
@@ -1440,6 +1458,9 @@ ftdm_status_t ftdm_channel_from_event(ftdm_sigmsg_t *sigmsg, switch_core_session
...
@@ -1440,6 +1458,9 @@ ftdm_status_t ftdm_channel_from_event(ftdm_sigmsg_t *sigmsg, switch_core_session
return
FTDM_FAIL
;
return
FTDM_FAIL
;
}
}
/* I guess we always want DTMF detection */
ftdm_enable_channel_dtmf
(
sigmsg
->
channel
,
NULL
);
switch_core_session_add_stream
(
session
,
NULL
);
switch_core_session_add_stream
(
session
,
NULL
);
tech_pvt
=
(
private_t
*
)
switch_core_session_alloc
(
session
,
sizeof
(
private_t
));
tech_pvt
=
(
private_t
*
)
switch_core_session_alloc
(
session
,
sizeof
(
private_t
));
...
@@ -1633,24 +1654,6 @@ static FIO_SIGNAL_CB_FUNCTION(on_common_signal)
...
@@ -1633,24 +1654,6 @@ static FIO_SIGNAL_CB_FUNCTION(on_common_signal)
return
FTDM_BREAK
;
return
FTDM_BREAK
;
}
}
static
void
ftdm_enable_channel_dtmf
(
ftdm_channel_t
*
fchan
,
switch_channel_t
*
channel
)
{
if
(
channel
)
{
const
char
*
var
;
if
((
var
=
switch_channel_get_variable
(
channel
,
"freetdm_disable_dtmf"
)))
{
if
(
switch_true
(
var
))
{
ftdm_channel_command
(
fchan
,
FTDM_COMMAND_DISABLE_DTMF_DETECT
,
NULL
);
ftdm_log
(
FTDM_LOG_INFO
,
"DTMF detection disabled in channel %d:%d
\n
"
,
ftdm_channel_get_span_id
(
fchan
),
ftdm_channel_get_id
(
fchan
));
return
;
}
}
/* the variable is not present or has a negative value then proceed to enable DTMF ... */
}
if
(
ftdm_channel_command
(
fchan
,
FTDM_COMMAND_ENABLE_DTMF_DETECT
,
NULL
)
!=
FTDM_SUCCESS
)
{
ftdm_log
(
FTDM_LOG_ERROR
,
"Failed to enable DTMF detection in channel %d:%d
\n
"
,
ftdm_channel_get_span_id
(
fchan
),
ftdm_channel_get_id
(
fchan
));
}
}
static
FIO_SIGNAL_CB_FUNCTION
(
on_fxo_signal
)
static
FIO_SIGNAL_CB_FUNCTION
(
on_fxo_signal
)
{
{
switch_core_session_t
*
session
=
NULL
;
switch_core_session_t
*
session
=
NULL
;
...
@@ -2059,6 +2062,8 @@ static FIO_SIGNAL_CB_FUNCTION(on_r2_signal)
...
@@ -2059,6 +2062,8 @@ static FIO_SIGNAL_CB_FUNCTION(on_r2_signal)
}
}
break
;
break
;
case
FTDM_SIGEVENT_PROCEED
:{}
break
;
default:
default:
{
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Unhandled event %d from R2 for channel %d:%d
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Unhandled event %d from R2 for channel %d:%d
\n
"
,
...
@@ -2092,8 +2097,6 @@ static FIO_SIGNAL_CB_FUNCTION(on_clear_channel_signal)
...
@@ -2092,8 +2097,6 @@ static FIO_SIGNAL_CB_FUNCTION(on_clear_channel_signal)
{
{
ftdm_channel_add_var
(
sigmsg
->
channel
,
"screening_ind"
,
ftdm_screening2str
(
caller_data
->
screen
));
ftdm_channel_add_var
(
sigmsg
->
channel
,
"screening_ind"
,
ftdm_screening2str
(
caller_data
->
screen
));
ftdm_channel_add_var
(
sigmsg
->
channel
,
"presentation_ind"
,
ftdm_presentation2str
(
caller_data
->
pres
));
ftdm_channel_add_var
(
sigmsg
->
channel
,
"presentation_ind"
,
ftdm_presentation2str
(
caller_data
->
pres
));
ftdm_enable_channel_dtmf
(
sigmsg
->
channel
,
NULL
);
return
ftdm_channel_from_event
(
sigmsg
,
&
session
);
return
ftdm_channel_from_event
(
sigmsg
,
&
session
);
}
}
break
;
break
;
...
...
libs/freetdm/src/ftdm_io.c
浏览文件 @
004cc9d7
差异被折叠。
点击展开。
libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c
浏览文件 @
004cc9d7
差异被折叠。
点击展开。
libs/freetdm/src/include/freetdm.h
浏览文件 @
004cc9d7
...
@@ -351,6 +351,7 @@ typedef struct ftdm_channel_config {
...
@@ -351,6 +351,7 @@ typedef struct ftdm_channel_config {
ftdm_chan_type_t
type
;
ftdm_chan_type_t
type
;
float
rxgain
;
float
rxgain
;
float
txgain
;
float
txgain
;
uint8_t
debugdtmf
;
}
ftdm_channel_config_t
;
}
ftdm_channel_config_t
;
/*!
/*!
...
@@ -431,9 +432,38 @@ typedef enum {
...
@@ -431,9 +432,38 @@ typedef enum {
FTDM_COMMAND_WINK
,
FTDM_COMMAND_WINK
,
FTDM_COMMAND_ENABLE_PROGRESS_DETECT
,
FTDM_COMMAND_ENABLE_PROGRESS_DETECT
,
FTDM_COMMAND_DISABLE_PROGRESS_DETECT
,
FTDM_COMMAND_DISABLE_PROGRESS_DETECT
,
/*!< Start tracing input and output from channel to the given file */
FTDM_COMMAND_TRACE_INPUT
,
FTDM_COMMAND_TRACE_INPUT
,
FTDM_COMMAND_TRACE_OUTPUT
,
FTDM_COMMAND_TRACE_OUTPUT
,
/*!< Stop both Input and Output trace, closing the files */
FTDM_COMMAND_TRACE_END_ALL
,
FTDM_COMMAND_TRACE_END_ALL
,
/*!< Enable DTMF debugging */
FTDM_COMMAND_ENABLE_DEBUG_DTMF
,
/*!< Disable DTMF debugging (if not disabled explicitly, it is disabled automatically when calls hangup) */
FTDM_COMMAND_DISABLE_DEBUG_DTMF
,
/*!< Start dumping all input to a circular buffer. The size of the circular buffer can be specified, default used otherwise */
FTDM_COMMAND_ENABLE_INPUT_DUMP
,
/*!< Stop dumping all input to a circular buffer. */
FTDM_COMMAND_DISABLE_INPUT_DUMP
,
/*!< Start dumping all output to a circular buffer. The size of the circular buffer can be specified, default used otherwise */
FTDM_COMMAND_ENABLE_OUTPUT_DUMP
,
/*!< Stop dumping all output to a circular buffer. */
FTDM_COMMAND_DISABLE_OUTPUT_DUMP
,
/*!< Dump the current input circular buffer to the specified FILE* structure */
FTDM_COMMAND_DUMP_INPUT
,
/*!< Dump the current output circular buffer to the specified FILE* structure */
FTDM_COMMAND_DUMP_OUTPUT
,
FTDM_COMMAND_ENABLE_CALLERID_DETECT
,
FTDM_COMMAND_ENABLE_CALLERID_DETECT
,
FTDM_COMMAND_DISABLE_CALLERID_DETECT
,
FTDM_COMMAND_DISABLE_CALLERID_DETECT
,
FTDM_COMMAND_ENABLE_ECHOCANCEL
,
FTDM_COMMAND_ENABLE_ECHOCANCEL
,
...
...
libs/freetdm/src/include/private/ftdm_core.h
浏览文件 @
004cc9d7
...
@@ -342,21 +342,24 @@ typedef enum {
...
@@ -342,21 +342,24 @@ typedef enum {
FTDM_TYPE_CHANNEL
FTDM_TYPE_CHANNEL
}
ftdm_data_type_t
;
}
ftdm_data_type_t
;
#ifdef FTDM_DEBUG_DTMF
/* number of bytes for the IO dump circular buffer (5 seconds worth of audio by default) */
/* number of bytes for the circular buffer (5 seconds worth of audio) */
#define FTDM_IO_DUMP_DEFAULT_BUFF_SIZE 8 * 5000
#define DTMF_DEBUG_SIZE 8 * 5000
/* number of 20ms cycles before timeout and close the debug dtmf file (5 seconds) */
#define DTMF_DEBUG_TIMEOUT 250
typedef
struct
{
typedef
struct
{
FILE
*
file
;
char
*
buffer
;
char
buffer
[
DTMF_DEBUG_SIZE
]
;
ftdm_size_t
size
;
int
windex
;
int
windex
;
int
wrapped
;
int
wrapped
;
int
closetimeout
;
}
ftdm_io_dump_t
;
/* number of interval cycles before timeout and close the debug dtmf file (5 seconds if interval is 20) */
#define DTMF_DEBUG_TIMEOUT 250
typedef
struct
{
uint8_t
enabled
;
uint8_t
requested
;
FILE
*
file
;
int32_t
closetimeout
;
ftdm_mutex_t
*
mutex
;
ftdm_mutex_t
*
mutex
;
}
ftdm_dtmf_debug_t
;
}
ftdm_dtmf_debug_t
;
#endif
typedef
struct
{
typedef
struct
{
const
char
*
file
;
const
char
*
file
;
...
@@ -471,9 +474,9 @@ struct ftdm_channel {
...
@@ -471,9 +474,9 @@ struct ftdm_channel {
void
*
user_private
;
void
*
user_private
;
ftdm_timer_id_t
hangup_timer
;
ftdm_timer_id_t
hangup_timer
;
ftdm_channel_iostats_t
iostats
;
ftdm_channel_iostats_t
iostats
;
#ifdef FTDM_DEBUG_DTMF
ftdm_dtmf_debug_t
dtmfdbg
;
ftdm_dtmf_debug_t
dtmfdbg
;
#endif
ftdm_io_dump_t
rxdump
;
ftdm_io_dump_t
txdump
;
};
};
struct
ftdm_span
{
struct
ftdm_span
{
...
...
libs/freetdm/src/include/private/ftdm_types.h
浏览文件 @
004cc9d7
...
@@ -58,6 +58,7 @@ typedef int ftdm_filehandle_t;
...
@@ -58,6 +58,7 @@ typedef int ftdm_filehandle_t;
extern
"C"
{
extern
"C"
{
#endif
#endif
#define FTDM_COMMAND_OBJ_SIZE *((ftdm_size_t *)obj)
#define FTDM_COMMAND_OBJ_INT *((int *)obj)
#define FTDM_COMMAND_OBJ_INT *((int *)obj)
#define FTDM_COMMAND_OBJ_CHAR_P (char *)obj
#define FTDM_COMMAND_OBJ_CHAR_P (char *)obj
#define FTDM_COMMAND_OBJ_FLOAT *(float *)obj
#define FTDM_COMMAND_OBJ_FLOAT *(float *)obj
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论