Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
0fffc839
提交
0fffc839
authored
12月 22, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pass1
上级
3c51053b
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
198 行增加
和
898 行删除
+198
-898
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+133
-833
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+1
-1
rtp.c
src/mod/endpoints/mod_sofia/rtp.c
+1
-1
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+23
-23
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+34
-34
sofia_media.c
src/mod/endpoints/mod_sofia/sofia_media.c
+6
-6
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
0fffc839
差异被折叠。
点击展开。
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
0fffc839
...
...
@@ -573,7 +573,7 @@ struct sofia_profile {
switch_core_media_flag_t
media_flags
[
SCMF_MAX
];
unsigned
int
mflags
;
unsigned
int
ndlb
;
unsigned
int
mdlb
;
unsigned
int
m
n
dlb
;
uint32_t
max_calls
;
uint32_t
nonce_ttl
;
nua_t
*
nua
;
...
...
src/mod/endpoints/mod_sofia/rtp.c
浏览文件 @
0fffc839
...
...
@@ -200,7 +200,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
tech_pvt
->
local_address
=
switch_core_session_strdup
(
*
new_session
,
local_addr
);
tech_pvt
->
local_port
=
local_port
;
tech_pvt
->
remote_address
=
switch_core_session_strdup
(
*
new_session
,
remote_addr
);
tech
_pvt
->
remote_port
=
remote_port
;
tech
-
pvt
->
mparams
->
remote_port
=
remote_port
;
tech_pvt
->
ptime
=
ptime
;
tech_pvt
->
agreed_pt
=
pt
;
tech_pvt
->
dtmf_type
=
DTMF_2833
;
/* XXX */
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
0fffc839
...
...
@@ -4861,9 +4861,9 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
caller_profile
->
network_addr
=
switch_core_strdup
(
caller_profile
->
pool
,
network_ip
);
}
tech
_pvt
->
last_sdp_str
=
NULL
;
tech
-
pvt
->
mparams
->
last_sdp_str
=
NULL
;
if
(
!
sofia_use_soa
(
tech_pvt
)
&&
sip
->
sip_payload
&&
sip
->
sip_payload
->
pl_data
)
{
tech
_pvt
->
last_sdp_str
=
switch_core_session_strdup
(
session
,
sip
->
sip_payload
->
pl_data
);
tech
-
pvt
->
mparams
->
last_sdp_str
=
switch_core_session_strdup
(
session
,
sip
->
sip_payload
->
pl_data
);
}
...
...
@@ -5200,8 +5200,8 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
if
(
sip
->
sip_payload
&&
sip
->
sip_payload
->
pl_data
&&
sip
->
sip_content_type
&&
sip
->
sip_content_type
->
c_subtype
&&
switch_stristr
(
"sdp"
,
sip
->
sip_content_type
->
c_subtype
))
{
tech
_pvt
->
remote_sdp_str
=
switch_core_session_strdup
(
tech_pvt
->
session
,
sip
->
sip_payload
->
pl_data
);
r_sdp
=
tech
_pvt
->
remote_sdp_str
;
tech
-
pvt
->
mparams
->
remote_sdp_str
=
switch_core_session_strdup
(
tech_pvt
->
session
,
sip
->
sip_payload
->
pl_data
);
r_sdp
=
tech
-
pvt
->
mparams
->
remote_sdp_str
;
sofia_glue_tech_proxy_remote_addr
(
tech_pvt
,
NULL
);
}
...
...
@@ -5543,8 +5543,8 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
}
if
(
status
>
100
&&
status
<
300
&&
tech_pvt
&&
!
sofia_use_soa
(
tech_pvt
)
&&
!
r_sdp
&&
tech
_pvt
->
last_sdp_str
)
{
r_sdp
=
tech
_pvt
->
last_sdp_str
;
if
(
status
>
100
&&
status
<
300
&&
tech_pvt
&&
!
sofia_use_soa
(
tech_pvt
)
&&
!
r_sdp
&&
tech
-
pvt
->
mparams
->
last_sdp_str
)
{
r_sdp
=
tech
-
pvt
->
mparams
->
last_sdp_str
;
}
if
((
channel
&&
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MODE
)
||
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
)))
||
...
...
@@ -5599,12 +5599,12 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if
(
r_sdp
)
{
if
(
!
(
profile
->
mndlb
&
SM_NDLB_ALLOW_NONDUP_SDP
)
||
(
!
zstr
(
tech
_pvt
->
remote_sdp_str
)
&&
!
strcmp
(
tech_pvt
->
remote_sdp_str
,
r_sdp
)))
{
if
(
!
(
profile
->
mndlb
&
SM_NDLB_ALLOW_NONDUP_SDP
)
||
(
!
zstr
(
tech
-
pvt
->
mparams
->
remote_sdp_str
)
&&
!
strcmp
(
tech
-
pvt
->
mparams
->
remote_sdp_str
,
r_sdp
)))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Duplicate SDP
\n
%s
\n
"
,
r_sdp
);
is_dup_sdp
=
1
;
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Remote SDP:
\n
%s
\n
"
,
r_sdp
);
tech
_pvt
->
remote_sdp_str
=
switch_core_session_strdup
(
session
,
r_sdp
);
tech
-
pvt
->
mparams
->
remote_sdp_str
=
switch_core_session_strdup
(
session
,
r_sdp
);
switch_channel_set_variable
(
channel
,
SWITCH_R_SDP_VARIABLE
,
r_sdp
);
if
((
sofia_test_flag
(
tech_pvt
,
TFLAG_LATE_NEGOTIATION
)
||
switch_channel_direction
(
channel
)
==
SWITCH_CALL_DIRECTION_OUTBOUND
))
{
...
...
@@ -5909,7 +5909,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if
(
sofia_use_soa
(
tech_pvt
))
{
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
SIPTAG_CONTACT_STR
(
tech_pvt
->
profile
->
url
),
SOATAG_USER_SDP_STR
(
tech
_pvt
->
local_sdp_str
),
SOATAG_USER_SDP_STR
(
tech
-
pvt
->
mparams
->
local_sdp_str
),
SOATAG_REUSE_REJECTED
(
1
),
SOATAG_ORDERED_USER
(
1
),
SOATAG_AUDIO_AUX
(
"cn telephone-event"
),
TAG_IF
(
sofia_test_pflag
(
profile
,
PFLAG_DISABLE_100REL
),
NUTAG_INCLUDE_EXTRA_SDP
(
1
)),
TAG_END
());
...
...
@@ -5917,7 +5917,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
NUTAG_MEDIA_ENABLE
(
0
),
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
->
mparams
->
local_sdp_str
),
TAG_END
());
}
}
}
else
if
(
sofia_test_pflag
(
profile
,
PFLAG_3PCC_PROXY
))
{
...
...
@@ -6025,7 +6025,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if
(
sofia_use_soa
(
tech_pvt
))
{
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
SIPTAG_CONTACT_STR
(
tech_pvt
->
reply_contact
),
SOATAG_USER_SDP_STR
(
tech
_pvt
->
local_sdp_str
),
SOATAG_USER_SDP_STR
(
tech
-
pvt
->
mparams
->
local_sdp_str
),
SOATAG_REUSE_REJECTED
(
1
),
SOATAG_ORDERED_USER
(
1
),
SOATAG_AUDIO_AUX
(
"cn telephone-event"
),
TAG_IF
(
sofia_test_pflag
(
profile
,
PFLAG_DISABLE_100REL
),
NUTAG_INCLUDE_EXTRA_SDP
(
1
)),
TAG_END
());
...
...
@@ -6033,7 +6033,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
NUTAG_MEDIA_ENABLE
(
0
),
SIPTAG_CONTACT_STR
(
tech_pvt
->
reply_contact
),
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
->
mparams
->
local_sdp_str
),
TAG_END
());
}
switch_channel_set_flag
(
channel
,
CF_PROXY_MODE
);
...
...
@@ -6150,7 +6150,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if
(
sofia_use_soa
(
tech_pvt
))
{
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
SIPTAG_CONTACT_STR
(
tech_pvt
->
reply_contact
),
SOATAG_USER_SDP_STR
(
tech
_pvt
->
local_sdp_str
),
SOATAG_USER_SDP_STR
(
tech
-
pvt
->
mparams
->
local_sdp_str
),
SOATAG_REUSE_REJECTED
(
1
),
SOATAG_ORDERED_USER
(
1
),
SOATAG_AUDIO_AUX
(
"cn telephone-event"
),
TAG_IF
(
sofia_test_pflag
(
profile
,
PFLAG_DISABLE_100REL
),
NUTAG_INCLUDE_EXTRA_SDP
(
1
)),
TAG_END
());
...
...
@@ -6158,7 +6158,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
NUTAG_MEDIA_ENABLE
(
0
),
SIPTAG_CONTACT_STR
(
tech_pvt
->
reply_contact
),
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
->
mparams
->
local_sdp_str
),
TAG_END
());
}
if
(
switch_event_create_subclass
(
&
s_event
,
SWITCH_EVENT_CUSTOM
,
MY_EVENT_REINVITE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
s_event
,
SWITCH_STACK_BOTTOM
,
"Unique-ID"
,
switch_core_session_get_uuid
(
session
));
...
...
@@ -7805,8 +7805,8 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
tech
_pvt
->
remote_ip
=
switch_core_session_strdup
(
session
,
network_ip
);
tech
_pvt
->
remote_port
=
network_port
;
tech
-
pvt
->
mparams
->
remote_ip
=
switch_core_session_strdup
(
session
,
network_ip
);
tech
-
pvt
->
mparams
->
remote_port
=
network_port
;
channel
=
tech_pvt
->
channel
=
switch_core_session_get_channel
(
session
);
...
...
@@ -7827,7 +7827,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
if
(
sip
->
sip_contact
&&
sip
->
sip_contact
->
m_url
)
{
char
tmp
[
35
]
=
""
;
const
char
*
ipv6
=
strchr
(
tech
_pvt
->
remote_ip
,
':'
);
const
char
*
ipv6
=
strchr
(
tech
-
pvt
->
mparams
->
remote_ip
,
':'
);
transport
=
sofia_glue_url2transport
(
sip
->
sip_contact
->
m_url
);
...
...
@@ -7835,10 +7835,10 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
switch_core_session_sprintf
(
session
,
"sip:%s@%s%s%s:%d;transport=%s"
,
sip
->
sip_contact
->
m_url
->
url_user
,
ipv6
?
"["
:
""
,
tech
_pvt
->
remote_ip
,
ipv6
?
"]"
:
""
,
tech_pvt
->
remote_port
,
sofia_glue_transport2str
(
transport
));
ipv6
?
"["
:
""
,
tech
-
pvt
->
mparams
->
remote_ip
,
ipv6
?
"]"
:
""
,
tech
-
pvt
->
mparams
->
remote_port
,
sofia_glue_transport2str
(
transport
));
switch_channel_set_variable
(
channel
,
"sip_received_ip"
,
tech
_pvt
->
remote_ip
);
snprintf
(
tmp
,
sizeof
(
tmp
),
"%d"
,
tech
_pvt
->
remote_port
);
switch_channel_set_variable
(
channel
,
"sip_received_ip"
,
tech
-
pvt
->
mparams
->
remote_ip
);
snprintf
(
tmp
,
sizeof
(
tmp
),
"%d"
,
tech
-
pvt
->
mparams
->
remote_port
);
switch_channel_set_variable
(
channel
,
"sip_received_port"
,
tmp
);
}
...
...
@@ -8039,7 +8039,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
"sip:%s@%s%s%s:%d;transport=%s"
,
user
,
ipv6
?
"["
:
""
,
host
,
ipv6
?
"]"
:
""
,
port
,
sofia_glue_transport2str
(
transport
));
if
(
sofia_glue_check_nat
(
profile
,
tech
_pvt
->
remote_ip
))
{
if
(
sofia_glue_check_nat
(
profile
,
tech
-
pvt
->
mparams
->
remote_ip
))
{
url
=
(
sofia_glue_transport_has_tls
(
transport
))
?
profile
->
tls_public_url
:
profile
->
public_url
;
check_nat
=
1
;
}
else
{
...
...
@@ -8079,7 +8079,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
}
else
{
const
char
*
url
=
NULL
;
if
(
sofia_glue_check_nat
(
profile
,
tech
_pvt
->
remote_ip
))
{
if
(
sofia_glue_check_nat
(
profile
,
tech
-
pvt
->
mparams
->
remote_ip
))
{
url
=
(
sofia_glue_transport_has_tls
(
transport
))
?
profile
->
tls_public_url
:
profile
->
public_url
;
}
else
{
url
=
(
sofia_glue_transport_has_tls
(
transport
))
?
profile
->
tls_url
:
profile
->
url
;
...
...
@@ -8101,7 +8101,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
}
}
if
(
sofia_glue_check_nat
(
profile
,
tech
_pvt
->
remote_ip
))
{
if
(
sofia_glue_check_nat
(
profile
,
tech
-
pvt
->
mparams
->
remote_ip
))
{
tech_pvt
->
user_via
=
sofia_glue_create_external_via
(
session
,
profile
,
tech_pvt
->
transport
);
nua_set_hparams
(
tech_pvt
->
nh
,
SIPTAG_VIA_STR
(
tech_pvt
->
user_via
),
TAG_END
());
}
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
0fffc839
差异被折叠。
点击展开。
src/mod/endpoints/mod_sofia/sofia_media.c
浏览文件 @
0fffc839
...
...
@@ -521,14 +521,14 @@ void sofia_media_tech_patch_sdp(private_object_t *tech_pvt)
char
*
new_sdp
;
int
bad
=
0
;
if
(
zstr
(
tech
_pvt
->
local_sdp_str
))
{
if
(
zstr
(
tech
-
pvt
->
mparams
->
local_sdp_str
))
{
return
;
}
len
=
strlen
(
tech
_pvt
->
local_sdp_str
)
*
2
;
len
=
strlen
(
tech
-
pvt
->
mparams
->
local_sdp_str
)
*
2
;
if
(
switch_channel_test_flag
(
tech_pvt
->
channel
,
CF_ANSWERED
)
&&
(
switch_stristr
(
"sendonly"
,
tech
_pvt
->
local_sdp_str
)
||
switch_stristr
(
"0.0.0.0"
,
tech_pvt
->
local_sdp_str
)))
{
(
switch_stristr
(
"sendonly"
,
tech
-
pvt
->
mparams
->
local_sdp_str
)
||
switch_stristr
(
"0.0.0.0"
,
tech
-
pvt
->
mparams
->
local_sdp_str
)))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_DEBUG
,
"Skip patch on hold SDP
\n
"
);
return
;
}
...
...
@@ -548,7 +548,7 @@ void sofia_media_tech_patch_sdp(private_object_t *tech_pvt)
switch_snprintf
(
port_buf
,
sizeof
(
port_buf
),
"%u"
,
tech_pvt
->
adv_sdp_audio_port
);
p
=
tech
_pvt
->
local_sdp_str
;
p
=
tech
-
pvt
->
mparams
->
local_sdp_str
;
q
=
new_sdp
;
pe
=
p
+
strlen
(
p
);
qe
=
q
+
len
-
1
;
...
...
@@ -775,13 +775,13 @@ void sofia_media_tech_patch_sdp(private_object_t *tech_pvt)
if
(
!
has_ip
&&
!
has_audio
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_DEBUG
,
"%s SDP has no audio in it.
\n
%s
\n
"
,
switch_channel_get_name
(
tech_pvt
->
channel
),
tech
_pvt
->
local_sdp_str
);
switch_channel_get_name
(
tech_pvt
->
channel
),
tech
-
pvt
->
mparams
->
local_sdp_str
);
return
;
}
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_DEBUG
,
"%s Patched SDP
\n
---
\n
%s
\n
+++
\n
%s
\n
"
,
switch_channel_get_name
(
tech_pvt
->
channel
),
tech
_pvt
->
local_sdp_str
,
new_sdp
);
switch_channel_get_name
(
tech_pvt
->
channel
),
tech
-
pvt
->
mparams
->
local_sdp_str
,
new_sdp
);
sofia_media_tech_set_local_sdp
(
tech_pvt
,
new_sdp
,
SWITCH_FALSE
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论