Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
72baaf6d
提交
72baaf6d
authored
9月 22, 2010
作者:
Brian West
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix t38 passthru when port changes on re-invite
上级
30b2c6fe
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
80 行增加
和
8 行删除
+80
-8
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+1
-1
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+30
-0
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+49
-7
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
72baaf6d
...
@@ -1771,7 +1771,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
...
@@ -1771,7 +1771,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
nua_update
(
tech_pvt
->
nh
,
nua_update
(
tech_pvt
->
nh
,
TAG_IF
(
!
zstr_buf
(
message
),
SIPTAG_HEADER_STR
(
message
)),
TAG_IF
(
!
zstr_buf
(
message
),
SIPTAG_HEADER_STR
(
message
)),
TAG_IF
(
!
zstr
(
tech_pvt
->
user_via
),
SIPTAG_VIA_STR
(
tech_pvt
->
user_via
)),
TAG_END
());
TAG_IF
(
!
zstr
(
tech_pvt
->
user_via
),
SIPTAG_VIA_STR
(
tech_pvt
->
user_via
)),
TAG_END
());
}
else
if
((
ua
&&
(
switch_stristr
(
"cisco"
,
ua
))))
{
}
else
if
(
0
&&
(
ua
&&
(
switch_stristr
(
"cisco"
,
ua
))))
{
snprintf
(
message
,
sizeof
(
message
),
"P-Asserted-Identity:
\"
%s
\"
<sip:%s@%s>"
,
name
,
number
,
tech_pvt
->
profile
->
sipip
);
snprintf
(
message
,
sizeof
(
message
),
"P-Asserted-Identity:
\"
%s
\"
<sip:%s@%s>"
,
name
,
number
,
tech_pvt
->
profile
->
sipip
);
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_UPDATING_DISPLAY
);
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_UPDATING_DISPLAY
);
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
72baaf6d
...
@@ -4138,6 +4138,36 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
...
@@ -4138,6 +4138,36 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
if
(
status
==
200
&&
sofia_test_flag
(
tech_pvt
,
TFLAG_T38_PASSTHRU
)
&&
has_t38
)
{
if
(
status
==
200
&&
sofia_test_flag
(
tech_pvt
,
TFLAG_T38_PASSTHRU
)
&&
has_t38
)
{
if
(
sip
->
sip_payload
&&
sip
->
sip_payload
->
pl_data
)
{
if
(
sip
->
sip_payload
&&
sip
->
sip_payload
->
pl_data
)
{
switch_t38_options_t
*
t38_options
=
sofia_glue_extract_t38_options
(
session
,
sip
->
sip_payload
->
pl_data
);
switch_t38_options_t
*
t38_options
=
sofia_glue_extract_t38_options
(
session
,
sip
->
sip_payload
->
pl_data
);
char
*
remote_host
=
switch_rtp_get_remote_host
(
tech_pvt
->
rtp_session
);
switch_port_t
remote_port
=
switch_rtp_get_remote_port
(
tech_pvt
->
rtp_session
);
char
tmp
[
32
]
=
""
;
tech_pvt
->
remote_sdp_audio_ip
=
switch_core_session_strdup
(
tech_pvt
->
session
,
t38_options
->
remote_ip
);
tech_pvt
->
remote_sdp_audio_port
=
t38_options
->
remote_port
;
if
(
remote_host
&&
remote_port
&&
!
strcmp
(
remote_host
,
tech_pvt
->
remote_sdp_audio_ip
)
&&
remote_port
==
tech_pvt
->
remote_sdp_audio_port
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_DEBUG
,
"Audio params are unchanged for %s.
\n
"
,
switch_channel_get_name
(
tech_pvt
->
channel
));
}
else
{
const
char
*
err
=
NULL
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_DEBUG
,
"Audio params changed for %s from %s:%d to %s:%d
\n
"
,
switch_channel_get_name
(
tech_pvt
->
channel
),
remote_host
,
remote_port
,
tech_pvt
->
remote_sdp_audio_ip
,
tech_pvt
->
remote_sdp_audio_port
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%d"
,
tech_pvt
->
remote_sdp_audio_port
);
switch_channel_set_variable
(
tech_pvt
->
channel
,
SWITCH_REMOTE_MEDIA_IP_VARIABLE
,
tech_pvt
->
remote_sdp_audio_ip
);
switch_channel_set_variable
(
tech_pvt
->
channel
,
SWITCH_REMOTE_MEDIA_PORT_VARIABLE
,
tmp
);
if
(
switch_rtp_set_remote_address
(
tech_pvt
->
rtp_session
,
tech_pvt
->
remote_sdp_audio_ip
,
tech_pvt
->
remote_sdp_audio_port
,
0
,
SWITCH_TRUE
,
&
err
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_ERROR
,
"AUDIO RTP REPORTS ERROR: [%s]
\n
"
,
err
);
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_INCOMPATIBLE_DESTINATION
);
}
}
if
(
t38_options
)
{
if
(
t38_options
)
{
sofia_glue_copy_t38_options
(
t38_options
,
other_session
);
sofia_glue_copy_t38_options
(
t38_options
,
other_session
);
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
72baaf6d
...
@@ -41,7 +41,9 @@ switch_cache_db_handle_t *sofia_glue_get_db_handle(sofia_profile_t *profile);
...
@@ -41,7 +41,9 @@ switch_cache_db_handle_t *sofia_glue_get_db_handle(sofia_profile_t *profile);
void
sofia_glue_set_image_sdp
(
private_object_t
*
tech_pvt
,
switch_t38_options_t
*
t38_options
,
int
insist
)
void
sofia_glue_set_image_sdp
(
private_object_t
*
tech_pvt
,
switch_t38_options_t
*
t38_options
,
int
insist
)
{
{
char
buf
[
2048
];
char
buf
[
2048
]
=
""
;
char
max_buf
[
128
]
=
""
;
char
max_data
[
128
]
=
""
;
const
char
*
ip
=
t38_options
->
local_ip
;
const
char
*
ip
=
t38_options
->
local_ip
;
uint32_t
port
=
t38_options
->
local_port
;
uint32_t
port
=
t38_options
->
local_port
;
const
char
*
family
=
"IP4"
;
const
char
*
family
=
"IP4"
;
...
@@ -89,6 +91,14 @@ void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *
...
@@ -89,6 +91,14 @@ void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *
"o=%s %010u %010u IN %s %s
\n
"
"o=%s %010u %010u IN %s %s
\n
"
"s=%s
\n
"
"c=IN %s %s
\n
"
"t=0 0
\n
"
,
username
,
tech_pvt
->
owner_id
,
tech_pvt
->
session_id
,
family
,
ip
,
username
,
family
,
ip
);
"s=%s
\n
"
"c=IN %s %s
\n
"
"t=0 0
\n
"
,
username
,
tech_pvt
->
owner_id
,
tech_pvt
->
session_id
,
family
,
ip
,
username
,
family
,
ip
);
if
(
t38_options
->
T38FaxMaxBuffer
)
{
switch_snprintf
(
max_buf
,
sizeof
(
max_buf
),
"a=T38FaxMaxBuffer:%d
\n
"
,
t38_options
->
T38FaxMaxBuffer
);
};
if
(
t38_options
->
T38FaxMaxDatagram
)
{
switch_snprintf
(
max_data
,
sizeof
(
max_data
),
"a=T38FaxMaxDatagram:%d
\n
"
,
t38_options
->
T38FaxMaxDatagram
);
};
switch_snprintf
(
buf
+
strlen
(
buf
),
sizeof
(
buf
)
-
strlen
(
buf
),
switch_snprintf
(
buf
+
strlen
(
buf
),
sizeof
(
buf
)
-
strlen
(
buf
),
"m=image %d udptl t38
\n
"
"m=image %d udptl t38
\n
"
...
@@ -98,8 +108,8 @@ void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *
...
@@ -98,8 +108,8 @@ void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *
"%s"
"%s"
"%s"
"%s"
"a=T38FaxRateManagement:%s
\n
"
"a=T38FaxRateManagement:%s
\n
"
"
a=T38FaxMaxBuffer:%d
\n
"
"
%s
"
"
a=T38FaxMaxDatagram:%d
\n
"
"
%s
"
"a=T38FaxUdpEC:%s
\n
"
,
"a=T38FaxUdpEC:%s
\n
"
,
//"a=T38VendorInfo:%s\n",
//"a=T38VendorInfo:%s\n",
port
,
port
,
...
@@ -109,8 +119,9 @@ void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *
...
@@ -109,8 +119,9 @@ void sofia_glue_set_image_sdp(private_object_t *tech_pvt, switch_t38_options_t *
t38_options
->
T38FaxTranscodingMMR
?
"a=T38FaxTranscodingMMR
\n
"
:
""
,
t38_options
->
T38FaxTranscodingMMR
?
"a=T38FaxTranscodingMMR
\n
"
:
""
,
t38_options
->
T38FaxTranscodingJBIG
?
"a=T38FaxTranscodingJBIG
\n
"
:
""
,
t38_options
->
T38FaxTranscodingJBIG
?
"a=T38FaxTranscodingJBIG
\n
"
:
""
,
t38_options
->
T38FaxRateManagement
,
t38_options
->
T38FaxRateManagement
,
t38_options
->
T38FaxMaxBuffer
,
max_buf
,
t38_options
->
T38FaxMaxDatagram
,
t38_options
->
T38FaxUdpEC
max_data
,
t38_options
->
T38FaxUdpEC
//t38_options->T38VendorInfo ? t38_options->T38VendorInfo : "0 0 0"
//t38_options->T38VendorInfo ? t38_options->T38VendorInfo : "0 0 0"
);
);
...
@@ -3619,7 +3630,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
...
@@ -3619,7 +3630,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
if
(
got_udptl
&&
m
->
m_type
==
sdp_media_image
&&
m
->
m_port
)
{
if
(
got_udptl
&&
m
->
m_type
==
sdp_media_image
&&
m
->
m_port
)
{
switch_t38_options_t
*
t38_options
=
tech_process_udptl
(
tech_pvt
,
sdp
,
m
);
switch_t38_options_t
*
t38_options
=
tech_process_udptl
(
tech_pvt
,
sdp
,
m
);
if
(
switch_true
(
switch_channel_get_variable
(
channel
,
"refuse_t38"
)))
{
if
(
switch_true
(
switch_channel_get_variable
(
channel
,
"refuse_t38"
)))
{
match
=
0
;
match
=
0
;
goto
done
;
goto
done
;
...
@@ -3634,10 +3645,41 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
...
@@ -3634,10 +3645,41 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
if
(
sofia_test_flag
(
tech_pvt
,
TFLAG_T38_PASSTHRU
))
{
if
(
sofia_test_flag
(
tech_pvt
,
TFLAG_T38_PASSTHRU
))
{
pass
=
0
;
pass
=
0
;
}
}
if
(
pass
&&
switch_core_session_get_partner
(
session
,
&
other_session
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
pass
&&
switch_core_session_get_partner
(
session
,
&
other_session
)
==
SWITCH_STATUS_SUCCESS
)
{
private_object_t
*
other_tech_pvt
=
switch_core_session_get_private
(
other_session
);
private_object_t
*
other_tech_pvt
=
switch_core_session_get_private
(
other_session
);
switch_core_session_message_t
*
msg
;
switch_core_session_message_t
*
msg
;
char
*
remote_host
=
switch_rtp_get_remote_host
(
tech_pvt
->
rtp_session
);
switch_port_t
remote_port
=
switch_rtp_get_remote_port
(
tech_pvt
->
rtp_session
);
char
tmp
[
32
]
=
""
;
tech_pvt
->
remote_sdp_audio_ip
=
switch_core_session_strdup
(
tech_pvt
->
session
,
t38_options
->
remote_ip
);
tech_pvt
->
remote_sdp_audio_port
=
t38_options
->
remote_port
;
if
(
remote_host
&&
remote_port
&&
!
strcmp
(
remote_host
,
tech_pvt
->
remote_sdp_audio_ip
)
&&
remote_port
==
tech_pvt
->
remote_sdp_audio_port
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_DEBUG
,
"Audio params are unchanged for %s.
\n
"
,
switch_channel_get_name
(
tech_pvt
->
channel
));
}
else
{
const
char
*
err
=
NULL
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_DEBUG
,
"Audio params changed for %s from %s:%d to %s:%d
\n
"
,
switch_channel_get_name
(
tech_pvt
->
channel
),
remote_host
,
remote_port
,
tech_pvt
->
remote_sdp_audio_ip
,
tech_pvt
->
remote_sdp_audio_port
);
switch_snprintf
(
tmp
,
sizeof
(
tmp
),
"%d"
,
tech_pvt
->
remote_sdp_audio_port
);
switch_channel_set_variable
(
tech_pvt
->
channel
,
SWITCH_REMOTE_MEDIA_IP_VARIABLE
,
tech_pvt
->
remote_sdp_audio_ip
);
switch_channel_set_variable
(
tech_pvt
->
channel
,
SWITCH_REMOTE_MEDIA_PORT_VARIABLE
,
tmp
);
if
(
switch_rtp_set_remote_address
(
tech_pvt
->
rtp_session
,
tech_pvt
->
remote_sdp_audio_ip
,
tech_pvt
->
remote_sdp_audio_port
,
0
,
SWITCH_TRUE
,
&
err
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_ERROR
,
"AUDIO RTP REPORTS ERROR: [%s]
\n
"
,
err
);
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_INCOMPATIBLE_DESTINATION
);
}
}
sofia_glue_copy_t38_options
(
t38_options
,
other_session
);
sofia_glue_copy_t38_options
(
t38_options
,
other_session
);
sofia_set_flag
(
tech_pvt
,
TFLAG_T38_PASSTHRU
);
sofia_set_flag
(
tech_pvt
,
TFLAG_T38_PASSTHRU
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论