Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
38c3a67a
提交
38c3a67a
authored
4月 04, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-3229 --resolve
上级
6a70fa4c
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
29 行增加
和
19 行删除
+29
-19
switch_types.h
src/include/switch_types.h
+1
-0
mod_dptools.c
src/mod/applications/mod_dptools/mod_dptools.c
+11
-4
switch_ivr_async.c
src/switch_ivr_async.c
+17
-15
没有找到文件。
src/include/switch_types.h
浏览文件 @
38c3a67a
...
@@ -136,6 +136,7 @@ SWITCH_BEGIN_EXTERN_C
...
@@ -136,6 +136,7 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE "execute_on_media"
#define SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE "execute_on_media"
#define SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE "api_on_answer"
#define SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE "api_on_answer"
#define SWITCH_CHANNEL_EXECUTE_ON_RING_VARIABLE "execute_on_ring"
#define SWITCH_CHANNEL_EXECUTE_ON_RING_VARIABLE "execute_on_ring"
#define SWITCH_CHANNEL_EXECUTE_ON_TONE_DETECT_VARIABLE "execute_on_tone_detect"
#define SWITCH_CALL_TIMEOUT_VARIABLE "call_timeout"
#define SWITCH_CALL_TIMEOUT_VARIABLE "call_timeout"
#define SWITCH_HOLDING_UUID_VARIABLE "holding_uuid"
#define SWITCH_HOLDING_UUID_VARIABLE "holding_uuid"
#define SWITCH_SOFT_HOLDING_UUID_VARIABLE "soft_holding_uuid"
#define SWITCH_SOFT_HOLDING_UUID_VARIABLE "soft_holding_uuid"
...
...
src/mod/applications/mod_dptools/mod_dptools.c
浏览文件 @
38c3a67a
...
@@ -1552,7 +1552,8 @@ SWITCH_STANDARD_APP(tone_detect_session_function)
...
@@ -1552,7 +1552,8 @@ SWITCH_STANDARD_APP(tone_detect_session_function)
int
argc
;
int
argc
;
char
*
mydata
=
NULL
;
char
*
mydata
=
NULL
;
time_t
to
=
0
;
time_t
to
=
0
;
int
hits
=
1
;
int
hits
=
0
;
const
char
*
hp
=
NULL
;
if
(
zstr
(
data
)
||
!
(
mydata
=
switch_core_session_strdup
(
session
,
data
)))
{
if
(
zstr
(
data
)
||
!
(
mydata
=
switch_core_session_strdup
(
session
,
data
)))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"INVALID ARGS!
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"INVALID ARGS!
\n
"
);
...
@@ -1582,10 +1583,16 @@ SWITCH_STANDARD_APP(tone_detect_session_function)
...
@@ -1582,10 +1583,16 @@ SWITCH_STANDARD_APP(tone_detect_session_function)
}
}
}
}
if
(
argv
[
6
])
{
if
(
argv
[
4
]
&&
argv
[
5
])
{
hits
=
atoi
(
argv
[
6
]);
hp
=
argv
[
6
];
}
else
if
(
argv
[
4
]
&&
!
argv
[
6
])
{
hp
=
argv
[
4
];
}
if
(
hp
)
{
hits
=
atoi
(
hp
);
if
(
hits
<
0
)
{
if
(
hits
<
0
)
{
hits
=
1
;
hits
=
0
;
}
}
}
}
...
...
src/switch_ivr_async.c
浏览文件 @
38c3a67a
...
@@ -2392,7 +2392,6 @@ static switch_status_t tone_on_dtmf(switch_core_session_t *session, const switch
...
@@ -2392,7 +2392,6 @@ static switch_status_t tone_on_dtmf(switch_core_session_t *session, const switch
{
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_tone_container_t
*
cont
=
switch_channel_get_private
(
channel
,
"_tone_detect_"
);
switch_tone_container_t
*
cont
=
switch_channel_get_private
(
channel
,
"_tone_detect_"
);
switch_event_t
*
event
;
int
i
;
int
i
;
if
(
!
cont
||
!
cont
->
detect_fax
||
dtmf
->
digit
!=
'f'
)
{
if
(
!
cont
||
!
cont
->
detect_fax
||
dtmf
->
digit
!=
'f'
)
{
...
@@ -2403,13 +2402,10 @@ static switch_status_t tone_on_dtmf(switch_core_session_t *session, const switch
...
@@ -2403,13 +2402,10 @@ static switch_status_t tone_on_dtmf(switch_core_session_t *session, const switch
if
(
cont
->
list
[
i
].
callback
)
{
if
(
cont
->
list
[
i
].
callback
)
{
cont
->
list
[
i
].
callback
(
cont
->
session
,
cont
->
list
[
i
].
app
,
cont
->
list
[
i
].
data
);
cont
->
list
[
i
].
callback
(
cont
->
session
,
cont
->
list
[
i
].
app
,
cont
->
list
[
i
].
data
);
}
else
if
(
cont
->
list
[
i
].
app
)
{
}
else
{
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_COMMAND
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_channel_execute_on
(
switch_core_session_get_channel
(
cont
->
session
),
SWITCH_CHANNEL_EXECUTE_ON_TONE_DETECT_VARIABLE
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"call-command"
,
"execute"
);
if
(
cont
->
list
[
i
].
app
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"execute-app-name"
,
cont
->
list
[
i
].
app
);
switch_core_session_execute_application_async
(
cont
->
session
,
cont
->
list
[
i
].
app
,
cont
->
list
[
i
].
data
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"execute-app-arg"
,
cont
->
list
[
i
].
data
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"lead-frames"
,
"%d"
,
5
);
switch_core_session_queue_private_event
(
cont
->
session
,
&
event
,
SWITCH_FALSE
);
}
}
}
}
...
@@ -2491,13 +2487,10 @@ static switch_bool_t tone_detect_callback(switch_media_bug_t *bug, void *user_da
...
@@ -2491,13 +2487,10 @@ static switch_bool_t tone_detect_callback(switch_media_bug_t *bug, void *user_da
cont
->
list
[
i
].
sleep
=
0
;
cont
->
list
[
i
].
sleep
=
0
;
cont
->
list
[
i
].
expires
=
0
;
cont
->
list
[
i
].
expires
=
0
;
}
}
}
else
if
(
cont
->
list
[
i
].
app
)
{
}
else
{
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_COMMAND
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_channel_execute_on
(
switch_core_session_get_channel
(
cont
->
session
),
SWITCH_CHANNEL_EXECUTE_ON_TONE_DETECT_VARIABLE
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"call-command"
,
"execute"
);
if
(
cont
->
list
[
i
].
app
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"execute-app-name"
,
cont
->
list
[
i
].
app
);
switch_core_session_execute_application_async
(
cont
->
session
,
cont
->
list
[
i
].
app
,
cont
->
list
[
i
].
data
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"execute-app-arg"
,
cont
->
list
[
i
].
data
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"lead-frames"
,
"%d"
,
5
);
switch_core_session_queue_private_event
(
cont
->
session
,
&
event
,
SWITCH_FALSE
);
}
}
}
}
...
@@ -2605,6 +2598,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_tone_detect_session(switch_core_sessi
...
@@ -2605,6 +2598,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_tone_detect_session(switch_core_sessi
return
SWITCH_STATUS_MEMERR
;
return
SWITCH_STATUS_MEMERR
;
}
}
if
((
var
=
switch_channel_get_variable
(
channel
,
"tone_detect_hits"
)))
{
int
tmp
=
atoi
(
var
);
if
(
tmp
>
0
)
{
hits
=
tmp
;
}
}
if
(
!
hits
)
hits
=
1
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Adding tone spec %s index %d hits %d
\n
"
,
tone_spec
,
cont
->
index
,
hits
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Adding tone spec %s index %d hits %d
\n
"
,
tone_spec
,
cont
->
index
,
hits
);
i
=
0
;
i
=
0
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论