Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
f40f87eb
提交
f40f87eb
authored
4月 16, 2007
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<refactor>
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@4944
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
5cd76f4a
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
92 行增加
和
100 行删除
+92
-100
switch_core.h
src/include/switch_core.h
+8
-7
switch_core_event_hook.h
src/include/switch_core_event_hook.h
+3
-22
switch_module_interfaces.h
src/include/switch_module_interfaces.h
+0
-2
switch_types.h
src/include/switch_types.h
+2
-0
mod_dingaling.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
+3
-1
mod_iax.c
src/mod/endpoints/mod_iax/mod_iax.c
+25
-2
mod_portaudio.c
src/mod/endpoints/mod_portaudio/mod_portaudio.c
+3
-1
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+6
-2
mod_wanpipe.c
src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
+6
-12
mod_woomera.c
src/mod/endpoints/mod_woomera/mod_woomera.c
+0
-1
switch_channel.c
src/switch_channel.c
+11
-5
switch_core_event_hook.c
src/switch_core_event_hook.c
+1
-23
switch_core_session.c
src/switch_core_session.c
+24
-22
没有找到文件。
src/include/switch_core.h
浏览文件 @
f40f87eb
...
@@ -526,6 +526,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_message_send(char *uuid_str,
...
@@ -526,6 +526,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_message_send(char *uuid_str,
*/
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_queue_message
(
switch_core_session_t
*
session
,
switch_core_session_message_t
*
message
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_queue_message
(
switch_core_session_t
*
session
,
switch_core_session_message_t
*
message
);
/*!
\brief pass an indication message on a session
\param session the session to pass the message across
\param indication the indication message to pass
\return SWITCH_STATUS_SUCCESS if the message was passed
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_pass_indication
(
switch_core_session_t
*
session
,
switch_core_session_message_types_t
indication
);
/*!
/*!
\brief Queue an indication message on a session
\brief Queue an indication message on a session
\param session the session to queue the message to
\param session the session to queue the message to
...
@@ -639,13 +647,6 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
...
@@ -639,13 +647,6 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
switch_caller_profile_t
*
caller_profile
,
switch_caller_profile_t
*
caller_profile
,
switch_core_session_t
**
new_session
,
switch_memory_pool_t
**
pool
);
switch_core_session_t
**
new_session
,
switch_memory_pool_t
**
pool
);
/*!
\brief Answer the channel of a given session
\param session the session to answer the channel of
\return SWITCH_STATUS_SUCCESS if the channel was answered
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_answer_channel
(
switch_core_session_t
*
session
);
/*!
/*!
\brief Receive a message on a given session
\brief Receive a message on a given session
\param session the session to receive the message from
\param session the session to receive the message from
...
...
src/include/switch_core_event_hook.h
浏览文件 @
f40f87eb
...
@@ -35,7 +35,6 @@
...
@@ -35,7 +35,6 @@
SWITCH_BEGIN_EXTERN_C
typedef
struct
switch_io_event_hooks
switch_io_event_hooks_t
;
SWITCH_BEGIN_EXTERN_C
typedef
struct
switch_io_event_hooks
switch_io_event_hooks_t
;
typedef
struct
switch_io_event_hook_outgoing_channel
switch_io_event_hook_outgoing_channel_t
;
typedef
struct
switch_io_event_hook_outgoing_channel
switch_io_event_hook_outgoing_channel_t
;
typedef
struct
switch_io_event_hook_answer_channel
switch_io_event_hook_answer_channel_t
;
typedef
struct
switch_io_event_hook_receive_message
switch_io_event_hook_receive_message_t
;
typedef
struct
switch_io_event_hook_receive_message
switch_io_event_hook_receive_message_t
;
typedef
struct
switch_io_event_hook_receive_event
switch_io_event_hook_receive_event_t
;
typedef
struct
switch_io_event_hook_receive_event
switch_io_event_hook_receive_event_t
;
typedef
struct
switch_io_event_hook_read_frame
switch_io_event_hook_read_frame_t
;
typedef
struct
switch_io_event_hook_read_frame
switch_io_event_hook_read_frame_t
;
...
@@ -48,7 +47,6 @@ typedef struct switch_io_event_hook_state_change switch_io_event_hook_state_chan
...
@@ -48,7 +47,6 @@ typedef struct switch_io_event_hook_state_change switch_io_event_hook_state_chan
typedef
switch_status_t
(
*
switch_outgoing_channel_hook_t
)
(
switch_core_session_t
*
,
switch_caller_profile_t
*
,
switch_core_session_t
*
);
typedef
switch_status_t
(
*
switch_outgoing_channel_hook_t
)
(
switch_core_session_t
*
,
switch_caller_profile_t
*
,
switch_core_session_t
*
);
typedef
switch_status_t
(
*
switch_answer_channel_hook_t
)
(
switch_core_session_t
*
);
typedef
switch_status_t
(
*
switch_receive_message_hook_t
)
(
switch_core_session_t
*
,
switch_core_session_message_t
*
);
typedef
switch_status_t
(
*
switch_receive_message_hook_t
)
(
switch_core_session_t
*
,
switch_core_session_message_t
*
);
typedef
switch_status_t
(
*
switch_receive_event_hook_t
)
(
switch_core_session_t
*
,
switch_event_t
*
);
typedef
switch_status_t
(
*
switch_receive_event_hook_t
)
(
switch_core_session_t
*
,
switch_event_t
*
);
typedef
switch_status_t
(
*
switch_read_frame_hook_t
)
(
switch_core_session_t
*
,
switch_frame_t
**
,
int
,
switch_io_flag_t
,
int
);
typedef
switch_status_t
(
*
switch_read_frame_hook_t
)
(
switch_core_session_t
*
,
switch_frame_t
**
,
int
,
switch_io_flag_t
,
int
);
...
@@ -67,23 +65,16 @@ struct switch_io_event_hook_outgoing_channel {
...
@@ -67,23 +65,16 @@ struct switch_io_event_hook_outgoing_channel {
struct
switch_io_event_hook_outgoing_channel
*
next
;
struct
switch_io_event_hook_outgoing_channel
*
next
;
};
};
/*! \brief Node in which to store custom answer channel callback hooks */
struct
switch_io_event_hook_answer_channel
{
/*! the answer channel callback hook */
switch_answer_channel_hook_t
answer_channel
;
struct
switch_io_event_hook_answer_channel
*
next
;
};
/*! \brief Node in which to store custom receive message callback hooks */
/*! \brief Node in which to store custom receive message callback hooks */
struct
switch_io_event_hook_receive_message
{
struct
switch_io_event_hook_receive_message
{
/*! the
answer channel
callback hook */
/*! the
message
callback hook */
switch_receive_message_hook_t
receive_message
;
switch_receive_message_hook_t
receive_message
;
struct
switch_io_event_hook_receive_message
*
next
;
struct
switch_io_event_hook_receive_message
*
next
;
};
};
/*! \brief Node in which to store custom receive message callback hooks */
/*! \brief Node in which to store custom receive message callback hooks */
struct
switch_io_event_hook_receive_event
{
struct
switch_io_event_hook_receive_event
{
/*! the
answer channel
callback hook */
/*! the
event
callback hook */
switch_receive_event_hook_t
receive_event
;
switch_receive_event_hook_t
receive_event
;
struct
switch_io_event_hook_receive_event
*
next
;
struct
switch_io_event_hook_receive_event
*
next
;
};
};
...
@@ -141,8 +132,6 @@ struct switch_io_event_hook_state_change {
...
@@ -141,8 +132,6 @@ struct switch_io_event_hook_state_change {
struct
switch_io_event_hooks
{
struct
switch_io_event_hooks
{
/*! a list of outgoing channel hooks */
/*! a list of outgoing channel hooks */
switch_io_event_hook_outgoing_channel_t
*
outgoing_channel
;
switch_io_event_hook_outgoing_channel_t
*
outgoing_channel
;
/*! a list of answer channel hooks */
switch_io_event_hook_answer_channel_t
*
answer_channel
;
/*! a list of receive message hooks */
/*! a list of receive message hooks */
switch_io_event_hook_receive_message_t
*
receive_message
;
switch_io_event_hook_receive_message_t
*
receive_message
;
/*! a list of queue message hooks */
/*! a list of queue message hooks */
...
@@ -180,14 +169,6 @@ extern switch_io_event_hooks_t switch_core_session_get_event_hooks(switch_core_s
...
@@ -180,14 +169,6 @@ extern switch_io_event_hooks_t switch_core_session_get_event_hooks(switch_core_s
SWITCH_DECLARE
(
switch_status_t
)
switch_core_event_hook_add_outgoing_channel
(
switch_core_session_t
*
session
,
SWITCH_DECLARE
(
switch_status_t
)
switch_core_event_hook_add_outgoing_channel
(
switch_core_session_t
*
session
,
switch_outgoing_channel_hook_t
outgoing_channel
);
switch_outgoing_channel_hook_t
outgoing_channel
);
/*!
\brief Add an event hook to be executed when a session answers a channel
\param session session to bind hook to
\param answer_channel hook to bind
\return SWITCH_STATUS_SUCCESS on suceess
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_core_event_hook_add_answer_channel
(
switch_core_session_t
*
session
,
switch_answer_channel_hook_t
answer_channel
);
/*!
/*!
\brief Add an event hook to be executed when a session sends a message
\brief Add an event hook to be executed when a session sends a message
\param session session to bind hook to
\param session session to bind hook to
...
@@ -250,7 +231,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_send_dtmf(switch_core
...
@@ -250,7 +231,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_send_dtmf(switch_core
\param state_change hook to bind
\param state_change hook to bind
\return SWITCH_STATUS_SUCCESS on suceess
\return SWITCH_STATUS_SUCCESS on suceess
*/
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_core_event_hook_add_state_change
(
switch_core_session_t
*
session
,
switch_
answer_channel
_hook_t
state_change
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_event_hook_add_state_change
(
switch_core_session_t
*
session
,
switch_
state_change
_hook_t
state_change
);
///\}
///\}
SWITCH_END_EXTERN_C
SWITCH_END_EXTERN_C
...
...
src/include/switch_module_interfaces.h
浏览文件 @
f40f87eb
...
@@ -81,8 +81,6 @@ struct switch_io_event_hooks;
...
@@ -81,8 +81,6 @@ struct switch_io_event_hooks;
struct
switch_io_routines
{
struct
switch_io_routines
{
/*! creates an outgoing session from given session, caller profile */
/*! creates an outgoing session from given session, caller profile */
switch_call_cause_t
(
*
outgoing_channel
)
(
switch_core_session_t
*
,
switch_caller_profile_t
*
,
switch_core_session_t
**
,
switch_memory_pool_t
**
);
switch_call_cause_t
(
*
outgoing_channel
)
(
switch_core_session_t
*
,
switch_caller_profile_t
*
,
switch_core_session_t
**
,
switch_memory_pool_t
**
);
/*! answers the given session's channel */
switch_status_t
(
*
answer_channel
)
(
switch_core_session_t
*
);
/*! read a frame from a session */
/*! read a frame from a session */
switch_status_t
(
*
read_frame
)
(
switch_core_session_t
*
,
switch_frame_t
**
,
int
,
switch_io_flag_t
,
int
);
switch_status_t
(
*
read_frame
)
(
switch_core_session_t
*
,
switch_frame_t
**
,
int
,
switch_io_flag_t
,
int
);
/*! write a frame to a session */
/*! write a frame to a session */
...
...
src/include/switch_types.h
浏览文件 @
f40f87eb
...
@@ -349,6 +349,7 @@ typedef enum {
...
@@ -349,6 +349,7 @@ typedef enum {
<pre>
<pre>
SWITCH_MESSAGE_REDIRECT_AUDIO - Indication to redirect audio to another location if possible
SWITCH_MESSAGE_REDIRECT_AUDIO - Indication to redirect audio to another location if possible
SWITCH_MESSAGE_TRANSMIT_TEXT - A text message
SWITCH_MESSAGE_TRANSMIT_TEXT - A text message
SWITCH_MESSAGE_INDICATE_ANSWER - indicate answer
SWITCH_MESSAGE_INDICATE_PROGRESS - indicate progress
SWITCH_MESSAGE_INDICATE_PROGRESS - indicate progress
SWITCH_MESSAGE_INDICATE_BRIDGE - indicate a bridge starting
SWITCH_MESSAGE_INDICATE_BRIDGE - indicate a bridge starting
SWITCH_MESSAGE_INDICATE_UNBRIDGE - indicate a bridge ending
SWITCH_MESSAGE_INDICATE_UNBRIDGE - indicate a bridge ending
...
@@ -363,6 +364,7 @@ typedef enum {
...
@@ -363,6 +364,7 @@ typedef enum {
typedef
enum
{
typedef
enum
{
SWITCH_MESSAGE_REDIRECT_AUDIO
,
SWITCH_MESSAGE_REDIRECT_AUDIO
,
SWITCH_MESSAGE_TRANSMIT_TEXT
,
SWITCH_MESSAGE_TRANSMIT_TEXT
,
SWITCH_MESSAGE_INDICATE_ANSWER
,
SWITCH_MESSAGE_INDICATE_PROGRESS
,
SWITCH_MESSAGE_INDICATE_PROGRESS
,
SWITCH_MESSAGE_INDICATE_BRIDGE
,
SWITCH_MESSAGE_INDICATE_BRIDGE
,
SWITCH_MESSAGE_INDICATE_UNBRIDGE
,
SWITCH_MESSAGE_INDICATE_UNBRIDGE
,
...
...
src/mod/endpoints/mod_dingaling/mod_dingaling.c
浏览文件 @
f40f87eb
...
@@ -1513,6 +1513,9 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
...
@@ -1513,6 +1513,9 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
assert
(
tech_pvt
!=
NULL
);
assert
(
tech_pvt
!=
NULL
);
switch
(
msg
->
message_id
)
{
switch
(
msg
->
message_id
)
{
case
SWITCH_MESSAGE_INDICATE_ANSWER
:
channel_answer_channel
(
session
);
break
;
case
SWITCH_MESSAGE_INDICATE_BRIDGE
:
case
SWITCH_MESSAGE_INDICATE_BRIDGE
:
if
(
tech_pvt
->
rtp_session
&&
switch_test_flag
(
tech_pvt
->
profile
,
TFLAG_TIMER
))
{
if
(
tech_pvt
->
rtp_session
&&
switch_test_flag
(
tech_pvt
->
profile
,
TFLAG_TIMER
))
{
switch_rtp_clear_flag
(
tech_pvt
->
rtp_session
,
SWITCH_RTP_FLAG_USE_TIMER
);
switch_rtp_clear_flag
(
tech_pvt
->
rtp_session
,
SWITCH_RTP_FLAG_USE_TIMER
);
...
@@ -1571,7 +1574,6 @@ static const switch_state_handler_table_t channel_event_handlers = {
...
@@ -1571,7 +1574,6 @@ static const switch_state_handler_table_t channel_event_handlers = {
static
const
switch_io_routines_t
channel_io_routines
=
{
static
const
switch_io_routines_t
channel_io_routines
=
{
/*.outgoing_channel */
channel_outgoing_channel
,
/*.outgoing_channel */
channel_outgoing_channel
,
/*.answer_channel */
channel_answer_channel
,
/*.read_frame */
channel_read_frame
,
/*.read_frame */
channel_read_frame
,
/*.write_frame */
channel_write_frame
,
/*.write_frame */
channel_write_frame
,
/*.kill_channel */
channel_kill_channel
,
/*.kill_channel */
channel_kill_channel
,
...
...
src/mod/endpoints/mod_iax/mod_iax.c
浏览文件 @
f40f87eb
...
@@ -747,6 +747,29 @@ static switch_status_t channel_answer_channel(switch_core_session_t *session)
...
@@ -747,6 +747,29 @@ static switch_status_t channel_answer_channel(switch_core_session_t *session)
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
static
switch_status_t
channel_receive_message
(
switch_core_session_t
*
session
,
switch_core_session_message_t
*
msg
)
{
switch_channel_t
*
channel
;
private_t
*
tech_pvt
;
channel
=
switch_core_session_get_channel
(
session
);
assert
(
channel
!=
NULL
);
tech_pvt
=
(
private_t
*
)
switch_core_session_get_private
(
session
);
assert
(
tech_pvt
!=
NULL
);
switch
(
msg
->
message_id
)
{
case
SWITCH_MESSAGE_INDICATE_ANSWER
:
channel_answer_channel
(
session
);
break
;
default:
break
;
}
return
SWITCH_STATUS_SUCCESS
;
}
static
const
switch_state_handler_table_t
channel_event_handlers
=
{
static
const
switch_state_handler_table_t
channel_event_handlers
=
{
/*.on_init */
channel_on_init
,
/*.on_init */
channel_on_init
,
/*.on_ring */
channel_on_ring
,
/*.on_ring */
channel_on_ring
,
...
@@ -758,13 +781,13 @@ static const switch_state_handler_table_t channel_event_handlers = {
...
@@ -758,13 +781,13 @@ static const switch_state_handler_table_t channel_event_handlers = {
static
const
switch_io_routines_t
channel_io_routines
=
{
static
const
switch_io_routines_t
channel_io_routines
=
{
/*.outgoing_channel */
channel_outgoing_channel
,
/*.outgoing_channel */
channel_outgoing_channel
,
/*.answer_channel */
channel_answer_channel
,
/*.read_frame */
channel_read_frame
,
/*.read_frame */
channel_read_frame
,
/*.write_frame */
channel_write_frame
,
/*.write_frame */
channel_write_frame
,
/*.kill_channel */
channel_kill_channel
,
/*.kill_channel */
channel_kill_channel
,
/*.waitfor_read */
channel_waitfor_read
,
/*.waitfor_read */
channel_waitfor_read
,
/*.waitfor_write */
channel_waitfor_write
,
/*.waitfor_write */
channel_waitfor_write
,
/*.send_dtmf */
channel_send_dtmf
/*.send_dtmf */
channel_send_dtmf
,
/*.receive_message*/
channel_receive_message
};
};
static
const
switch_endpoint_interface_t
channel_endpoint_interface
=
{
static
const
switch_endpoint_interface_t
channel_endpoint_interface
=
{
...
...
src/mod/endpoints/mod_portaudio/mod_portaudio.c
浏览文件 @
f40f87eb
...
@@ -718,6 +718,9 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
...
@@ -718,6 +718,9 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
switch
(
msg
->
message_id
)
{
switch
(
msg
->
message_id
)
{
case
SWITCH_MESSAGE_INDICATE_ANSWER
:
channel_answer_channel
(
session
);
break
;
case
SWITCH_MESSAGE_INDICATE_PROGRESS
:
case
SWITCH_MESSAGE_INDICATE_PROGRESS
:
{
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Engage Early Media
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Engage Early Media
\n
"
);
...
@@ -788,7 +791,6 @@ static const switch_state_handler_table_t channel_event_handlers = {
...
@@ -788,7 +791,6 @@ static const switch_state_handler_table_t channel_event_handlers = {
static
const
switch_io_routines_t
channel_io_routines
=
{
static
const
switch_io_routines_t
channel_io_routines
=
{
/*.outgoing_channel */
channel_outgoing_channel
,
/*.outgoing_channel */
channel_outgoing_channel
,
/*.answer_channel */
channel_answer_channel
,
/*.read_frame */
channel_read_frame
,
/*.read_frame */
channel_read_frame
,
/*.write_frame */
channel_write_frame
,
/*.write_frame */
channel_write_frame
,
/*.kill_channel */
channel_kill_channel
,
/*.kill_channel */
channel_kill_channel
,
...
...
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
f40f87eb
...
@@ -675,9 +675,14 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
...
@@ -675,9 +675,14 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
break
;
break
;
case
SWITCH_MESSAGE_INDICATE_RINGING
:
case
SWITCH_MESSAGE_INDICATE_RINGING
:
nua_respond
(
tech_pvt
->
nh
,
SIP_180_RINGING
,
SIPTAG_CONTACT_STR
(
tech_pvt
->
profile
->
url
),
TAG_END
());
nua_respond
(
tech_pvt
->
nh
,
SIP_180_RINGING
,
SIPTAG_CONTACT_STR
(
tech_pvt
->
profile
->
url
),
TAG_END
());
switch_channel_mark_ring_ready
(
channel
);
break
;
case
SWITCH_MESSAGE_INDICATE_ANSWER
:
sofia_answer_channel
(
session
);
break
;
break
;
case
SWITCH_MESSAGE_INDICATE_PROGRESS
:{
case
SWITCH_MESSAGE_INDICATE_PROGRESS
:{
if
(
!
switch_test_flag
(
tech_pvt
,
TFLAG_ANS
))
{
if
(
!
switch_test_flag
(
tech_pvt
,
TFLAG_ANS
))
{
switch_set_flag_locked
(
tech_pvt
,
TFLAG_EARLY_MEDIA
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_EARLY_MEDIA
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Asked to send early media by %s
\n
"
,
msg
->
from
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Asked to send early media by %s
\n
"
,
msg
->
from
);
...
@@ -708,7 +713,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
...
@@ -708,7 +713,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Ring SDP:
\n
%s
\n
"
,
tech_pvt
->
local_sdp_str
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"Ring SDP:
\n
%s
\n
"
,
tech_pvt
->
local_sdp_str
);
}
}
}
}
switch_channel_mark_pre_answered
(
channel
);
nua_respond
(
tech_pvt
->
nh
,
nua_respond
(
tech_pvt
->
nh
,
SIP_183_SESSION_PROGRESS
,
SIP_183_SESSION_PROGRESS
,
SIPTAG_CONTACT_STR
(
tech_pvt
->
profile
->
url
),
SIPTAG_CONTACT_STR
(
tech_pvt
->
profile
->
url
),
...
@@ -754,7 +759,6 @@ static switch_status_t sofia_receive_event(switch_core_session_t *session, switc
...
@@ -754,7 +759,6 @@ static switch_status_t sofia_receive_event(switch_core_session_t *session, switc
static
const
switch_io_routines_t
sofia_io_routines
=
{
static
const
switch_io_routines_t
sofia_io_routines
=
{
/*.outgoing_channel */
sofia_outgoing_channel
,
/*.outgoing_channel */
sofia_outgoing_channel
,
/*.answer_channel */
sofia_answer_channel
,
/*.read_frame */
sofia_read_frame
,
/*.read_frame */
sofia_read_frame
,
/*.write_frame */
sofia_write_frame
,
/*.write_frame */
sofia_write_frame
,
/*.kill_channel */
sofia_kill_channel
,
/*.kill_channel */
sofia_kill_channel
,
...
...
src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
浏览文件 @
f40f87eb
...
@@ -930,6 +930,9 @@ static switch_status_t wanpipe_receive_message(switch_core_session_t *session, s
...
@@ -930,6 +930,9 @@ static switch_status_t wanpipe_receive_message(switch_core_session_t *session, s
break
;
break
;
case
SWITCH_MESSAGE_INDICATE_REDIRECT
:
case
SWITCH_MESSAGE_INDICATE_REDIRECT
:
break
;
break
;
case
SWITCH_MESSAGE_INDICATE_ANSWER
:
wanpipe_answer_channel
(
session
);
break
;
case
SWITCH_MESSAGE_INDICATE_PROGRESS
:
case
SWITCH_MESSAGE_INDICATE_PROGRESS
:
break
;
break
;
case
SWITCH_MESSAGE_INDICATE_RINGING
:
case
SWITCH_MESSAGE_INDICATE_RINGING
:
...
@@ -969,7 +972,6 @@ static switch_status_t wanpipe_kill_channel(switch_core_session_t *session, int
...
@@ -969,7 +972,6 @@ static switch_status_t wanpipe_kill_channel(switch_core_session_t *session, int
static
const
switch_io_routines_t
wanpipe_io_routines
=
{
static
const
switch_io_routines_t
wanpipe_io_routines
=
{
/*.outgoing_channel */
wanpipe_outgoing_channel
,
/*.outgoing_channel */
wanpipe_outgoing_channel
,
/*.answer_channel */
wanpipe_answer_channel
,
/*.read_frame */
wanpipe_read_frame
,
/*.read_frame */
wanpipe_read_frame
,
/*.write_frame */
wanpipe_write_frame
,
/*.write_frame */
wanpipe_write_frame
,
/*.kill_channel */
wanpipe_kill_channel
,
/*.kill_channel */
wanpipe_kill_channel
,
...
@@ -1422,16 +1424,8 @@ static int on_proceed(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
...
@@ -1422,16 +1424,8 @@ static int on_proceed(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
channel
=
switch_core_session_get_channel
(
session
);
channel
=
switch_core_session_get_channel
(
session
);
assert
(
channel
!=
NULL
);
assert
(
channel
!=
NULL
);
if
((
msg
=
malloc
(
sizeof
(
*
msg
))))
{
switch_core_session_pass_indication
(
session
,
SWITCH_MESSAGE_INDICATE_PROGRESS
);
memset
(
msg
,
0
,
sizeof
(
*
msg
));
switch_channel_mark_pre_answered
(
channel
);
msg
->
message_id
=
SWITCH_MESSAGE_INDICATE_PROGRESS
;
msg
->
from
=
__FILE__
;
switch_core_session_queue_message
(
session
,
msg
);
switch_set_flag
(
msg
,
SCSMF_DYNAMIC
);
switch_channel_mark_pre_answered
(
channel
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Memory Error!
\n
"
);
}
switch_core_session_rwunlock
(
session
);
switch_core_session_rwunlock
(
session
);
}
else
{
}
else
{
...
@@ -1457,7 +1451,7 @@ static int on_ringing(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
...
@@ -1457,7 +1451,7 @@ static int on_ringing(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
channel
=
switch_core_session_get_channel
(
session
);
channel
=
switch_core_session_get_channel
(
session
);
assert
(
channel
!=
NULL
);
assert
(
channel
!=
NULL
);
switch_core_session_
queue
_indication
(
session
,
SWITCH_MESSAGE_INDICATE_RINGING
);
switch_core_session_
pass
_indication
(
session
,
SWITCH_MESSAGE_INDICATE_RINGING
);
switch_channel_mark_ring_ready
(
channel
);
switch_channel_mark_ring_ready
(
channel
);
switch_core_session_rwunlock
(
session
);
switch_core_session_rwunlock
(
session
);
...
...
src/mod/endpoints/mod_woomera/mod_woomera.c
浏览文件 @
f40f87eb
...
@@ -447,7 +447,6 @@ static const switch_state_handler_table_t woomera_event_handlers = {
...
@@ -447,7 +447,6 @@ static const switch_state_handler_table_t woomera_event_handlers = {
static
const
switch_io_routines_t
woomera_io_routines
=
{
static
const
switch_io_routines_t
woomera_io_routines
=
{
/*.outgoing_channel */
woomera_outgoing_channel
,
/*.outgoing_channel */
woomera_outgoing_channel
,
/*.answer_channel */
NULL
,
/*.read_frame */
woomera_read_frame
,
/*.read_frame */
woomera_read_frame
,
/*.write_frame */
woomera_write_frame
,
/*.write_frame */
woomera_write_frame
,
/*.kill_channel */
woomera_kill_channel
,
/*.kill_channel */
woomera_kill_channel
,
...
...
src/switch_channel.c
浏览文件 @
f40f87eb
...
@@ -1080,7 +1080,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_
...
@@ -1080,7 +1080,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_
SWITCH_DECLARE
(
switch_status_t
)
switch_channel_perform_pre_answer
(
switch_channel_t
*
channel
,
const
char
*
file
,
const
char
*
func
,
int
line
)
SWITCH_DECLARE
(
switch_status_t
)
switch_channel_perform_pre_answer
(
switch_channel_t
*
channel
,
const
char
*
file
,
const
char
*
func
,
int
line
)
{
{
switch_core_session_message_t
msg
;
switch_core_session_message_t
msg
;
char
*
uuid
=
switch_core_session_get_uuid
(
channel
->
session
);
switch_status_t
status
;
switch_status_t
status
;
assert
(
channel
!=
NULL
);
assert
(
channel
!=
NULL
);
...
@@ -1099,7 +1098,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel
...
@@ -1099,7 +1098,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel
msg
.
message_id
=
SWITCH_MESSAGE_INDICATE_PROGRESS
;
msg
.
message_id
=
SWITCH_MESSAGE_INDICATE_PROGRESS
;
msg
.
from
=
channel
->
name
;
msg
.
from
=
channel
->
name
;
status
=
switch_core_session_
message_send
(
uuid
,
&
msg
);
status
=
switch_core_session_
receive_message
(
channel
->
session
,
&
msg
);
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
status
=
switch_channel_perform_mark_pre_answered
(
channel
,
file
,
func
,
line
);
status
=
switch_channel_perform_mark_pre_answered
(
channel
,
file
,
func
,
line
);
...
@@ -1111,7 +1110,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel
...
@@ -1111,7 +1110,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel
SWITCH_DECLARE
(
switch_status_t
)
switch_channel_perform_ring_ready
(
switch_channel_t
*
channel
,
const
char
*
file
,
const
char
*
func
,
int
line
)
SWITCH_DECLARE
(
switch_status_t
)
switch_channel_perform_ring_ready
(
switch_channel_t
*
channel
,
const
char
*
file
,
const
char
*
func
,
int
line
)
{
{
switch_core_session_message_t
msg
;
switch_core_session_message_t
msg
;
char
*
uuid
=
switch_core_session_get_uuid
(
channel
->
session
);
switch_status_t
status
;
switch_status_t
status
;
assert
(
channel
!=
NULL
);
assert
(
channel
!=
NULL
);
...
@@ -1130,7 +1128,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_ring_ready(switch_channel
...
@@ -1130,7 +1128,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_ring_ready(switch_channel
msg
.
message_id
=
SWITCH_MESSAGE_INDICATE_RINGING
;
msg
.
message_id
=
SWITCH_MESSAGE_INDICATE_RINGING
;
msg
.
from
=
channel
->
name
;
msg
.
from
=
channel
->
name
;
status
=
switch_core_session_
message_send
(
uuid
,
&
msg
);
status
=
switch_core_session_
receive_message
(
channel
->
session
,
&
msg
);
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_ID_LOG
,
file
,
func
,
line
,
SWITCH_LOG_NOTICE
,
"Ring Ready %s!
\n
"
,
channel
->
name
);
switch_log_printf
(
SWITCH_CHANNEL_ID_LOG
,
file
,
func
,
line
,
SWITCH_LOG_NOTICE
,
"Ring Ready %s!
\n
"
,
channel
->
name
);
...
@@ -1185,6 +1183,9 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan
...
@@ -1185,6 +1183,9 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan
SWITCH_DECLARE
(
switch_status_t
)
switch_channel_perform_answer
(
switch_channel_t
*
channel
,
const
char
*
file
,
const
char
*
func
,
int
line
)
SWITCH_DECLARE
(
switch_status_t
)
switch_channel_perform_answer
(
switch_channel_t
*
channel
,
const
char
*
file
,
const
char
*
func
,
int
line
)
{
{
switch_core_session_message_t
msg
;
switch_status_t
status
;
assert
(
channel
!=
NULL
);
assert
(
channel
!=
NULL
);
if
(
channel
->
hangup_cause
||
channel
->
state
>=
CS_HANGUP
)
{
if
(
channel
->
hangup_cause
||
channel
->
state
>=
CS_HANGUP
)
{
...
@@ -1195,7 +1196,12 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *
...
@@ -1195,7 +1196,12 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
if
(
switch_core_session_answer_channel
(
channel
->
session
)
==
SWITCH_STATUS_SUCCESS
)
{
msg
.
message_id
=
SWITCH_MESSAGE_INDICATE_ANSWER
;
msg
.
from
=
channel
->
name
;
status
=
switch_core_session_receive_message
(
channel
->
session
,
&
msg
);
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
return
switch_channel_perform_mark_answered
(
channel
,
file
,
func
,
line
);
return
switch_channel_perform_mark_answered
(
channel
,
file
,
func
,
line
);
}
}
...
...
src/switch_core_event_hook.c
浏览文件 @
f40f87eb
...
@@ -52,29 +52,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_outgoing(switch_core_
...
@@ -52,29 +52,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_outgoing(switch_core_
return
SWITCH_STATUS_MEMERR
;
return
SWITCH_STATUS_MEMERR
;
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_event_hook_add_answer_channel
(
switch_core_session_t
*
session
,
switch_answer_channel_hook_t
answer_channel
)
SWITCH_DECLARE
(
switch_status_t
)
switch_core_event_hook_add_state_change
(
switch_core_session_t
*
session
,
switch_state_change_hook_t
state_change
)
{
switch_io_event_hook_answer_channel_t
*
hook
,
*
ptr
;
assert
(
answer_channel
!=
NULL
);
if
((
hook
=
switch_core_session_alloc
(
session
,
sizeof
(
*
hook
)))
!=
0
)
{
hook
->
answer_channel
=
answer_channel
;
if
(
!
session
->
event_hooks
.
answer_channel
)
{
session
->
event_hooks
.
answer_channel
=
hook
;
}
else
{
for
(
ptr
=
session
->
event_hooks
.
answer_channel
;
ptr
&&
ptr
->
next
;
ptr
=
ptr
->
next
);
ptr
->
next
=
hook
;
}
return
SWITCH_STATUS_SUCCESS
;
}
return
SWITCH_STATUS_MEMERR
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_event_hook_add_state_change
(
switch_core_session_t
*
session
,
switch_answer_channel_hook_t
state_change
)
{
{
switch_io_event_hook_state_change_t
*
hook
,
*
ptr
;
switch_io_event_hook_state_change_t
*
hook
,
*
ptr
;
...
...
src/switch_core_session.c
浏览文件 @
f40f87eb
...
@@ -320,50 +320,52 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
...
@@ -320,50 +320,52 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
return
cause
;
return
cause
;
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_
answer_channel
(
switch_core_session_t
*
session
)
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_
receive_message
(
switch_core_session_t
*
session
,
switch_core_session_message_t
*
message
)
{
{
switch_io_event_hook_
answer_channel
_t
*
ptr
;
switch_io_event_hook_
receive_message
_t
*
ptr
;
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
assert
(
session
!=
NULL
);
assert
(
session
!=
NULL
);
if
(
session
->
endpoint_interface
->
io_routines
->
answer_channel
)
{
if
(
session
->
endpoint_interface
->
io_routines
->
receive_message
)
{
status
=
session
->
endpoint_interface
->
io_routines
->
answer_channel
(
session
);
status
=
session
->
endpoint_interface
->
io_routines
->
receive_message
(
session
,
message
);
}
}
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
for
(
ptr
=
session
->
event_hooks
.
answer_channel
;
ptr
;
ptr
=
ptr
->
next
)
{
for
(
ptr
=
session
->
event_hooks
.
receive_message
;
ptr
;
ptr
=
ptr
->
next
)
{
if
((
status
=
ptr
->
answer_channel
(
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
if
((
status
=
ptr
->
receive_message
(
session
,
message
))
!=
SWITCH_STATUS_SUCCESS
)
{
break
;
break
;
}
}
}
}
}
}
switch_core_session_kill_channel
(
session
,
SWITCH_SIG_BREAK
);
return
status
;
return
status
;
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_
receive_message
(
switch_core_session_t
*
session
,
switch_core_session_message_t
*
message
)
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_
pass_indication
(
switch_core_session_t
*
session
,
switch_core_session_message_types_t
indication
)
{
{
switch_io_event_hook_receive_message_t
*
ptr
;
switch_core_session_message_t
msg
=
{
0
};
switch_core_session_t
*
other_session
;
char
*
uuid
;
switch_channel_t
*
channel
;
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
assert
(
session
!=
NULL
);
assert
(
session
!=
NULL
);
channel
=
switch_core_session_get_channel
(
session
);
assert
(
channel
!=
NULL
);
if
(
session
->
endpoint_interface
->
io_routines
->
receive_message
)
{
if
((
uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
))
&&
(
other_session
=
switch_core_session_locate
(
uuid
)))
{
status
=
session
->
endpoint_interface
->
io_routines
->
receive_message
(
session
,
message
);
msg
.
message_id
=
indication
;
msg
.
from
=
__FILE__
;
}
status
=
switch_core_session_receive_message
(
other_session
,
&
msg
);
switch_core_session_rwunlock
(
other_session
);
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
}
else
{
for
(
ptr
=
session
->
event_hooks
.
receive_message
;
ptr
;
ptr
=
ptr
->
next
)
{
status
=
SWITCH_STATUS_FALSE
;
if
((
status
=
ptr
->
receive_message
(
session
,
message
))
!=
SWITCH_STATUS_SUCCESS
)
{
break
;
}
}
}
}
switch_core_session_kill_channel
(
session
,
SWITCH_SIG_BREAK
);
return
status
;
return
status
;
}
}
...
@@ -375,8 +377,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_queue_indication(switch_core
...
@@ -375,8 +377,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_queue_indication(switch_core
memset
(
msg
,
0
,
sizeof
(
*
msg
));
memset
(
msg
,
0
,
sizeof
(
*
msg
));
msg
->
message_id
=
indication
;
msg
->
message_id
=
indication
;
msg
->
from
=
__FILE__
;
msg
->
from
=
__FILE__
;
switch_core_session_queue_message
(
session
,
msg
);
switch_set_flag
(
msg
,
SCSMF_DYNAMIC
);
switch_set_flag
(
msg
,
SCSMF_DYNAMIC
);
switch_core_session_queue_message
(
session
,
msg
);
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论