Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
580f545e
提交
580f545e
authored
5月 01, 2008
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tewaks
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@8232
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
f59b8ed1
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
39 行增加
和
20 行删除
+39
-20
switch_ivr.h
src/include/switch_ivr.h
+2
-2
mod_commands.c
src/mod/applications/mod_commands/mod_commands.c
+1
-1
mod_dptools.c
src/mod/applications/mod_dptools/mod_dptools.c
+1
-1
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+16
-3
switch_core_io.c
src/switch_core_io.c
+4
-1
switch_core_rwlock.c
src/switch_core_rwlock.c
+4
-5
switch_ivr.c
src/switch_ivr.c
+5
-5
switch_ivr_bridge.c
src/switch_ivr_bridge.c
+6
-2
没有找到文件。
src/include/switch_ivr.h
浏览文件 @
580f545e
...
...
@@ -466,7 +466,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(const char *uuid, switch_medi
\param message optional message
\return SWITCH_STATUS_SUCCESS if all is well
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_hold_uuid
(
const
char
*
uuid
,
const
char
*
message
);
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_hold_uuid
(
const
char
*
uuid
,
const
char
*
message
,
switch_bool_t
moh
);
/*!
\brief Signal the session with a protocol specific unhold message.
...
...
@@ -481,7 +481,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_unhold_uuid(const char *uuid);
\param message optional message
\return SWITCH_STATUS_SUCCESS if all is well
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_hold
(
switch_core_session_t
*
session
,
const
char
*
message
);
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_hold
(
switch_core_session_t
*
session
,
const
char
*
message
,
switch_bool_t
moh
);
/*!
\brief Signal the session with a protocol specific unhold message.
...
...
src/mod/applications/mod_commands/mod_commands.c
浏览文件 @
580f545e
...
...
@@ -1171,7 +1171,7 @@ SWITCH_STANDARD_API(uuid_hold_function)
if
(
!
strcasecmp
(
argv
[
0
],
"off"
))
{
status
=
switch_ivr_unhold_uuid
(
argv
[
1
]);
}
else
{
status
=
switch_ivr_hold_uuid
(
argv
[
0
],
argv
[
1
]);
status
=
switch_ivr_hold_uuid
(
argv
[
0
],
argv
[
1
]
,
1
);
}
}
...
...
src/mod/applications/mod_dptools/mod_dptools.c
浏览文件 @
580f545e
...
...
@@ -1897,7 +1897,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
#define HOLD_SYNTAX "[<display message>]"
SWITCH_STANDARD_APP
(
hold_function
)
{
switch_ivr_hold_uuid
(
switch_core_session_get_uuid
(
session
),
data
);
switch_ivr_hold_uuid
(
switch_core_session_get_uuid
(
session
),
data
,
1
);
}
#define UNHOLD_SYNTAX ""
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
580f545e
...
...
@@ -1829,7 +1829,13 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
}
if
(
stream
&&
strcasecmp
(
stream
,
"silence"
))
{
switch_ivr_broadcast
(
switch_channel_get_variable
(
tech_pvt
->
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
),
stream
,
SMF_ECHO_ALEG
|
SMF_LOOP
);
if
(
!
strcasecmp
(
stream
,
"indicate_hold"
))
{
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_SUSPEND
);
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_HOLD
);
switch_ivr_hold_uuid
(
switch_channel_get_variable
(
tech_pvt
->
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
),
NULL
,
0
);
}
else
{
switch_ivr_broadcast
(
switch_channel_get_variable
(
tech_pvt
->
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
),
stream
,
SMF_ECHO_ALEG
|
SMF_LOOP
);
}
}
}
}
else
{
...
...
@@ -1843,8 +1849,15 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
if
((
uuid
=
switch_channel_get_variable
(
tech_pvt
->
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
))
&&
(
b_session
=
switch_core_session_locate
(
uuid
)))
{
switch_channel_t
*
b_channel
=
switch_core_session_get_channel
(
b_session
);
switch_channel_stop_broadcast
(
b_channel
);
switch_channel_wait_for_flag
(
b_channel
,
CF_BROADCAST
,
SWITCH_FALSE
,
5000
);
if
(
switch_channel_test_flag
(
tech_pvt
->
channel
,
CF_HOLD
))
{
switch_ivr_unhold
(
b_session
);
switch_channel_clear_flag
(
tech_pvt
->
channel
,
CF_SUSPEND
);
switch_channel_clear_flag
(
tech_pvt
->
channel
,
CF_HOLD
);
}
else
{
switch_channel_stop_broadcast
(
b_channel
);
switch_channel_wait_for_flag
(
b_channel
,
CF_BROADCAST
,
SWITCH_FALSE
,
5000
);
}
switch_core_session_rwunlock
(
b_session
);
}
...
...
src/switch_core_io.c
浏览文件 @
580f545e
...
...
@@ -120,7 +120,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
if
(
switch_channel_test_flag
(
session
->
channel
,
CF_HOLD
))
{
status
=
SWITCH_STATUS_BREAK
;
goto
done
;
goto
even_more_
done
;
}
if
(
session
->
endpoint_interface
->
io_routines
->
read_frame
)
{
...
...
@@ -459,6 +459,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
switch_thread_rwlock_unlock
(
session
->
bug_rwlock
);
}
}
even_more_done
:
return
status
;
}
...
...
src/switch_core_rwlock.c
浏览文件 @
580f545e
...
...
@@ -35,7 +35,6 @@
#include <switch.h>
#include "private/switch_core_pvt.h"
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_signal_lock
(
switch_core_session_t
*
session
)
{
return
switch_mutex_lock
(
session
->
signal_mutex
);
...
...
@@ -58,12 +57,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_lock(switch_core_sessio
if
(
switch_test_flag
(
session
,
SSF_DESTROYED
))
{
status
=
SWITCH_STATUS_FALSE
;
#ifdef SWITCH_DEBUG_RWLOCKS
switch_log_printf
(
SWITCH_CHANNEL_ID_LOG
,
file
,
func
,
line
,
SWITCH_LOG_ERROR
,
"%s Read lock FAIL
\n
"
,
switch_channel_get_name
(
session
->
channel
));
switch_log_printf
(
SWITCH_CHANNEL_ID_LOG
,
file
,
func
,
line
,
NULL
,
SWITCH_LOG_ERROR
,
"%s Read lock FAIL
\n
"
,
switch_channel_get_name
(
session
->
channel
));
#endif
}
else
{
status
=
(
switch_status_t
)
switch_thread_rwlock_tryrdlock
(
session
->
rwlock
);
#ifdef SWITCH_DEBUG_RWLOCKS
switch_log_printf
(
SWITCH_CHANNEL_ID_LOG
,
file
,
func
,
line
,
SWITCH_LOG_ERROR
,
"%s Read lock AQUIRED
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_ID_LOG
,
file
,
func
,
line
,
NULL
,
SWITCH_LOG_ERROR
,
"%s Read lock AQUIRED
\n
"
,
switch_channel_get_name
(
session
->
channel
));
#endif
}
...
...
@@ -76,7 +75,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_lock(switch_core_sessio
SWITCH_DECLARE
(
void
)
switch_core_session_perform_write_lock
(
switch_core_session_t
*
session
,
const
char
*
file
,
const
char
*
func
,
int
line
)
{
switch_log_printf
(
SWITCH_CHANNEL_ID_LOG
,
file
,
func
,
line
,
SWITCH_LOG_ERROR
,
"%s Write lock AQUIRED
\n
"
,
switch_channel_get_name
(
session
->
channel
));
switch_log_printf
(
SWITCH_CHANNEL_ID_LOG
,
file
,
func
,
line
,
NULL
,
SWITCH_LOG_ERROR
,
"%s Write lock AQUIRED
\n
"
,
switch_channel_get_name
(
session
->
channel
));
#else
SWITCH_DECLARE
(
void
)
switch_core_session_write_lock
(
switch_core_session_t
*
session
)
{
...
...
@@ -87,7 +86,7 @@ SWITCH_DECLARE(void) switch_core_session_write_lock(switch_core_session_t *sessi
#ifdef SWITCH_DEBUG_RWLOCKS
SWITCH_DECLARE
(
void
)
switch_core_session_perform_rwunlock
(
switch_core_session_t
*
session
,
const
char
*
file
,
const
char
*
func
,
int
line
)
{
switch_log_printf
(
SWITCH_CHANNEL_ID_LOG
,
file
,
func
,
line
,
SWITCH_LOG_ERROR
,
"%s Read/Write lock CLEARED
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_ID_LOG
,
file
,
func
,
line
,
NULL
,
SWITCH_LOG_ERROR
,
"%s Read/Write lock CLEARED
\n
"
,
switch_channel_get_name
(
session
->
channel
));
#else
SWITCH_DECLARE
(
void
)
switch_core_session_rwunlock
(
switch_core_session_t
*
session
)
...
...
src/switch_ivr.c
浏览文件 @
580f545e
...
...
@@ -741,7 +741,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_sess
return
status
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_hold
(
switch_core_session_t
*
session
,
const
char
*
message
)
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_hold
(
switch_core_session_t
*
session
,
const
char
*
message
,
switch_bool_t
moh
)
{
switch_core_session_message_t
msg
=
{
0
};
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
...
...
@@ -756,8 +756,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_hold(switch_core_session_t *session,
switch_channel_set_flag
(
channel
,
CF_SUSPEND
);
switch_core_session_receive_message
(
session
,
&
msg
);
if
((
stream
=
switch_channel_get_variable
(
channel
,
SWITCH_HOLD_MUSIC_VARIABLE
)))
{
if
(
moh
&&
(
stream
=
switch_channel_get_variable
(
channel
,
SWITCH_HOLD_MUSIC_VARIABLE
)))
{
if
((
other_uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
)))
{
switch_ivr_broadcast
(
other_uuid
,
stream
,
SMF_ECHO_ALEG
|
SMF_LOOP
);
}
...
...
@@ -767,12 +767,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_hold(switch_core_session_t *session,
return
SWITCH_STATUS_SUCCESS
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_hold_uuid
(
const
char
*
uuid
,
const
char
*
message
)
SWITCH_DECLARE
(
switch_status_t
)
switch_ivr_hold_uuid
(
const
char
*
uuid
,
const
char
*
message
,
switch_bool_t
moh
)
{
switch_core_session_t
*
session
;
if
((
session
=
switch_core_session_locate
(
uuid
)))
{
switch_ivr_hold
(
session
,
message
);
switch_ivr_hold
(
session
,
message
,
moh
);
switch_core_session_rwunlock
(
session
);
}
...
...
src/switch_ivr_bridge.c
浏览文件 @
580f545e
...
...
@@ -161,8 +161,12 @@ static void *audio_bridge_thread(switch_thread_t * thread, void *obj)
}
if
(
!
nosuspend
&&
(
switch_channel_test_flag
(
chan_a
,
CF_SUSPEND
)
||
switch_channel_test_flag
(
chan_b
,
CF_SUSPEND
)))
{
status
=
switch_core_session_read_frame
(
session_a
,
&
read_frame
,
-
1
,
stream_id
);
if
(
switch_channel_test_flag
(
chan_a
,
CF_SUSPEND
))
{
status
=
SWITCH_STATUS_SUCCESS
;
}
else
{
status
=
switch_core_session_read_frame
(
session_a
,
&
read_frame
,
-
1
,
stream_id
);
}
if
(
!
SWITCH_READ_ACCEPTABLE
(
status
))
{
goto
end_of_bridge_loop
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论