Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
7d2756f1
提交
7d2756f1
authored
4月 26, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@1266
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
380bc2b6
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
21 行增加
和
27 行删除
+21
-27
switch_channel.h
src/include/switch_channel.h
+2
-2
switch_channel.c
src/switch_channel.c
+11
-12
switch_core.c
src/switch_core.c
+6
-6
switch_ivr.c
src/switch_ivr.c
+2
-7
没有找到文件。
src/include/switch_channel.h
浏览文件 @
7d2756f1
...
...
@@ -85,7 +85,7 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_set_state(switch_channel *ch
\param str the string to check
\return the code
*/
SWITCH_DECLARE
(
switch_call_cause_t
)
switch_channel_
cause2str
(
char
*
str
);
SWITCH_DECLARE
(
switch_call_cause_t
)
switch_channel_
str2cause
(
char
*
str
);
/*!
\brief return the cause code for a given channel
...
...
@@ -99,7 +99,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause(switch_channel *cha
\param cause the code to check
\return the string
*/
SWITCH_DECLARE
(
char
*
)
switch_channel_
str2cause
(
switch_call_cause_t
cause
);
SWITCH_DECLARE
(
char
*
)
switch_channel_
cause2str
(
switch_call_cause_t
cause
);
/*!
\brief View the timetable of a channel
...
...
src/switch_channel.c
浏览文件 @
7d2756f1
...
...
@@ -109,7 +109,7 @@ struct switch_channel {
};
SWITCH_DECLARE
(
char
*
)
switch_channel_
str2cause
(
switch_call_cause_t
cause
)
SWITCH_DECLARE
(
char
*
)
switch_channel_
cause2str
(
switch_call_cause_t
cause
)
{
uint8_t
x
;
char
*
str
=
"UNALLOCATED"
;
...
...
@@ -123,7 +123,7 @@ SWITCH_DECLARE(char *) switch_channel_str2cause(switch_call_cause_t cause)
return
str
;
}
SWITCH_DECLARE
(
switch_call_cause_t
)
switch_channel_
cause2str
(
char
*
str
)
SWITCH_DECLARE
(
switch_call_cause_t
)
switch_channel_
str2cause
(
char
*
str
)
{
uint8_t
x
;
switch_call_cause_t
cause
=
SWITCH_CAUSE_UNALLOCATED
;
...
...
@@ -412,7 +412,6 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_set_state(switch_channel *ch
case
CS_TRANSMIT
:
case
CS_RING
:
case
CS_EXECUTE
:
case
CS_HANGUP
:
ok
++
;
default
:
break
;
...
...
@@ -424,7 +423,6 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_set_state(switch_channel *ch
case
CS_TRANSMIT
:
case
CS_RING
:
case
CS_EXECUTE
:
case
CS_HANGUP
:
ok
++
;
default
:
break
;
...
...
@@ -436,7 +434,6 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_set_state(switch_channel *ch
case
CS_LOOPBACK
:
case
CS_RING
:
case
CS_EXECUTE
:
case
CS_HANGUP
:
ok
++
;
default
:
break
;
...
...
@@ -447,7 +444,6 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_set_state(switch_channel *ch
switch
(
state
)
{
case
CS_LOOPBACK
:
case
CS_EXECUTE
:
case
CS_HANGUP
:
case
CS_TRANSMIT
:
ok
++
;
default
:
...
...
@@ -460,7 +456,6 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_set_state(switch_channel *ch
case
CS_LOOPBACK
:
case
CS_TRANSMIT
:
case
CS_RING
:
case
CS_HANGUP
:
ok
++
;
default
:
break
;
...
...
@@ -483,7 +478,6 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_set_state(switch_channel *ch
if
(
ok
)
{
switch_event
*
event
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s State Change %s -> %s
\n
"
,
channel
->
name
,
state_names
[
last_state
],
state_names
[
state
]);
...
...
@@ -492,10 +486,12 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_set_state(switch_channel *ch
if
(
state
==
CS_HANGUP
&&
channel
->
hangup_cause
==
SWITCH_CAUSE_UNALLOCATED
)
{
channel
->
hangup_cause
=
SWITCH_CAUSE_NORMAL_CLEARING
;
}
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_STATE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_channel_event_set_data
(
channel
,
event
);
switch_event_fire
(
&
event
);
if
(
state
<
CS_HANGUP
)
{
switch_event
*
event
;
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_STATE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_channel_event_set_data
(
channel
,
event
);
switch_event_fire
(
&
event
);
}
}
if
(
state
<
CS_DONE
)
{
...
...
@@ -700,9 +696,12 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_hangup(switch_channel *chann
if
(
channel
->
state
<
CS_HANGUP
)
{
switch_event
*
event
;
switch_channel_state
last_state
=
channel
->
state
;
channel
->
state
=
CS_HANGUP
;
channel
->
hangup_cause
=
hangup_cause
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Hangup %s [%s] [%s]
\n
"
,
channel
->
name
,
state_names
[
last_state
],
switch_channel_cause2str
(
channel
->
hangup_cause
));
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_STATE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_channel_event_set_data
(
channel
,
event
);
switch_event_fire
(
&
event
);
...
...
src/switch_core.c
浏览文件 @
7d2756f1
...
...
@@ -1704,7 +1704,7 @@ static void switch_core_standard_on_ring(switch_core_session *session)
if
((
caller_profile
=
switch_channel_get_caller_profile
(
session
->
channel
))
==
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Can't get profile!
\n
"
);
switch_channel_
set_state
(
session
->
channel
,
CS_HANGUP
);
switch_channel_
hangup
(
session
->
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
}
else
{
if
(
!
switch_strlen_zero
(
caller_profile
->
dialplan
))
{
dialplan_interface
=
switch_loadable_module_get_dialplan_interface
(
caller_profile
->
dialplan
);
...
...
@@ -1734,7 +1734,7 @@ static void switch_core_standard_on_execute(switch_core_session *session)
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Standard EXECUTE
\n
"
);
if
((
extension
=
switch_channel_get_caller_extension
(
session
->
channel
))
==
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"No Extension!
\n
"
);
switch_channel_
set_state
(
session
->
channel
,
CS_HANGUP
);
switch_channel_
hangup
(
session
->
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
return
;
}
...
...
@@ -1747,14 +1747,14 @@ static void switch_core_standard_on_execute(switch_core_session *session)
switch_loadable_module_get_application_interface
(
extension
->
current_application
->
application_name
))
==
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Invalid Application %s
\n
"
,
extension
->
current_application
->
application_name
);
switch_channel_
set_state
(
session
->
channel
,
CS_HANGUP
);
switch_channel_
hangup
(
session
->
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
return
;
}
if
(
!
application_interface
->
application_function
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"No Function for %s
\n
"
,
extension
->
current_application
->
application_name
);
switch_channel_
set_state
(
session
->
channel
,
CS_HANGUP
);
switch_channel_
hangup
(
session
->
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
return
;
}
...
...
@@ -1767,9 +1767,9 @@ static void switch_core_standard_on_execute(switch_core_session *session)
application_interface
->
application_function
(
session
,
extension
->
current_application
->
application_data
);
extension
->
current_application
=
extension
->
current_application
->
next
;
}
if
(
switch_channel_get_state
(
session
->
channel
)
==
CS_EXECUTE
)
{
switch_channel_
set_state
(
session
->
channel
,
CS_HANGUP
);
switch_channel_
hangup
(
session
->
channel
,
SWITCH_CAUSE_NORMAL_CLEARING
);
}
}
...
...
src/switch_ivr.c
浏览文件 @
7d2756f1
...
...
@@ -780,6 +780,7 @@ static void *audio_bridge_thread(switch_thread *thread, void *obj)
switch_core_session_receive_message
(
session_a
,
&
msg
);
data
->
running
=
0
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"BRIDGE THREAD DONE [%s]
\n
"
,
switch_channel_get_name
(
chan_a
));
if
(
switch_channel_test_flag
(
chan_a
,
CF_ORIGINATOR
))
{
if
(
switch_channel_test_flag
(
chan_b
,
CF_TRANSFER
))
{
...
...
@@ -793,16 +794,10 @@ static void *audio_bridge_thread(switch_thread *thread, void *obj)
switch_channel_hangup
(
chan_b
,
SWITCH_CAUSE_NORMAL_CLEARING
);
}
switch_channel_clear_flag
(
chan_a
,
CF_ORIGINATOR
);
}
while
(
his_thread
->
running
>
0
)
{
his_thread
->
running
=
-
1
;
/* wait for the other audio thread */
while
(
his_thread
->
running
==
-
1
)
{
switch_yield
(
1000
);
}
}
data
->
running
=
0
;
return
NULL
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论