Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
7a8c8479
提交
7a8c8479
authored
5月 14, 2007
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@5177
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
bcd32125
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
49 行增加
和
14 行删除
+49
-14
switch_types.h
src/include/switch_types.h
+2
-2
switch_ivr.c
src/switch_ivr.c
+29
-7
switch_ivr_async.c
src/switch_ivr_async.c
+18
-5
没有找到文件。
src/include/switch_types.h
浏览文件 @
7a8c8479
...
...
@@ -538,7 +538,7 @@ CF_EARLY_MEDIA = (1 << 2) - Channel is ready for audio before answer
CF_ORIGINATOR = (1 << 3) - Channel is an originator
CF_TRANSFER = (1 << 4) - Channel is being transfered
CF_ACCEPT_CNG = (1 << 5) - Channel will accept CNG frames
CF_
LOCK_THREAD = (1 << 6) - Prevent the channel thread from exiting while this flag is se
t
CF_
WAIT_FOR_ME = (1 << 6) - Channel wants you to wai
t
CF_BRIDGED = (1 << 7) - Channel in a bridge
CF_HOLD = (1 << 8) - Channel is on hold
CF_SERVICE = (1 << 9) - Channel has a service thread
...
...
@@ -565,7 +565,7 @@ typedef enum {
CF_ORIGINATOR
=
(
1
<<
3
),
CF_TRANSFER
=
(
1
<<
4
),
CF_ACCEPT_CNG
=
(
1
<<
5
),
CF_
LOCK_THREAD
=
(
1
<<
6
),
CF_
WAIT_FOR_ME
=
(
1
<<
6
),
CF_BRIDGED
=
(
1
<<
7
),
CF_HOLD
=
(
1
<<
8
),
CF_SERVICE
=
(
1
<<
9
),
...
...
src/switch_ivr.c
浏览文件 @
7a8c8479
...
...
@@ -272,13 +272,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
unsigned
long
CMD_NOMEDIA
=
switch_hashfunc_default
(
"nomedia"
,
&
hlen
);
unsigned
long
CMD_UNICAST
=
switch_hashfunc_default
(
"unicast"
,
&
hlen
);
char
*
lead_frames
=
switch_event_get_header
(
event
,
"lead-frames"
);
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
assert
(
channel
!=
NULL
);
assert
(
event
!=
NULL
);
if
(
switch_strlen_zero
(
cmd
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Invalid Command!
\n
"
);
return
SWITCH_STATUS_FALSE
;
status
=
SWITCH_STATUS_FALSE
;
goto
done
;
}
hlen
=
(
switch_size_t
)
strlen
(
cmd
);
...
...
@@ -289,12 +291,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
if
(
lead_frames
)
{
switch_frame_t
*
read_frame
;
int
frame_count
=
atoi
(
lead_frames
);
switch_status_t
status
;
while
(
frame_count
>
0
)
{
status
=
switch_core_session_read_frame
(
session
,
&
read_frame
,
-
1
,
0
);
if
(
!
SWITCH_READ_ACCEPTABLE
(
status
))
{
return
status
;
goto
done
;
}
if
(
!
switch_test_flag
(
read_frame
,
SFF_CNG
))
{
frame_count
--
;
...
...
@@ -365,12 +366,33 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
switch_channel_hangup
(
channel
,
cause
);
}
else
if
(
cmd_hash
==
CMD_NOMEDIA
)
{
char
*
uuid
=
switch_event_get_header
(
event
,
"nomedia-uuid"
);
char
*
waitfor
=
switch_event_get_header
(
event
,
"wait-for"
);
if
(
waitfor
)
{
switch_core_session_t
*
w_session
;
if
((
w_session
=
switch_core_session_locate
(
waitfor
)))
{
switch_channel_t
*
w_channel
=
switch_core_session_get_channel
(
w_session
);
int
sanity
=
0
;
while
(
switch_channel_test_flag
(
w_channel
,
CF_WAIT_FOR_ME
))
{
switch_yield
(
1000
);
if
(
++
sanity
>
10000
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"Timeout waiting for channel %s
\n
"
,
switch_channel_get_name
(
w_channel
));
switch_channel_clear_flag
(
w_channel
,
CF_WAIT_FOR_ME
);
break
;
}
}
switch_core_session_rwunlock
(
w_session
);
}
}
switch_ivr_nomedia
(
uuid
,
SMF_REBRIDGE
);
}
done
:
switch_channel_clear_flag
(
channel
,
CF_EVENT_PARSE
);
return
SWITCH_STATUS_SUCCESS
;
switch_channel_clear_flag
(
channel
,
CF_WAIT_FOR_ME
);
return
status
;
}
...
...
src/switch_ivr_async.c
浏览文件 @
7a8c8479
...
...
@@ -775,10 +775,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(char *uuid, char *path, swi
char
*
p
;
master
=
session
;
channel
=
switch_core_session_get_channel
(
session
);
assert
(
channel
!=
NULL
);
if
((
nomedia
=
switch_channel_test_flag
(
channel
,
CF_BYPASS_MEDIA
)))
{
switch_ivr_media
(
uuid
,
SMF_REBRIDGE
);
}
...
...
@@ -796,8 +796,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(char *uuid, char *path, swi
}
}
if
((
flags
&
SMF_ECHO_BLEG
)
&&
(
other_uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_
BRIDGE
_VARIABLE
))
if
((
flags
&
SMF_ECHO_BLEG
)
&&
(
other_uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_
SIGNAL_BOND
_VARIABLE
))
&&
(
other_session
=
switch_core_session_locate
(
other_uuid
)))
{
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_MESSAGE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"call-command"
,
"execute"
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"execute-app-name"
,
"%s"
,
app
);
...
...
@@ -806,12 +807,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(char *uuid, char *path, swi
if
((
flags
&
SMF_LOOP
))
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"loops"
,
"%d"
,
-
1
);
}
switch_core_session_queue_private_event
(
other_session
,
&
event
);
}
switch_core_session_rwunlock
(
other_session
);
master
=
other_session
;
switch_core_session_rwunlock
(
other_session
);
other_session
=
NULL
;
}
...
...
@@ -833,6 +835,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(char *uuid, char *path, swi
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_MESSAGE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"call-command"
,
"nomedia"
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"nomedia-uuid"
,
"%s"
,
uuid
);
if
((
flags
&
SMF_ECHO_BLEG
)
&&
(
flags
&
SMF_ECHO_ALEG
))
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
master
);
char
*
bto
=
switch_channel_get_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
);
if
((
other_session
=
switch_core_session_locate
(
bto
)))
{
switch_channel_t
*
other_channel
=
switch_core_session_get_channel
(
other_session
);
switch_channel_set_flag
(
other_channel
,
CF_WAIT_FOR_ME
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"wait-for"
,
"%s"
,
bto
);
switch_core_session_rwunlock
(
other_session
);
}
}
switch_core_session_queue_private_event
(
master
,
&
event
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论