Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
63165679
提交
63165679
authored
2月 22, 2008
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@7724
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
062c5ba2
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
36 行增加
和
8 行删除
+36
-8
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+1
-0
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+1
-0
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+34
-8
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
63165679
...
@@ -966,6 +966,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
...
@@ -966,6 +966,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
tech_pvt
->
local_sdp_str
=
switch_core_session_strdup
(
tech_pvt
->
session
,
(
char
*
)
msg
->
pointer_arg
);
tech_pvt
->
local_sdp_str
=
switch_core_session_strdup
(
tech_pvt
->
session
,
(
char
*
)
msg
->
pointer_arg
);
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
{
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
{
sofia_glue_tech_patch_sdp
(
tech_pvt
);
sofia_glue_tech_patch_sdp
(
tech_pvt
);
sofia_glue_tech_proxy_remote_addr
(
tech_pvt
);
}
}
nua_respond
(
tech_pvt
->
nh
,
code
,
reason
,
SIPTAG_CONTACT_STR
(
tech_pvt
->
reply_contact
),
nua_respond
(
tech_pvt
->
nh
,
code
,
reason
,
SIPTAG_CONTACT_STR
(
tech_pvt
->
reply_contact
),
SOATAG_USER_SDP_STR
(
tech_pvt
->
local_sdp_str
),
SOATAG_USER_SDP_STR
(
tech_pvt
->
local_sdp_str
),
...
...
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
63165679
...
@@ -587,3 +587,4 @@ int sofia_glue_transport_has_tls(const sofia_transport_t tp);
...
@@ -587,3 +587,4 @@ int sofia_glue_transport_has_tls(const sofia_transport_t tp);
const
char
*
sofia_glue_get_unknown_header
(
sip_t
const
*
sip
,
const
char
*
name
);
const
char
*
sofia_glue_get_unknown_header
(
sip_t
const
*
sip
,
const
char
*
name
);
switch_status_t
sofia_glue_build_crypto
(
private_object_t
*
tech_pvt
,
int
index
,
switch_rtp_crypto_key_type_t
type
,
switch_rtp_crypto_direction_t
direction
);
switch_status_t
sofia_glue_build_crypto
(
private_object_t
*
tech_pvt
,
int
index
,
switch_rtp_crypto_key_type_t
type
,
switch_rtp_crypto_direction_t
direction
);
void
sofia_glue_tech_patch_sdp
(
private_object_t
*
tech_pvt
);
void
sofia_glue_tech_patch_sdp
(
private_object_t
*
tech_pvt
);
switch_status_t
sofia_glue_tech_proxy_remote_addr
(
private_object_t
*
tech_pvt
);
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
63165679
...
@@ -685,7 +685,9 @@ char *sofia_overcome_sip_uri_weakness(switch_core_session_t *session, const char
...
@@ -685,7 +685,9 @@ char *sofia_overcome_sip_uri_weakness(switch_core_session_t *session, const char
return
new_uri
;
return
new_uri
;
}
}
static
switch_status_t
sofia_glue_tech_proxy_remote_addr
(
private_object_t
*
tech_pvt
)
{
switch_status_t
sofia_glue_tech_proxy_remote_addr
(
private_object_t
*
tech_pvt
)
{
const
char
*
err
;
char
rip
[
128
]
=
""
;
char
rip
[
128
]
=
""
;
char
rp
[
128
]
=
""
;
char
rp
[
128
]
=
""
;
char
*
p
,
*
ip_ptr
=
NULL
,
*
port_ptr
=
NULL
;
char
*
p
,
*
ip_ptr
=
NULL
,
*
port_ptr
=
NULL
;
...
@@ -721,9 +723,29 @@ static switch_status_t sofia_glue_tech_proxy_remote_addr(private_object_t *tech_
...
@@ -721,9 +723,29 @@ static switch_status_t sofia_glue_tech_proxy_remote_addr(private_object_t *tech_
p
++
;
p
++
;
}
}
tech_pvt
->
remote_sdp_audio_ip
=
switch_core_session_strdup
(
tech_pvt
->
session
,
rip
);
if
(
switch_strlen_zero
(
tech_pvt
->
remote_sdp_audio_ip
)
||
!
tech_pvt
->
remote_sdp_audio_port
)
{
tech_pvt
->
remote_sdp_audio_port
=
(
switch_port_t
)
atoi
(
rp
);
tech_pvt
->
remote_sdp_audio_ip
=
switch_core_session_strdup
(
tech_pvt
->
session
,
rip
);
tech_pvt
->
remote_sdp_audio_port
=
(
switch_port_t
)
atoi
(
rp
);
}
if
(
!
strcmp
(
tech_pvt
->
remote_sdp_audio_ip
,
rip
)
&&
atoi
(
rp
)
==
tech_pvt
->
remote_sdp_audio_port
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Remote address:port [%s:%d] has not changed.
\n
"
,
tech_pvt
->
remote_sdp_audio_ip
,
tech_pvt
->
remote_sdp_audio_port
);
return
SWITCH_STATUS_SUCCESS
;
}
if
(
switch_rtp_ready
(
tech_pvt
->
rtp_session
))
{
if
(
switch_rtp_set_remote_address
(
tech_pvt
->
rtp_session
,
tech_pvt
->
remote_sdp_audio_ip
,
tech_pvt
->
remote_sdp_audio_port
,
&
err
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"AUDIO RTP REPORTS ERROR: [%s]
\n
"
,
err
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"AUDIO RTP CHANGING DEST TO: [%s:%d]
\n
"
,
tech_pvt
->
remote_sdp_audio_ip
,
tech_pvt
->
remote_sdp_audio_port
);
/* Reactivate the NAT buster flag. */
switch_rtp_set_flag
(
tech_pvt
->
rtp_session
,
SWITCH_RTP_FLAG_AUTOADJ
);
}
}
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
@@ -738,16 +760,17 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
...
@@ -738,16 +760,17 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
return
;
return
;
}
}
if
(
!
switch_strlen_zero
(
tech_pvt
->
orig_local_sdp_str
))
{
return
;
}
len
=
strlen
(
tech_pvt
->
local_sdp_str
)
+
256
;
len
=
strlen
(
tech_pvt
->
local_sdp_str
)
+
256
;
if
((
p
=
(
char
*
)
switch_stristr
(
"c=IN IP4 "
,
tech_pvt
->
local_sdp_str
)))
{
if
((
p
=
(
char
*
)
switch_stristr
(
"c=IN IP4 "
,
tech_pvt
->
local_sdp_str
)))
{
ip_ptr
=
p
+
9
;
ip_ptr
=
p
+
9
;
}
}
if
(
!
strncmp
(
ip_ptr
,
"0.0.0.0"
,
7
)
||
switch_stristr
(
"sendonly"
,
tech_pvt
->
local_sdp_str
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Skip patch on hold SDP
\n
"
);
return
;
}
if
((
p
=
(
char
*
)
switch_stristr
(
"m=audio "
,
tech_pvt
->
local_sdp_str
)))
{
if
((
p
=
(
char
*
)
switch_stristr
(
"m=audio "
,
tech_pvt
->
local_sdp_str
)))
{
port_ptr
=
p
+
8
;
port_ptr
=
p
+
8
;
}
}
...
@@ -797,7 +820,7 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
...
@@ -797,7 +820,7 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
*
q
++
=
*
p
++
;
*
q
++
=
*
p
++
;
}
}
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s Patched SDP
\n
%s
\n
%s
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s Patched SDP
\n
---
\n
%s
\n
+++
\n
%s
\n
"
,
switch_channel_get_name
(
tech_pvt
->
channel
),
tech_pvt
->
orig_local_sdp_str
,
tech_pvt
->
local_sdp_str
);
switch_channel_get_name
(
tech_pvt
->
channel
),
tech_pvt
->
orig_local_sdp_str
,
tech_pvt
->
local_sdp_str
);
}
}
...
@@ -1034,6 +1057,9 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
...
@@ -1034,6 +1057,9 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
}
}
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
{
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
))
{
if
(
switch_rtp_ready
(
tech_pvt
->
rtp_session
))
{
sofia_glue_tech_proxy_remote_addr
(
tech_pvt
);
}
sofia_glue_tech_patch_sdp
(
tech_pvt
);
sofia_glue_tech_patch_sdp
(
tech_pvt
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论