Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b426ec0b
提交
b426ec0b
authored
8月 25, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-2217 --resolve this looks ok and is probably useful
上级
e644e620
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
38 行增加
和
13 行删除
+38
-13
switch_types.h
src/include/switch_types.h
+20
-0
mod_spandsp_dsp.c
src/mod/applications/mod_spandsp/mod_spandsp_dsp.c
+1
-0
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+1
-1
switch_channel.c
src/switch_channel.c
+1
-1
switch_ivr_async.c
src/switch_ivr_async.c
+13
-9
switch_rtp.c
src/switch_rtp.c
+2
-2
没有找到文件。
src/include/switch_types.h
浏览文件 @
b426ec0b
...
...
@@ -202,6 +202,25 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_DTMF_LOG_LEN 1000
typedef
uint8_t
switch_byte_t
;
/*!
\enum switch_dtmf_source_t
\brief DTMF sources
<pre>
SWITCH_DTMF_UNKNOWN - Unknown source
SWITCH_DTMF_INBAND_AUDIO - From audio
SWITCH_DTMF_RTP - From RTP as a telephone event
SWITCH_DTMF_ENDPOINT - From endpoint signaling
SWITCH_DTMF_APP - From application
</pre>
*/
typedef
enum
{
SWITCH_DTMF_UNKNOWN
,
SWITCH_DTMF_INBAND_AUDIO
,
SWITCH_DTMF_RTP
,
SWITCH_DTMF_ENDPOINT
,
SWITCH_DTMF_APP
}
switch_dtmf_source_t
;
typedef
enum
{
DTMF_FLAG_SKIP_PROCESS
=
(
1
<<
0
)
}
dtmf_flag_t
;
...
...
@@ -210,6 +229,7 @@ typedef struct {
char
digit
;
uint32_t
duration
;
int32_t
flags
;
switch_dtmf_source_t
source
;
}
switch_dtmf_t
;
typedef
enum
{
...
...
src/mod/applications/mod_spandsp/mod_spandsp_dsp.c
浏览文件 @
b426ec0b
...
...
@@ -57,6 +57,7 @@ static void spandsp_dtmf_rx_realtime_callback(void *user_data, int code, int lev
pvt
->
last_digit
=
digit
;
dtmf
.
digit
=
digit
;
dtmf
.
duration
=
switch_core_default_dtmf_duration
(
0
);
dtmf
.
source
=
SWITCH_DTMF_INBAND_AUDIO
;
switch_channel_queue_dtmf
(
switch_core_session_get_channel
(
pvt
->
session
),
&
dtmf
);
pvt
->
digit_begin
=
pvt
->
samples
;
}
else
{
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
b426ec0b
...
...
@@ -6625,7 +6625,7 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
const
char
*
signal_ptr
;
const
char
*
rec_header
;
const
char
*
clientcode_header
;
switch_dtmf_t
dtmf
=
{
0
,
switch_core_default_dtmf_duration
(
0
)
};
switch_dtmf_t
dtmf
=
{
0
,
switch_core_default_dtmf_duration
(
0
)
,
0
,
SWITCH_DTMF_ENDPOINT
};
switch_event_t
*
event
;
private_object_t
*
tech_pvt
=
NULL
;
...
...
src/switch_channel.c
浏览文件 @
b426ec0b
...
...
@@ -419,7 +419,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf(switch_channel_t *chan
SWITCH_DECLARE
(
switch_status_t
)
switch_channel_queue_dtmf_string
(
switch_channel_t
*
channel
,
const
char
*
dtmf_string
)
{
char
*
p
;
switch_dtmf_t
dtmf
=
{
0
,
switch_core_default_dtmf_duration
(
0
),
0
};
switch_dtmf_t
dtmf
=
{
0
,
switch_core_default_dtmf_duration
(
0
),
0
,
SWITCH_DTMF_APP
};
int
sent
=
0
,
dur
;
char
*
string
;
int
i
,
argc
;
...
...
src/switch_ivr_async.c
浏览文件 @
b426ec0b
...
...
@@ -2137,6 +2137,7 @@ static switch_bool_t inband_dtmf_callback(switch_media_bug_t *bug, void *user_da
switch_dtmf_t
dtmf
;
dtmf
.
digit
=
*
p
;
dtmf
.
duration
=
switch_core_default_dtmf_duration
(
0
);
dtmf
.
source
=
SWITCH_DTMF_INBAND_AUDIO
;
switch_channel_queue_dtmf
(
channel
,
&
dtmf
);
p
++
;
}
...
...
@@ -2327,18 +2328,20 @@ static switch_bool_t inband_dtmf_generate_callback(switch_media_bug_t *bug, void
if
(
!
switch_buffer_inuse
(
pvt
->
audio_buffer
))
{
if
(
switch_queue_trypop
(
pvt
->
digit_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_dtmf_t
*
dtmf
=
(
switch_dtmf_t
*
)
pop
;
char
buf
[
2
]
=
""
;
int
duration
=
dtmf
->
duration
;
buf
[
0
]
=
dtmf
->
digit
;
if
(
duration
>
8000
)
{
duration
=
4000
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
switch_core_media_bug_get_session
(
bug
)),
if
(
dtmf
->
source
!=
SWITCH_DTMF_INBAND_AUDIO
)
{
char
buf
[
2
]
=
""
;
int
duration
=
dtmf
->
duration
;
buf
[
0
]
=
dtmf
->
digit
;
if
(
duration
>
8000
)
{
duration
=
4000
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
switch_core_media_bug_get_session
(
bug
)),
SWITCH_LOG_WARNING
,
"%s Truncating ridiculous DTMF duration %d ms to 1/2 second.
\n
"
,
switch_channel_get_name
(
switch_core_session_get_channel
(
pvt
->
session
)),
dtmf
->
duration
/
8
);
}
pvt
->
ts
.
duration
=
duration
;
teletone_run
(
&
pvt
->
ts
,
buf
);
}
pvt
->
ts
.
duration
=
duration
;
teletone_run
(
&
pvt
->
ts
,
buf
);
free
(
pop
);
}
}
...
...
@@ -3168,6 +3171,7 @@ static void *SWITCH_THREAD_FUNC speech_thread(switch_thread_t *thread, void *obj
switch_dtmf_t
dtmf
;
dtmf
.
digit
=
c
;
dtmf
.
duration
=
switch_core_default_dtmf_duration
(
0
);
dtmf
.
source
=
SWITCH_DTMF_INBAND_AUDIO
;
switch_log_printf
(
SWITCH_CHANNEL_CHANNEL_LOG
(
channel
),
SWITCH_LOG_DEBUG
,
"Queue speech detected dtmf %c
\n
"
,
c
);
switch_channel_queue_dtmf
(
channel
,
&
dtmf
);
}
...
...
src/switch_rtp.c
浏览文件 @
b426ec0b
...
...
@@ -344,7 +344,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
if
(
!
rtp_session
->
dtmf_data
.
in_digit_queued
&&
(
rtp_session
->
rtp_bugs
&
RTP_BUG_IGNORE_DTMF_DURATION
)
&&
rtp_session
->
dtmf_data
.
in_digit_ts
)
{
switch_dtmf_t
dtmf
=
{
key
,
switch_core_min_dtmf_duration
(
0
)
};
switch_dtmf_t
dtmf
=
{
key
,
switch_core_min_dtmf_duration
(
0
)
,
0
,
SWITCH_DTMF_RTP
};
#ifdef DEBUG_2833
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Early Queuing digit %c:%d
\n
"
,
dtmf
.
digit
,
dtmf
.
duration
/
8
);
#endif
...
...
@@ -373,7 +373,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
rtp_session
->
dtmf_data
.
in_digit_sanity
=
2000
;
}
if
(
rtp_session
->
dtmf_data
.
in_digit_ts
)
{
switch_dtmf_t
dtmf
=
{
key
,
duration
};
switch_dtmf_t
dtmf
=
{
key
,
duration
,
0
,
SWITCH_DTMF_RTP
};
if
(
ts
>
rtp_session
->
dtmf_data
.
in_digit_ts
)
{
dtmf
.
duration
+=
(
ts
-
rtp_session
->
dtmf_data
.
in_digit_ts
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论