Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
25604d60
提交
25604d60
authored
6月 15, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-3326 revert
68c389df
上级
a20a3f34
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
21 行增加
和
149 行删除
+21
-149
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+3
-75
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+11
-62
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+6
-11
switch_ivr_originate.c
src/switch_ivr_originate.c
+1
-1
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
25604d60
...
@@ -575,31 +575,9 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
...
@@ -575,31 +575,9 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
const
char
*
val
;
const
char
*
val
;
const
char
*
b_sdp
=
NULL
;
const
char
*
b_sdp
=
NULL
;
int
is_proxy
=
0
;
int
is_proxy
=
0
;
int
is_3pcc
=
0
;
char
*
sticky
=
NULL
;
char
*
sticky
=
NULL
;
const
char
*
call_info
=
switch_channel_get_variable
(
channel
,
"presence_call_info_full"
);
const
char
*
call_info
=
switch_channel_get_variable
(
channel
,
"presence_call_info_full"
);
if
(
sofia_test_flag
(
tech_pvt
,
TFLAG_3PCC_INVITE
))
{
// SNARK: complete hack to get final ack sent when a 3pcc invite has been passed from the other leg in bypass_media mode.
// This code handles the pass_indication sent after the 3pcc ack is received by the other leg in the is_3pcc && is_proxy case below.
// Is there a better place to hang this...?
b_sdp
=
switch_channel_get_variable
(
channel
,
SWITCH_B_SDP_VARIABLE
);
sofia_glue_tech_set_local_sdp
(
tech_pvt
,
b_sdp
,
SWITCH_TRUE
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"3PCC-PROXY nomedia - sending ack
\n
"
);
nua_ack
(
tech_pvt
->
nh
,
TAG_IF
(
!
zstr
(
tech_pvt
->
user_via
),
SIPTAG_VIA_STR
(
tech_pvt
->
user_via
)),
SIPTAG_CONTACT_STR
(
tech_pvt
->
reply_contact
),
SOATAG_USER_SDP_STR
(
tech_pvt
->
local_sdp_str
),
SOATAG_REUSE_REJECTED
(
1
),
SOATAG_RTP_SELECT
(
1
),
SOATAG_ORDERED_USER
(
1
),
SOATAG_AUDIO_AUX
(
"cn telephone-event"
),
TAG_IF
(
sofia_test_pflag
(
tech_pvt
->
profile
,
PFLAG_DISABLE_100REL
),
NUTAG_INCLUDE_EXTRA_SDP
(
1
)),
TAG_END
());
sofia_clear_flag
(
tech_pvt
,
TFLAG_3PCC_INVITE
);
// all done
return
SWITCH_STATUS_SUCCESS
;
}
if
(
sofia_test_flag
(
tech_pvt
,
TFLAG_ANS
)
||
switch_channel_direction
(
channel
)
==
SWITCH_CALL_DIRECTION_OUTBOUND
)
{
if
(
sofia_test_flag
(
tech_pvt
,
TFLAG_ANS
)
||
switch_channel_direction
(
channel
)
==
SWITCH_CALL_DIRECTION_OUTBOUND
)
{
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
@@ -607,9 +585,8 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
...
@@ -607,9 +585,8 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
b_sdp
=
switch_channel_get_variable
(
channel
,
SWITCH_B_SDP_VARIABLE
);
b_sdp
=
switch_channel_get_variable
(
channel
,
SWITCH_B_SDP_VARIABLE
);
is_proxy
=
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MODE
)
||
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
));
is_proxy
=
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MODE
)
||
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
));
is_3pcc
=
(
sofia_test_pflag
(
tech_pvt
->
profile
,
PFLAG_3PCC_PROXY
)
&&
sofia_test_flag
(
tech_pvt
,
TFLAG_3PCC
));
if
(
b_sdp
&&
is_proxy
&&
!
is_3pcc
)
{
if
(
b_sdp
&&
is_proxy
)
{
sofia_glue_tech_set_local_sdp
(
tech_pvt
,
b_sdp
,
SWITCH_TRUE
);
sofia_glue_tech_set_local_sdp
(
tech_pvt
,
b_sdp
,
SWITCH_TRUE
);
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
{
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
{
...
@@ -620,35 +597,23 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
...
@@ -620,35 +597,23 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
}
}
}
else
{
}
else
{
/* This if statement check and handles the 3pcc proxy mode */
/* This if statement check and handles the 3pcc proxy mode */
if
(
is_3pcc
)
{
if
(
sofia_test_pflag
(
tech_pvt
->
profile
,
PFLAG_3PCC_PROXY
)
&&
sofia_test_flag
(
tech_pvt
,
TFLAG_3PCC
)
)
{
if
(
!
is_proxy
)
{
tech_pvt
->
num_codecs
=
0
;
tech_pvt
->
num_codecs
=
0
;
sofia_glue_tech_prepare_codecs
(
tech_pvt
);
sofia_glue_tech_prepare_codecs
(
tech_pvt
);
tech_pvt
->
local_sdp_str
=
NULL
;
tech_pvt
->
local_sdp_str
=
NULL
;
sofia_glue_tech_choose_port
(
tech_pvt
,
0
);
sofia_glue_tech_choose_port
(
tech_pvt
,
0
);
sofia_glue_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
sofia_glue_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
}
else
{
sofia_glue_tech_set_local_sdp
(
tech_pvt
,
b_sdp
,
SWITCH_TRUE
);
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
{
sofia_glue_tech_patch_sdp
(
tech_pvt
);
if
(
sofia_glue_activate_rtp
(
tech_pvt
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
return
SWITCH_STATUS_FALSE
;
}
}
}
/* Send the 200 OK */
/* Send the 200 OK */
if
(
!
sofia_test_flag
(
tech_pvt
,
TFLAG_BYE
))
{
if
(
!
sofia_test_flag
(
tech_pvt
,
TFLAG_BYE
))
{
char
*
extra_headers
=
sofia_glue_get_extra_headers
(
channel
,
SOFIA_SIP_RESPONSE_HEADER_PREFIX
);
char
*
extra_headers
=
sofia_glue_get_extra_headers
(
channel
,
SOFIA_SIP_RESPONSE_HEADER_PREFIX
);
if
(
sofia_use_soa
(
tech_pvt
))
{
if
(
sofia_use_soa
(
tech_pvt
))
{
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
TAG_IF
(
is_proxy
,
NUTAG_AUTOANSWER
(
0
)),
SIPTAG_CONTACT_STR
(
tech_pvt
->
profile
->
url
),
SIPTAG_CONTACT_STR
(
tech_pvt
->
profile
->
url
),
SOATAG_USER_SDP_STR
(
tech_pvt
->
local_sdp_str
),
SOATAG_USER_SDP_STR
(
tech_pvt
->
local_sdp_str
),
TAG_IF
(
call_info
,
SIPTAG_CALL_INFO_STR
(
call_info
)),
TAG_IF
(
call_info
,
SIPTAG_CALL_INFO_STR
(
call_info
)),
SOATAG_REUSE_REJECTED
(
1
),
TAG_IF
(
is_proxy
,
SOATAG_RTP_SELECT
(
1
)),
SOATAG_REUSE_REJECTED
(
1
),
SOATAG_ORDERED_USER
(
1
),
SOATAG_AUDIO_AUX
(
"cn telephone-event"
),
NUTAG_INCLUDE_EXTRA_SDP
(
1
),
SOATAG_ORDERED_USER
(
1
),
SOATAG_AUDIO_AUX
(
"cn telephone-event"
),
NUTAG_INCLUDE_EXTRA_SDP
(
1
),
TAG_IF
(
!
zstr
(
extra_headers
),
SIPTAG_HEADER_STR
(
extra_headers
)),
TAG_IF
(
!
zstr
(
extra_headers
),
SIPTAG_HEADER_STR
(
extra_headers
)),
TAG_IF
(
switch_stristr
(
"update_display"
,
tech_pvt
->
x_freeswitch_support_remote
),
TAG_IF
(
switch_stristr
(
"update_display"
,
tech_pvt
->
x_freeswitch_support_remote
),
...
@@ -680,14 +645,6 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
...
@@ -680,14 +645,6 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
/* Regain lock on sofia */
/* Regain lock on sofia */
switch_mutex_lock
(
tech_pvt
->
sofia_mutex
);
switch_mutex_lock
(
tech_pvt
->
sofia_mutex
);
if
(
is_proxy
)
{
sofia_clear_flag
(
tech_pvt
,
TFLAG_3PCC_HAS_ACK
);
sofia_clear_flag
(
tech_pvt
,
TFLAG_3PCC
);
// This sends the message to the other leg that causes it to call the TFLAG_3PCC_INVITE code at the start of this function.
// Is there another message it would be better to hang this on though?
switch_core_session_pass_indication
(
session
,
SWITCH_MESSAGE_INDICATE_ANSWER
);
}
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"3PCC-PROXY, Done waiting for ACK
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"3PCC-PROXY, Done waiting for ACK
\n
"
);
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
@@ -1734,10 +1691,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
...
@@ -1734,10 +1691,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch_channel_get_name
(
channel
),
msg
->
string_arg
);
switch_channel_get_name
(
channel
),
msg
->
string_arg
);
sofia_glue_tech_set_local_sdp
(
tech_pvt
,
msg
->
string_arg
,
SWITCH_TRUE
);
sofia_glue_tech_set_local_sdp
(
tech_pvt
,
msg
->
string_arg
,
SWITCH_TRUE
);
if
(
zstr
(
tech_pvt
->
local_sdp_str
))
{
sofia_set_flag
(
tech_pvt
,
TFLAG_3PCC_INVITE
);
}
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_SENT_UPDATE
);
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_SENT_UPDATE
);
switch_channel_set_flag
(
channel
,
CF_REQ_MEDIA
);
switch_channel_set_flag
(
channel
,
CF_REQ_MEDIA
);
sofia_glue_do_invite
(
session
);
sofia_glue_do_invite
(
session
);
...
@@ -2236,23 +2189,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
...
@@ -2236,23 +2189,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
SIPTAG_PAYLOAD_STR
(
tech_pvt
->
local_sdp_str
),
SIPTAG_PAYLOAD_STR
(
tech_pvt
->
local_sdp_str
),
TAG_IF
(
!
zstr
(
extra_headers
),
SIPTAG_HEADER_STR
(
extra_headers
)),
TAG_END
());
TAG_IF
(
!
zstr
(
extra_headers
),
SIPTAG_HEADER_STR
(
extra_headers
)),
TAG_END
());
}
}
if
(
sofia_test_pflag
(
tech_pvt
->
profile
,
PFLAG_3PCC_PROXY
)
&&
sofia_test_flag
(
tech_pvt
,
TFLAG_3PCC
))
{
/* Unlock the session signal to allow the ack to make it in */
// Maybe we should timeout?
switch_mutex_unlock
(
tech_pvt
->
sofia_mutex
);
while
(
switch_channel_ready
(
channel
)
&&
!
sofia_test_flag
(
tech_pvt
,
TFLAG_3PCC_HAS_ACK
))
{
switch_cond_next
();
}
/* Regain lock on sofia */
switch_mutex_lock
(
tech_pvt
->
sofia_mutex
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"3PCC-PROXY, Done waiting for ACK
\n
"
);
sofia_clear_flag
(
tech_pvt
,
TFLAG_3PCC
);
sofia_clear_flag
(
tech_pvt
,
TFLAG_3PCC_HAS_ACK
);
switch_core_session_pass_indication
(
session
,
SWITCH_MESSAGE_INDICATE_ANSWER
);
}
}
else
{
}
else
{
nua_respond
(
tech_pvt
->
nh
,
code
,
su_strdup
(
nua_handle_home
(
tech_pvt
->
nh
),
reason
),
SIPTAG_CONTACT_STR
(
tech_pvt
->
reply_contact
),
nua_respond
(
tech_pvt
->
nh
,
code
,
su_strdup
(
nua_handle_home
(
tech_pvt
->
nh
),
reason
),
SIPTAG_CONTACT_STR
(
tech_pvt
->
reply_contact
),
TAG_IF
(
!
zstr
(
extra_headers
),
SIPTAG_HEADER_STR
(
extra_headers
)),
TAG_END
());
TAG_IF
(
!
zstr
(
extra_headers
),
SIPTAG_HEADER_STR
(
extra_headers
)),
TAG_END
());
...
@@ -4461,14 +4397,6 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
...
@@ -4461,14 +4397,6 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
}
else
{
}
else
{
sofia_clear_flag
(
ctech_pvt
,
TFLAG_ENABLE_SOA
);
sofia_clear_flag
(
ctech_pvt
,
TFLAG_ENABLE_SOA
);
}
}
/* SNARK: lets copy this across so we can see if we're the other leg of 3PCC + bypass_media... */
if
(
sofia_test_flag
(
ctech_pvt
,
TFLAG_3PCC
)
&&
(
switch_channel_test_flag
(
o_channel
,
CF_PROXY_MODE
)
||
switch_channel_test_flag
(
o_channel
,
CF_PROXY_MEDIA
)))
{
sofia_set_flag
(
tech_pvt
,
TFLAG_3PCC_INVITE
);
sofia_set_flag
(
tech_pvt
,
TFLAG_LATE_NEGOTIATION
);
}
else
{
sofia_clear_flag
(
tech_pvt
,
TFLAG_3PCC_INVITE
);
}
}
}
if
(
switch_channel_test_flag
(
o_channel
,
CF_PROXY_MEDIA
))
{
if
(
switch_channel_test_flag
(
o_channel
,
CF_PROXY_MEDIA
))
{
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
25604d60
...
@@ -4547,9 +4547,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
...
@@ -4547,9 +4547,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
}
}
}
}
/* SNARK: message to respond to reinvite wasn't being delivered in 3pcc+bypass media case. */
switch_core_session_queue_message
(
other_session
,
msg
);
//switch_core_session_queue_message(other_session, msg);
switch_core_session_receive_message
(
other_session
,
msg
);
switch_core_session_rwunlock
(
other_session
);
switch_core_session_rwunlock
(
other_session
);
}
}
...
@@ -5054,12 +5052,10 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
...
@@ -5054,12 +5052,10 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_INCOMPATIBLE_DESTINATION
);
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_INCOMPATIBLE_DESTINATION
);
}
}
}
else
{
}
else
{
if
(
sofia_test_pflag
(
profile
,
PFLAG_3PCC
))
{
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MODE
)
||
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
{
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MODE
)
||
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_INFO
,
"No SDP in INVITE and 3pcc=yes cannot work with bypass or proxy media, hanging up.
\n
"
);
goto
done
;
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"3PCC DISABLED"
);
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_MANDATORY_IE_MISSING
);
}
else
{
}
else
{
if
(
sofia_test_pflag
(
profile
,
PFLAG_3PCC
))
{
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"RECEIVED_NOSDP"
);
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"RECEIVED_NOSDP"
);
sofia_glue_tech_choose_port
(
tech_pvt
,
0
);
sofia_glue_tech_choose_port
(
tech_pvt
,
0
);
sofia_glue_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
sofia_glue_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
...
@@ -5078,10 +5074,8 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
...
@@ -5078,10 +5074,8 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
SIPTAG_CONTACT_STR
(
tech_pvt
->
profile
->
url
),
SIPTAG_CONTACT_STR
(
tech_pvt
->
profile
->
url
),
SIPTAG_CONTENT_TYPE_STR
(
"application/sdp"
),
SIPTAG_PAYLOAD_STR
(
tech_pvt
->
local_sdp_str
),
TAG_END
());
SIPTAG_CONTENT_TYPE_STR
(
"application/sdp"
),
SIPTAG_PAYLOAD_STR
(
tech_pvt
->
local_sdp_str
),
TAG_END
());
}
}
}
}
else
if
(
sofia_test_pflag
(
profile
,
PFLAG_3PCC_PROXY
))
{
}
else
if
(
sofia_test_pflag
(
profile
,
PFLAG_3PCC_PROXY
))
{
//3PCC proxy mode delays the 200 OK until the call is answered
//3PCC proxy mode delays the 200 OK until the call is answered
// so can be made to work with bypass media as we have time to find out what the other end thinks codec offer should be...
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"RECEIVED_NOSDP"
);
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"RECEIVED_NOSDP"
);
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_3PCC
);
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_3PCC
);
//sofia_glue_tech_choose_port(tech_pvt, 0);
//sofia_glue_tech_choose_port(tech_pvt, 0);
...
@@ -5096,29 +5090,11 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
...
@@ -5096,29 +5090,11 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
}
goto
done
;
goto
done
;
}
}
}
}
else
if
(
tech_pvt
&&
sofia_test_flag
(
tech_pvt
,
TFLAG_SDP
)
&&
!
r_sdp
)
{
}
else
if
(
tech_pvt
&&
sofia_test_flag
(
tech_pvt
,
TFLAG_SDP
)
&&
!
r_sdp
)
{
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_NOSDP_REINVITE
);
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MODE
)
||
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
{
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_3PCC
);
if
((
uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
))
&&
(
other_session
=
switch_core_session_locate
(
uuid
)))
{
switch_core_session_message_t
*
msg
;
msg
=
switch_core_session_alloc
(
other_session
,
sizeof
(
*
msg
));
msg
->
message_id
=
SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT
;
msg
->
from
=
__FILE__
;
msg
->
string_arg
=
NULL
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Passing NOSDP to other leg.
\n
"
);
switch_core_session_queue_message
(
other_session
,
msg
);
switch_core_session_rwunlock
(
other_session
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_WARNING
,
"NOSDP Re-INVITE to a proxy mode channel that is not in a bridge.
\n
"
);
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
}
goto
done
;
}
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
TAG_END
());
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
TAG_END
());
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_NOSDP_REINVITE
);
goto
done
;
goto
done
;
}
else
{
}
else
{
ss_state
=
nua_callstate_completed
;
ss_state
=
nua_callstate_completed
;
...
@@ -5130,10 +5106,12 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
...
@@ -5130,10 +5106,12 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
break
;
break
;
case
nua_callstate_completed
:
case
nua_callstate_completed
:
if
(
r_sdp
)
{
if
(
r_sdp
)
{
const
char
*
var
;
uint8_t
match
=
0
,
is_ok
=
1
,
is_t38
=
0
;
uint8_t
match
=
0
,
is_ok
=
1
,
is_t38
=
0
;
tech_pvt
->
hold_laps
=
0
;
tech_pvt
->
hold_laps
=
0
;
if
(
r_sdp
)
{
const
char
*
var
;
if
((
var
=
switch_channel_get_variable
(
channel
,
"sip_ignore_reinvites"
))
&&
switch_true
(
var
))
{
if
((
var
=
switch_channel_get_variable
(
channel
,
"sip_ignore_reinvites"
))
&&
switch_true
(
var
))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Ignoring Re-invite
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Ignoring Re-invite
\n
"
);
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
TAG_END
());
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
TAG_END
());
...
@@ -5295,6 +5273,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
...
@@ -5295,6 +5273,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
nua_respond
(
tech_pvt
->
nh
,
SIP_488_NOT_ACCEPTABLE
,
TAG_END
());
nua_respond
(
tech_pvt
->
nh
,
SIP_488_NOT_ACCEPTABLE
,
TAG_END
());
}
}
}
}
}
break
;
break
;
case
nua_callstate_ready
:
case
nua_callstate_ready
:
if
(
r_sdp
&&
!
is_dup_sdp
&&
switch_rtp_ready
(
tech_pvt
->
rtp_session
))
{
if
(
r_sdp
&&
!
is_dup_sdp
&&
switch_rtp_ready
(
tech_pvt
->
rtp_session
))
{
...
@@ -5327,34 +5306,10 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
...
@@ -5327,34 +5306,10 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
}
if
(
r_sdp
&&
sofia_test_flag
(
tech_pvt
,
TFLAG_NOSDP_REINVITE
))
{
if
(
r_sdp
&&
sofia_test_flag
(
tech_pvt
,
TFLAG_NOSDP_REINVITE
))
{
sofia_clear_flag_locked
(
tech_pvt
,
TFLAG_NOSDP_REINVITE
);
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MODE
)
||
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
{
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
{
if
(
sofia_glue_activate_rtp
(
tech_pvt
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
goto
done
;
}
}
if
((
uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_SIGNAL_BOND_VARIABLE
))
&&
(
other_session
=
switch_core_session_locate
(
uuid
)))
{
other_channel
=
switch_core_session_get_channel
(
other_session
);
if
(
!
switch_channel_get_variable
(
other_channel
,
SWITCH_B_SDP_VARIABLE
))
{
switch_channel_set_variable
(
other_channel
,
SWITCH_B_SDP_VARIABLE
,
r_sdp
);
}
if
(
sofia_test_flag
(
tech_pvt
,
TFLAG_3PCC
)
&&
sofia_test_pflag
(
profile
,
PFLAG_3PCC_PROXY
))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"3PCC-PROXY, Got my ACK
\n
"
);
sofia_set_flag
(
tech_pvt
,
TFLAG_3PCC_HAS_ACK
);
}
else
{
switch_core_session_queue_indication
(
other_session
,
SWITCH_MESSAGE_INDICATE_ANSWER
);
}
switch_core_session_rwunlock
(
other_session
);
}
}
else
{
uint8_t
match
=
0
;
uint8_t
match
=
0
;
int
is_ok
=
1
;
int
is_ok
=
1
;
sofia_clear_flag_locked
(
tech_pvt
,
TFLAG_NOSDP_REINVITE
);
if
(
tech_pvt
->
num_codecs
)
{
if
(
tech_pvt
->
num_codecs
)
{
match
=
sofia_glue_negotiate_sdp
(
session
,
r_sdp
);
match
=
sofia_glue_negotiate_sdp
(
session
,
r_sdp
);
...
@@ -5377,7 +5332,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
...
@@ -5377,7 +5332,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
nua_respond
(
nh
,
SIP_488_NOT_ACCEPTABLE
,
TAG_END
());
nua_respond
(
nh
,
SIP_488_NOT_ACCEPTABLE
,
TAG_END
());
switch_channel_hangup
(
tech_pvt
->
channel
,
SWITCH_CAUSE_INCOMPATIBLE_DESTINATION
);
switch_channel_hangup
(
tech_pvt
->
channel
,
SWITCH_CAUSE_INCOMPATIBLE_DESTINATION
);
}
}
}
goto
done
;
goto
done
;
}
}
...
@@ -5444,12 +5399,6 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
...
@@ -5444,12 +5399,6 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
switch_core_session_rwunlock
(
other_session
);
switch_core_session_rwunlock
(
other_session
);
}
}
if
(
sofia_test_flag
(
tech_pvt
,
TFLAG_3PCC
)
&&
sofia_test_pflag
(
profile
,
PFLAG_3PCC_PROXY
))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"3PCC-PROXY, Got my ACK
\n
"
);
sofia_set_flag
(
tech_pvt
,
TFLAG_3PCC_HAS_ACK
);
}
goto
done
;
goto
done
;
}
else
{
}
else
{
uint8_t
match
=
0
;
uint8_t
match
=
0
;
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
25604d60
...
@@ -2396,7 +2396,6 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
...
@@ -2396,7 +2396,6 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
if
(
sofia_use_soa
(
tech_pvt
))
{
if
(
sofia_use_soa
(
tech_pvt
))
{
nua_invite
(
tech_pvt
->
nh
,
nua_invite
(
tech_pvt
->
nh
,
NUTAG_AUTOANSWER
(
0
),
NUTAG_AUTOANSWER
(
0
),
NUTAG_AUTOACK
(
0
),
NUTAG_SESSION_TIMER
(
session_timeout
),
NUTAG_SESSION_TIMER
(
session_timeout
),
NUTAG_SESSION_REFRESHER
(
session_timeout
?
nua_local_refresher
:
nua_no_refresher
),
NUTAG_SESSION_REFRESHER
(
session_timeout
?
nua_local_refresher
:
nua_no_refresher
),
TAG_IF
(
sofia_test_flag
(
tech_pvt
,
TFLAG_RECOVERED
),
NUTAG_INVITE_TIMER
(
UINT_MAX
)),
TAG_IF
(
sofia_test_flag
(
tech_pvt
,
TFLAG_RECOVERED
),
NUTAG_INVITE_TIMER
(
UINT_MAX
)),
...
@@ -2418,19 +2417,15 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
...
@@ -2418,19 +2417,15 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
TAG_IF
(
!
zstr
(
route
),
SIPTAG_ROUTE_STR
(
route
)),
TAG_IF
(
!
zstr
(
route
),
SIPTAG_ROUTE_STR
(
route
)),
TAG_IF
(
tech_pvt
->
profile
->
minimum_session_expires
,
NUTAG_MIN_SE
(
tech_pvt
->
profile
->
minimum_session_expires
)),
TAG_IF
(
tech_pvt
->
profile
->
minimum_session_expires
,
NUTAG_MIN_SE
(
tech_pvt
->
profile
->
minimum_session_expires
)),
TAG_IF
(
cseq
,
SIPTAG_CSEQ
(
cseq
)),
TAG_IF
(
cseq
,
SIPTAG_CSEQ
(
cseq
)),
TAG_IF
(
zstr
(
tech_pvt
->
local_sdp_str
),
SIPTAG_PAYLOAD_STR
(
""
)),
SOATAG_ADDRESS
(
tech_pvt
->
adv_sdp_audio_ip
),
TAG_IF
(
!
zstr
(
tech_pvt
->
local_sdp_str
),
SOATAG_ADDRESS
(
tech_pvt
->
adv_sdp_audio_ip
)),
SOATAG_USER_SDP_STR
(
tech_pvt
->
local_sdp_str
),
TAG_IF
(
!
zstr
(
tech_pvt
->
local_sdp_str
),
SOATAG_USER_SDP_STR
(
tech_pvt
->
local_sdp_str
)),
SOATAG_REUSE_REJECTED
(
1
),
TAG_IF
(
!
zstr
(
tech_pvt
->
local_sdp_str
),
SOATAG_REUSE_REJECTED
(
1
)),
SOATAG_ORDERED_USER
(
1
),
TAG_IF
(
!
zstr
(
tech_pvt
->
local_sdp_str
),
SOATAG_ORDERED_USER
(
1
)),
SOATAG_RTP_SORT
(
SOA_RTP_SORT_REMOTE
),
TAG_IF
(
!
zstr
(
tech_pvt
->
local_sdp_str
),
SOATAG_RTP_SORT
(
SOA_RTP_SORT_REMOTE
)),
SOATAG_RTP_SELECT
(
SOA_RTP_SELECT_ALL
),
TAG_IF
(
rep
,
SIPTAG_REPLACES_STR
(
rep
)),
SOATAG_HOLD
(
holdstr
),
TAG_END
());
TAG_IF
(
!
zstr
(
tech_pvt
->
local_sdp_str
),
SOATAG_RTP_SELECT
(
SOA_RTP_SELECT_ALL
)),
TAG_IF
(
rep
,
SIPTAG_REPLACES_STR
(
rep
)),
TAG_IF
(
!
zstr
(
tech_pvt
->
local_sdp_str
),
SOATAG_HOLD
(
holdstr
)),
TAG_END
());
}
else
{
}
else
{
nua_invite
(
tech_pvt
->
nh
,
nua_invite
(
tech_pvt
->
nh
,
NUTAG_AUTOANSWER
(
0
),
NUTAG_AUTOANSWER
(
0
),
NUTAG_AUTOACK
(
0
),
NUTAG_SESSION_TIMER
(
session_timeout
),
NUTAG_SESSION_TIMER
(
session_timeout
),
TAG_IF
(
session_timeout
,
NUTAG_SESSION_REFRESHER
(
nua_remote_refresher
)),
TAG_IF
(
session_timeout
,
NUTAG_SESSION_REFRESHER
(
nua_remote_refresher
)),
TAG_IF
(
sofia_test_flag
(
tech_pvt
,
TFLAG_RECOVERED
),
NUTAG_INVITE_TIMER
(
UINT_MAX
)),
TAG_IF
(
sofia_test_flag
(
tech_pvt
,
TFLAG_RECOVERED
),
NUTAG_INVITE_TIMER
(
UINT_MAX
)),
...
...
src/switch_ivr_originate.c
浏览文件 @
25604d60
...
@@ -2934,7 +2934,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
...
@@ -2934,7 +2934,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
oglobals
.
idx
=
IDX_CANCEL
;
oglobals
.
idx
=
IDX_CANCEL
;
}
}
if
(
oglobals
.
session
&&
(
ringback_data
||
!
(
switch_channel_test_flag
(
caller_channel
,
CF_PROXY_MODE
)
||
if
(
oglobals
.
session
&&
(
ringback_data
||
!
(
switch_channel_test_flag
(
caller_channel
,
CF_PROXY_MODE
)
&&
switch_channel_test_flag
(
caller_channel
,
CF_PROXY_MEDIA
))))
{
switch_channel_test_flag
(
caller_channel
,
CF_PROXY_MEDIA
))))
{
switch_core_session_reset
(
oglobals
.
session
,
SWITCH_FALSE
,
SWITCH_TRUE
);
switch_core_session_reset
(
oglobals
.
session
,
SWITCH_FALSE
,
SWITCH_TRUE
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论