Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
4a5d5756
提交
4a5d5756
authored
10月 25, 2007
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xfer stuff
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@6054
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
4e33ce05
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
55 行增加
和
60 行删除
+55
-60
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+3
-3
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+1
-1
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+39
-53
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+7
-3
switch_ivr_bridge.c
src/switch_ivr_bridge.c
+5
-0
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
4a5d5756
...
...
@@ -312,7 +312,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
}
sofia_glue_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
if
(
sofia_glue_activate_rtp
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
sofia_glue_activate_rtp
(
tech_pvt
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
}
...
...
@@ -804,7 +804,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
a_tech_pvt
->
remote_sdp_audio_port
=
b_tech_pvt
->
remote_sdp_audio_port
;
a_tech_pvt
->
local_sdp_audio_ip
=
switch_core_session_strdup
(
a_session
,
b_tech_pvt
->
local_sdp_audio_ip
);
a_tech_pvt
->
local_sdp_audio_port
=
b_tech_pvt
->
local_sdp_audio_port
;
if
(
sofia_glue_activate_rtp
(
a_tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
sofia_glue_activate_rtp
(
a_tech_pvt
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
}
b_tech_pvt
->
kick
=
switch_core_session_strdup
(
b_session
,
tech_pvt
->
xferto
);
...
...
@@ -912,7 +912,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
return
status
;
}
sofia_glue_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
if
(
sofia_glue_activate_rtp
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
sofia_glue_activate_rtp
(
tech_pvt
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
}
if
(
tech_pvt
->
local_sdp_str
)
{
...
...
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
4a5d5756
...
...
@@ -391,7 +391,7 @@ switch_mutex_unlock(obj->flag_mutex);
/*************************************************************************************************************************************************************/
switch_status_t
sofia_glue_activate_rtp
(
private_object_t
*
tech_pvt
);
switch_status_t
sofia_glue_activate_rtp
(
private_object_t
*
tech_pvt
,
switch_rtp_flag_t
myflags
);
void
sofia_glue_deactivate_rtp
(
private_object_t
*
tech_pvt
);
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
4a5d5756
...
...
@@ -1354,7 +1354,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
sofia_glue_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_REINVITE
);
if
(
sofia_glue_activate_rtp
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
sofia_glue_activate_rtp
(
tech_pvt
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Reinvite RTP Error!
\n
"
);
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
}
...
...
@@ -1374,7 +1374,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
tech_pvt
->
nh
=
tech_pvt
->
nh2
;
tech_pvt
->
nh2
=
NULL
;
if
(
sofia_glue_tech_choose_port
(
tech_pvt
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
sofia_glue_activate_rtp
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
sofia_glue_activate_rtp
(
tech_pvt
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Cheater Reinvite RTP Error!
\n
"
);
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
}
...
...
@@ -1429,7 +1429,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if
(
match
)
{
switch_set_flag_locked
(
tech_pvt
,
TFLAG_ANS
);
if
(
sofia_glue_tech_choose_port
(
tech_pvt
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
sofia_glue_activate_rtp
(
tech_pvt
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
sofia_glue_activate_rtp
(
tech_pvt
,
0
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_channel_mark_answered
(
channel
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"RTP Error!
\n
"
);
...
...
@@ -1571,55 +1571,52 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
br_a
=
switch_channel_get_variable
(
channel_a
,
SWITCH_SIGNAL_BOND_VARIABLE
);
br_b
=
switch_channel_get_variable
(
channel_b
,
SWITCH_SIGNAL_BOND_VARIABLE
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"Attended Transfer [%s][%s]
\n
"
,
br_a
,
br_b
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"Attended Transfer [%s][%s]
\n
"
,
switch_str_nil
(
br_a
),
switch_str_nil
(
br_b
)
);
if
(
br_a
&&
br_b
)
{
switch_ivr_uuid_bridge
(
br_
a
,
br_b
);
switch_ivr_uuid_bridge
(
br_
b
,
br_a
);
switch_channel_set_variable
(
channel_b
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"ATTENDED_TRANSFER"
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_BYE
);
switch_set_flag_locked
(
b_tech_pvt
,
TFLAG_BYE
);
nua_notify
(
tech_pvt
->
nh
,
NUTAG_NEWSUB
(
1
),
SIPTAG_CONTENT_TYPE_STR
(
"message/sipfrag"
),
NUTAG_SUBSTATE
(
nua_substate_terminated
),
SIPTAG_PAYLOAD_STR
(
"SIP/2.0 200 OK"
),
SIPTAG_EVENT_STR
(
etmp
),
TAG_END
());
switch_channel_hangup
(
channel_b
,
SWITCH_CAUSE_ATTENDED_TRANSFER
);
}
else
{
if
(
!
br_a
&&
!
br_b
)
{
switch_set_flag_locked
(
tech_pvt
,
TFLAG_NOHUP
);
switch_set_flag_locked
(
b_tech_pvt
,
TFLAG_XFER
);
b_tech_pvt
->
xferto
=
switch_core_session_strdup
(
b_session
,
switch_core_session_get_uuid
(
session
));
}
else
if
(
!
br_a
&&
br_b
)
{
switch_core_session_t
*
br_b_session
;
if
((
br_b_session
=
switch_core_session_locate
(
br_b
)))
{
private_object_t
*
br_b_tech_pvt
=
switch_core_session_get_private
(
br_b_session
);
switch_channel_t
*
br_b_channel
=
switch_core_session_get_channel
(
br_b_session
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_NOHUP
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_BYE
);
nua_notify
(
tech_pvt
->
nh
,
NUTAG_NEWSUB
(
1
),
SIPTAG_CONTENT_TYPE_STR
(
"message/sipfrag"
),
NUTAG_SUBSTATE
(
nua_substate_terminated
),
SIPTAG_PAYLOAD_STR
(
"SIP/2.0 200 OK"
),
SIPTAG_EVENT_STR
(
etmp
),
TAG_END
());
}
else
{
switch_core_session_t
*
t_session
;
switch_channel_t
*
hup_channel
;
char
*
ext
;
switch_channel_clear_state_handler
(
br_b_channel
,
NULL
);
switch_channel_set_state_flag
(
br_b_channel
,
CF_TRANSFER
);
switch_channel_set_state
(
br_b_channel
,
CS_TRANSMIT
);
if
(
br_a
&&
!
br_b
)
{
t_session
=
switch_core_session_locate
(
br_a
);
hup_channel
=
channel_b
;
}
else
{
t_session
=
switch_core_session_locate
(
br_b
);
hup_channel
=
channel_a
;
switch_channel_hangup
(
channel_b
,
SWITCH_CAUSE_ATTENDED_TRANSFER
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_REINVITE
);
tech_pvt
->
local_sdp_audio_ip
=
switch_core_session_strdup
(
session
,
b_tech_pvt
->
local_sdp_audio_ip
);
tech_pvt
->
local_sdp_audio_port
=
b_tech_pvt
->
local_sdp_audio_port
;
}
tech_pvt
->
remote_sdp_audio_ip
=
switch_core_session_strdup
(
session
,
br_b_tech_pvt
->
remote_sdp_audio_ip
);
tech_pvt
->
remote_sdp_audio_port
=
br_b_tech_pvt
->
remote_sdp_audio_port
;
if
(
sofia_glue_activate_rtp
(
tech_pvt
)
==
SWITCH_STATUS_SUCCESS
)
{
br_b_tech_pvt
->
kick
=
switch_core_session_strdup
(
br_b_session
,
switch_core_session_get_uuid
(
session
));
}
else
{
switch_channel_hangup
(
channel_a
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
}
if
(
t_session
)
{
ext
=
switch_channel_get_variable
(
hup_channel
,
"destination_number"
);
switch_core_session_rwunlock
(
br_b_session
);
switch_ivr_session_transfer
(
t_session
,
ext
,
NULL
,
NULL
);
nua_notify
(
tech_pvt
->
nh
,
NUTAG_NEWSUB
(
1
),
SIPTAG_CONTENT_TYPE_STR
(
"message/sipfrag"
),
NUTAG_SUBSTATE
(
nua_substate_terminated
),
SIPTAG_PAYLOAD_STR
(
"SIP/2.0 200 OK"
),
SIPTAG_EVENT_STR
(
etmp
),
TAG_END
());
switch_core_session_rwunlock
(
t_session
);
switch_channel_hangup
(
hup_channel
,
SWITCH_CAUSE_ATTENDED_TRANSFER
);
}
else
{
nua_notify
(
tech_pvt
->
nh
,
NUTAG_NEWSUB
(
1
),
SIPTAG_CONTENT_TYPE_STR
(
"message/sipfrag"
),
NUTAG_SUBSTATE
(
nua_substate_terminated
),
SIPTAG_PAYLOAD_STR
(
"SIP/2.0 403 Forbidden"
),
SIPTAG_EVENT_STR
(
etmp
),
TAG_END
());
}
switch_channel_hangup
(
channel_b
,
SWITCH_CAUSE_ATTENDED_TRANSFER
);
}
switch_set_flag_locked
(
tech_pvt
,
TFLAG_BYE
);
nua_notify
(
tech_pvt
->
nh
,
NUTAG_NEWSUB
(
1
),
SIPTAG_CONTENT_TYPE_STR
(
"message/sipfrag"
),
NUTAG_SUBSTATE
(
nua_substate_terminated
),
SIPTAG_PAYLOAD_STR
(
"SIP/2.0 200 OK"
),
SIPTAG_EVENT_STR
(
etmp
),
TAG_END
());
}
if
(
b_session
)
{
switch_core_session_rwunlock
(
b_session
);
...
...
@@ -1700,29 +1697,18 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
}
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"BLIND_TRANSFER"
);
/*
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
nua_notify
(
tech_pvt
->
nh
,
NUTAG_NEWSUB
(
1
),
SIPTAG_CONTENT_TYPE_STR
(
"message/sipfrag"
),
NUTAG_SUBSTATE
(
nua_substate_terminated
),
SIPTAG_PAYLOAD_STR
(
"SIP/2.0 200 OK"
),
SIPTAG_EVENT_STR
(
etmp
),
TAG_END
());
*/
}
else
{
exten
=
switch_mprintf
(
"sip:%s@%s:%s"
,
(
char
*
)
refer_to
->
r_url
->
url_user
,
(
char
*
)
refer_to
->
r_url
->
url_host
,
refer_to
->
r_url
->
url_port
);
tech_pvt
->
dest
=
switch_core_session_strdup
(
session
,
exten
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_NOHUP
);
/*
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
NUTAG_SUBSTATE(nua_substate_terminated),
SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK"),
SIPTAG_EVENT_STR(etmp),
TAG_END());
*/
sofia_glue_do_xfer_invite
(
session
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Cannot Blind Transfer 1 Legged calls
\n
"
);
switch_channel_set_variable
(
channel_a
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"ATTENDED_TRANSFER_ERROR"
);
nua_notify
(
tech_pvt
->
nh
,
NUTAG_NEWSUB
(
1
),
SIPTAG_CONTENT_TYPE_STR
(
"message/sipfrag"
),
NUTAG_SUBSTATE
(
nua_substate_terminated
),
SIPTAG_PAYLOAD_STR
(
"SIP/2.0 403 Forbidden"
),
SIPTAG_EVENT_STR
(
etmp
),
TAG_END
());
}
}
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
4a5d5756
...
...
@@ -922,7 +922,7 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
switch_status_t
sofia_glue_activate_rtp
(
private_object_t
*
tech_pvt
)
switch_status_t
sofia_glue_activate_rtp
(
private_object_t
*
tech_pvt
,
switch_rtp_flag_t
myflags
)
{
int
bw
,
ms
;
const
char
*
err
=
NULL
;
...
...
@@ -948,7 +948,11 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt)
bw
=
tech_pvt
->
read_codec
.
implementation
->
bits_per_second
;
ms
=
tech_pvt
->
read_codec
.
implementation
->
microseconds_per_frame
;
flags
=
(
switch_rtp_flag_t
)
(
SWITCH_RTP_FLAG_AUTOADJ
|
SWITCH_RTP_FLAG_DATAWAIT
);
if
(
myflags
)
{
flags
=
myflags
;
}
else
{
flags
=
(
switch_rtp_flag_t
)
(
SWITCH_RTP_FLAG_AUTOADJ
|
SWITCH_RTP_FLAG_DATAWAIT
);
}
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_BUGGY_2833
))
{
flags
|=
SWITCH_RTP_FLAG_BUGGY_2833
;
...
...
@@ -1132,7 +1136,7 @@ switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, char *r_sdp)
if
(
sofia_glue_tech_choose_port
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
return
SWITCH_STATUS_FALSE
;
}
if
(
sofia_glue_activate_rtp
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
sofia_glue_activate_rtp
(
tech_pvt
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
return
SWITCH_STATUS_FALSE
;
}
switch_channel_set_variable
(
tech_pvt
->
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"EARLY MEDIA"
);
...
...
src/switch_ivr_bridge.c
浏览文件 @
4a5d5756
...
...
@@ -298,6 +298,8 @@ static switch_status_t uuid_bridge_on_reset(switch_core_session_t *session)
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"CUSTOM RESET
\n
"
);
switch_channel_clear_flag
(
channel
,
CF_TRANSFER
);
if
(
switch_channel_test_flag
(
channel
,
CF_ORIGINATOR
))
{
switch_channel_set_state
(
channel
,
CS_TRANSMIT
);
}
...
...
@@ -708,6 +710,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(char *originator_uuid, ch
switch_channel_set_flag
(
originator_channel
,
CF_BREAK
);
switch_channel_set_flag
(
originatee_channel
,
CF_BREAK
);
switch_channel_set_flag
(
originator_channel
,
CF_TRANSFER
);
switch_channel_set_flag
(
originatee_channel
,
CF_TRANSFER
);
/* change the states and let the chips fall where they may */
switch_channel_set_state
(
originator_channel
,
CS_RESET
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论