Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
1ab88581
提交
1ab88581
authored
12月 19, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename
上级
f6b56c39
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
123 行增加
和
123 行删除
+123
-123
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+35
-35
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+18
-18
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+22
-22
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+9
-9
sofia_media.c
src/mod/endpoints/mod_sofia/sofia_media.c
+39
-39
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
1ab88581
差异被折叠。
点击展开。
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
1ab88581
...
...
@@ -917,11 +917,11 @@ switch_status_t sofia_media_activate_rtp(private_object_t *tech_pvt);
void
sofia_glue_deactivate_rtp
(
private_object_t
*
tech_pvt
);
void
sofia_
glue
_set_local_sdp
(
private_object_t
*
tech_pvt
,
const
char
*
ip
,
switch_port_t
port
,
const
char
*
sr
,
int
force
);
void
sofia_
media
_set_local_sdp
(
private_object_t
*
tech_pvt
,
const
char
*
ip
,
switch_port_t
port
,
const
char
*
sr
,
int
force
);
void
sofia_
glue
_tech_prepare_codecs
(
private_object_t
*
tech_pvt
);
void
sofia_
media
_tech_prepare_codecs
(
private_object_t
*
tech_pvt
);
const
char
*
sofia_
glue
_get_codec_string
(
private_object_t
*
tech_pvt
);
const
char
*
sofia_
media
_get_codec_string
(
private_object_t
*
tech_pvt
);
void
sofia_glue_attach_private
(
switch_core_session_t
*
session
,
sofia_profile_t
*
profile
,
private_object_t
*
tech_pvt
,
const
char
*
channame
);
...
...
@@ -929,7 +929,7 @@ switch_status_t sofia_glue_tech_choose_port(private_object_t *tech_pvt, int forc
switch_status_t
sofia_glue_do_invite
(
switch_core_session_t
*
session
);
uint8_t
sofia_
glue
_negotiate_sdp
(
switch_core_session_t
*
session
,
const
char
*
r_sdp
);
uint8_t
sofia_
media
_negotiate_sdp
(
switch_core_session_t
*
session
,
const
char
*
r_sdp
);
void
sofia_handle_sip_i_refer
(
nua_t
*
nua
,
sofia_profile_t
*
profile
,
nua_handle_t
*
nh
,
switch_core_session_t
*
session
,
sip_t
const
*
sip
,
sofia_dispatch_event_t
*
de
,
tagi_t
tags
[]);
...
...
@@ -956,7 +956,7 @@ void launch_sofia_profile_thread(sofia_profile_t *profile);
switch_status_t
sofia_presence_chat_send
(
switch_event_t
*
message_event
);
void
sofia_
glue
_tech_absorb_sdp
(
private_object_t
*
tech_pvt
);
void
sofia_
media
_tech_absorb_sdp
(
private_object_t
*
tech_pvt
);
void
sofia_glue_pass_zrtp_hash2
(
switch_core_session_t
*
aleg_session
,
switch_core_session_t
*
bleg_session
);
void
sofia_glue_pass_zrtp_hash
(
switch_core_session_t
*
session
);
...
...
@@ -966,8 +966,8 @@ void sofia_glue_pass_zrtp_hash(switch_core_session_t *session);
* \param codec_string The profile's codec string or NULL if inexistant
* \param sdp The parsed SDP content
*/
void
sofia_
glue
_set_r_sdp_codec_string
(
switch_core_session_t
*
session
,
const
char
*
codec_string
,
sdp_session_t
*
sdp
);
switch_status_t
sofia_
glue
_tech_media
(
private_object_t
*
tech_pvt
,
const
char
*
r_sdp
);
void
sofia_
media
_set_r_sdp_codec_string
(
switch_core_session_t
*
session
,
const
char
*
codec_string
,
sdp_session_t
*
sdp
);
switch_status_t
sofia_
media
_tech_media
(
private_object_t
*
tech_pvt
,
const
char
*
r_sdp
);
char
*
sofia_reg_find_reg_url
(
sofia_profile_t
*
profile
,
const
char
*
user
,
const
char
*
host
,
char
*
val
,
switch_size_t
len
);
void
event_handler
(
switch_event_t
*
event
);
void
sofia_presence_event_handler
(
switch_event_t
*
event
);
...
...
@@ -1040,7 +1040,7 @@ char *sofia_overcome_sip_uri_weakness(switch_core_session_t *session, const char
switch_bool_t
sofia_glue_execute_sql_callback
(
sofia_profile_t
*
profile
,
switch_mutex_t
*
mutex
,
char
*
sql
,
switch_core_db_callback_func_t
callback
,
void
*
pdata
);
char
*
sofia_glue_execute_sql2str
(
sofia_profile_t
*
profile
,
switch_mutex_t
*
mutex
,
char
*
sql
,
char
*
resbuf
,
size_t
len
);
void
sofia_
glue
_check_video_codecs
(
private_object_t
*
tech_pvt
);
void
sofia_
media
_check_video_codecs
(
private_object_t
*
tech_pvt
);
void
sofia_glue_del_profile
(
sofia_profile_t
*
profile
);
switch_status_t
sofia_glue_add_profile
(
char
*
key
,
sofia_profile_t
*
profile
);
...
...
@@ -1117,14 +1117,14 @@ int sofia_glue_check_nat(sofia_profile_t *profile, const char *network_ip);
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
);
switch_status_t
sofia_media_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_
media
_tech_patch_sdp
(
private_object_t
*
tech_pvt
);
switch_status_t
sofia_glue_tech_proxy_remote_addr
(
private_object_t
*
tech_pvt
,
const
char
*
sdp_str
);
void
sofia_presence_event_thread_start
(
void
);
void
sofia_reg_expire_call_id
(
sofia_profile_t
*
profile
,
const
char
*
call_id
,
int
reboot
);
void
sofia_reg_check_call_id
(
sofia_profile_t
*
profile
,
const
char
*
call_id
);
void
sofia_reg_check_sync
(
sofia_profile_t
*
profile
);
switch_status_t
sofia_glue_tech_choose_video_port
(
private_object_t
*
tech_pvt
,
int
force
);
switch_status_t
sofia_
glue
_tech_set_video_codec
(
private_object_t
*
tech_pvt
,
int
force
);
switch_status_t
sofia_
media
_tech_set_video_codec
(
private_object_t
*
tech_pvt
,
int
force
);
char
*
sofia_glue_get_register_host
(
const
char
*
uri
);
const
char
*
sofia_glue_strip_proto
(
const
char
*
uri
);
void
sofia_glue_del_gateway
(
sofia_gateway_t
*
gp
);
...
...
@@ -1133,9 +1133,9 @@ void sofia_glue_del_every_gateway(sofia_profile_t *profile);
void
sofia_reg_send_reboot
(
sofia_profile_t
*
profile
,
const
char
*
callid
,
const
char
*
user
,
const
char
*
host
,
const
char
*
contact
,
const
char
*
user_agent
,
const
char
*
network_ip
);
void
sofia_glue_restart_all_profiles
(
void
);
int
sofia_
glue
_toggle_hold
(
private_object_t
*
tech_pvt
,
int
sendonly
);
int
sofia_
media
_toggle_hold
(
private_object_t
*
tech_pvt
,
int
sendonly
);
const
char
*
sofia_state_string
(
int
state
);
switch_status_t
sofia_
glue
_tech_set_codec
(
private_object_t
*
tech_pvt
,
int
force
);
switch_status_t
sofia_
media
_tech_set_codec
(
private_object_t
*
tech_pvt
,
int
force
);
void
sofia_wait_for_reply
(
struct
private_object
*
tech_pvt
,
nua_event_t
event
,
uint32_t
timeout
);
void
sofia_glue_set_udptl_image_sdp
(
private_object_t
*
tech_pvt
,
switch_t38_options_t
*
t38_options
,
int
insist
);
...
...
@@ -1162,7 +1162,7 @@ switch_status_t list_profiles_full(const char *line, const char *cursor, switch_
switch_status_t
list_profiles
(
const
char
*
line
,
const
char
*
cursor
,
switch_console_callback_match_t
**
matches
);
sofia_cid_type_t
sofia_cid_name2type
(
const
char
*
name
);
void
sofia_
glue
_tech_set_local_sdp
(
private_object_t
*
tech_pvt
,
const
char
*
sdp_str
,
switch_bool_t
dup
);
void
sofia_
media
_tech_set_local_sdp
(
private_object_t
*
tech_pvt
,
const
char
*
sdp_str
,
switch_bool_t
dup
);
void
sofia_glue_set_rtp_stats
(
private_object_t
*
tech_pvt
);
void
sofia_glue_get_addr
(
msg_t
*
msg
,
char
*
buf
,
size_t
buflen
,
int
*
port
);
sofia_destination_t
*
sofia_glue_get_destination
(
char
*
data
);
...
...
@@ -1182,9 +1182,9 @@ switch_status_t sip_dig_function(_In_opt_z_ const char *cmd, _In_opt_ switch_cor
const
char
*
sofia_gateway_status_name
(
sofia_gateway_status_t
status
);
void
sofia_reg_fire_custom_gateway_state_event
(
sofia_gateway_t
*
gateway
,
int
status
,
const
char
*
phrase
);
uint32_t
sofia_reg_reg_count
(
sofia_profile_t
*
profile
,
const
char
*
user
,
const
char
*
host
);
void
sofia_
glue
_copy_t38_options
(
switch_t38_options_t
*
t38_options
,
switch_core_session_t
*
session
);
switch_t38_options_t
*
sofia_
glue
_extract_t38_options
(
switch_core_session_t
*
session
,
const
char
*
r_sdp
);
char
*
sofia_
glue
_get_multipart
(
switch_core_session_t
*
session
,
const
char
*
prefix
,
const
char
*
sdp
,
char
**
mp_type
);
void
sofia_
media
_copy_t38_options
(
switch_t38_options_t
*
t38_options
,
switch_core_session_t
*
session
);
switch_t38_options_t
*
sofia_
media
_extract_t38_options
(
switch_core_session_t
*
session
,
const
char
*
r_sdp
);
char
*
sofia_
media
_get_multipart
(
switch_core_session_t
*
session
,
const
char
*
prefix
,
const
char
*
sdp
,
char
**
mp_type
);
int
sofia_glue_tech_simplify
(
private_object_t
*
tech_pvt
);
switch_console_callback_match_t
*
sofia_reg_find_reg_url_multi
(
sofia_profile_t
*
profile
,
const
char
*
user
,
const
char
*
host
);
switch_console_callback_match_t
*
sofia_reg_find_reg_url_with_positive_expires_multi
(
sofia_profile_t
*
profile
,
const
char
*
user
,
const
char
*
host
,
time_t
reg_time
,
const
char
*
contact_str
,
long
exptime
);
...
...
@@ -1192,8 +1192,8 @@ switch_bool_t sofia_glue_profile_exists(const char *key);
void
sofia_glue_global_siptrace
(
switch_bool_t
on
);
void
sofia_glue_global_capture
(
switch_bool_t
on
);
void
sofia_glue_global_watchdog
(
switch_bool_t
on
);
void
sofia_
glue
_proxy_codec
(
switch_core_session_t
*
session
,
const
char
*
r_sdp
);
switch_status_t
sofia_
glue
_sdp_map
(
const
char
*
r_sdp
,
switch_event_t
**
fmtp
,
switch_event_t
**
pt
);
void
sofia_
media
_proxy_codec
(
switch_core_session_t
*
session
,
const
char
*
r_sdp
);
switch_status_t
sofia_
media
_sdp_map
(
const
char
*
r_sdp
,
switch_event_t
**
fmtp
,
switch_event_t
**
pt
);
void
sofia_glue_build_vid_refresh_message
(
switch_core_session_t
*
session
,
const
char
*
pl
);
void
sofia_glue_check_dtmf_type
(
private_object_t
*
tech_pvt
);
void
sofia_glue_parse_rtp_bugs
(
switch_rtp_bug_flag_t
*
flag_pole
,
const
char
*
str
);
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
1ab88581
...
...
@@ -4948,11 +4948,11 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
sip->sip_payload && sip->sip_payload->pl_data && !strcasecmp(tech_pvt->iananame, "PROXY")) {
switch_core_session_t *other_session;
sofia_
glue
_proxy_codec(session, sip->sip_payload->pl_data);
sofia_
media
_proxy_codec(session, sip->sip_payload->pl_data);
if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) {
if (switch_core_session_compare(session, other_session)) {
sofia_
glue
_proxy_codec(other_session, sip->sip_payload->pl_data);
sofia_
media
_proxy_codec(other_session, sip->sip_payload->pl_data);
}
switch_core_session_rwunlock(other_session);
}
...
...
@@ -5234,7 +5234,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
switch_channel_clear_app_flag_key
(
"T38"
,
tech_pvt
->
channel
,
CF_APP_T38_REQ
);
switch_channel_set_app_flag_key
(
"T38"
,
tech_pvt
->
channel
,
CF_APP_T38_FAIL
);
}
else
if
(
status
==
200
&&
sofia_test_flag
(
tech_pvt
,
TFLAG_T38_PASSTHRU
)
&&
has_t38
&&
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_
media
_extract_t38_options
(
session
,
sip
->
sip_payload
->
pl_data
);
if
(
!
t38_options
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_WARNING
,
"Could not parse T.38 options from sdp.
\n
"
);
...
...
@@ -5273,7 +5273,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
}
}
sofia_
glue
_copy_t38_options
(
t38_options
,
other_session
);
sofia_
media
_copy_t38_options
(
t38_options
,
other_session
);
}
}
...
...
@@ -5449,7 +5449,7 @@ void *SWITCH_THREAD_FUNC media_on_hold_thread_run(switch_thread_t *thread, void
switch_rtp_clear_flag
(
tech_pvt
->
rtp_session
,
SWITCH_RTP_FLAG_AUTOADJ
);
}
sofia_
glue
_toggle_hold
(
tech_pvt
,
1
);
sofia_
media
_toggle_hold
(
tech_pvt
,
1
);
}
switch_core_session_rwunlock
(
other_session
);
}
...
...
@@ -5762,7 +5762,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if
(
sofia_test_flag
(
tech_pvt
,
TFLAG_LATE_NEGOTIATION
)
&&
switch_channel_direction
(
tech_pvt
->
channel
)
==
SWITCH_CALL_DIRECTION_INBOUND
)
{
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"DELAYED NEGOTIATION"
);
}
else
{
if
(
sofia_
glue
_tech_media
(
tech_pvt
,
(
char
*
)
r_sdp
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
sofia_
media
_tech_media
(
tech_pvt
,
(
char
*
)
r_sdp
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"CODEC NEGOTIATION ERROR"
);
nua_respond
(
nh
,
SIP_488_NOT_ACCEPTABLE
,
TAG_END
());
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_INCOMPATIBLE_DESTINATION
);
...
...
@@ -5864,7 +5864,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
uint8_t
match
=
0
;
if
(
tech_pvt
->
num_codecs
)
{
match
=
sofia_
glue
_negotiate_sdp
(
session
,
r_sdp
);
match
=
sofia_
media
_negotiate_sdp
(
session
,
r_sdp
);
}
if
(
!
match
)
{
...
...
@@ -5947,7 +5947,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
else
{
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"RECEIVED_NOSDP"
);
sofia_glue_tech_choose_port
(
tech_pvt
,
0
);
sofia_
glue
_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
sofia_
media
_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_3PCC
);
switch_channel_set_state
(
channel
,
CS_HIBERNATE
);
if
(
sofia_use_soa
(
tech_pvt
))
{
...
...
@@ -5970,7 +5970,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"RECEIVED_NOSDP"
);
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_3PCC
);
//sofia_glue_tech_choose_port(tech_pvt, 0);
//sofia_
glue
_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
//sofia_
media
_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
sofia_set_flag
(
tech_pvt
,
TFLAG_LATE_NEGOTIATION
);
//Moves into CS_INIT so call moves forward into the dialplan
switch_channel_set_state
(
channel
,
CS_INIT
);
...
...
@@ -6038,15 +6038,15 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
tech_pvt
->
hold_laps
=
1
;
switch_channel_set_variable
(
channel
,
SWITCH_R_SDP_VARIABLE
,
r_sdp
);
switch_channel_clear_flag
(
channel
,
CF_PROXY_MODE
);
sofia_
glue
_tech_set_local_sdp
(
tech_pvt
,
NULL
,
SWITCH_FALSE
);
sofia_
media
_tech_set_local_sdp
(
tech_pvt
,
NULL
,
SWITCH_FALSE
);
if
(
!
switch_channel_media_ready
(
channel
))
{
if
(
switch_channel_direction
(
tech_pvt
->
channel
)
==
SWITCH_CALL_DIRECTION_INBOUND
)
{
//const char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
tech_pvt
->
num_codecs
=
0
;
sofia_
glue
_tech_prepare_codecs
(
tech_pvt
);
if
(
sofia_
glue
_tech_media
(
tech_pvt
,
r_sdp
)
!=
SWITCH_STATUS_SUCCESS
)
{
sofia_
media
_tech_prepare_codecs
(
tech_pvt
);
if
(
sofia_
media
_tech_media
(
tech_pvt
,
r_sdp
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"CODEC NEGOTIATION ERROR"
);
status
=
SWITCH_STATUS_FALSE
;
switch_core_session_rwunlock
(
other_session
);
...
...
@@ -6057,14 +6057,14 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if
(
!
switch_rtp_ready
(
tech_pvt
->
rtp_session
))
{
sofia_
glue
_tech_prepare_codecs
(
tech_pvt
);
sofia_
media
_tech_prepare_codecs
(
tech_pvt
);
if
((
status
=
sofia_glue_tech_choose_port
(
tech_pvt
,
0
))
!=
SWITCH_STATUS_SUCCESS
)
{
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
switch_core_session_rwunlock
(
other_session
);
goto
done
;
}
}
sofia_
glue
_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
1
);
sofia_
media
_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
1
);
if
(
sofia_use_soa
(
tech_pvt
))
{
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
...
...
@@ -6157,7 +6157,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_REINVITE
);
if
(
tech_pvt
->
num_codecs
)
{
match
=
sofia_
glue
_negotiate_sdp
(
session
,
r_sdp
);
match
=
sofia_
media
_negotiate_sdp
(
session
,
r_sdp
);
}
if
(
match
&&
sofia_test_flag
(
tech_pvt
,
TFLAG_NOREPLY
))
{
...
...
@@ -6170,7 +6170,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
goto
done
;
}
sofia_
glue
_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
sofia_
media
_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
if
(
sofia_media_activate_rtp
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Reinvite RTP Error!
\n
"
);
...
...
@@ -6189,7 +6189,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if
(
is_ok
)
{
if
(
switch_core_session_local_crypto_key
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
))
{
sofia_
glue
_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
sofia_
media
_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
}
if
(
sofia_use_soa
(
tech_pvt
))
{
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
...
...
@@ -6221,13 +6221,13 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_REINVITE
);
if
(
tech_pvt
->
num_codecs
)
{
match
=
sofia_
glue
_negotiate_sdp
(
session
,
r_sdp
);
match
=
sofia_
media
_negotiate_sdp
(
session
,
r_sdp
);
}
if
(
match
)
{
if
(
sofia_glue_tech_choose_port
(
tech_pvt
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
goto
done
;
}
sofia_
glue
_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
sofia_
media
_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Processing updated SDP
\n
"
);
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_REINVITE
);
...
...
@@ -6281,7 +6281,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
int
is_ok
=
1
;
if
(
tech_pvt
->
num_codecs
)
{
match
=
sofia_
glue
_negotiate_sdp
(
session
,
r_sdp
);
match
=
sofia_
media
_negotiate_sdp
(
session
,
r_sdp
);
}
if
(
match
)
{
...
...
@@ -6377,7 +6377,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
uint8_t
match
=
0
;
if
(
tech_pvt
->
num_codecs
)
{
match
=
sofia_
glue
_negotiate_sdp
(
session
,
r_sdp
);
match
=
sofia_
media
_negotiate_sdp
(
session
,
r_sdp
);
}
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_ANS
);
...
...
@@ -8177,7 +8177,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
}
//sofia_glue_set_name(tech_pvt, channel_name);
sofia_
glue
_tech_prepare_codecs
(
tech_pvt
);
sofia_
media
_tech_prepare_codecs
(
tech_pvt
);
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"INBOUND CALL"
);
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
1ab88581
...
...
@@ -169,7 +169,7 @@ void sofia_glue_set_udptl_image_sdp(private_object_t *tech_pvt, switch_t38_optio
switch_snprintf
(
buf
+
strlen
(
buf
),
sizeof
(
buf
)
-
strlen
(
buf
),
"m=audio 0 RTP/AVP 19
\n
"
);
}
sofia_
glue
_tech_set_local_sdp
(
tech_pvt
,
buf
,
SWITCH_TRUE
);
sofia_
media
_tech_set_local_sdp
(
tech_pvt
,
buf
,
SWITCH_TRUE
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_DEBUG
,
"%s image media sdp:
\n
%s
\n
"
,
...
...
@@ -1153,8 +1153,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
cid_name
=
caller_profile
->
caller_id_name
;
cid_num
=
caller_profile
->
caller_id_number
;
sofia_
glue
_tech_prepare_codecs
(
tech_pvt
);
sofia_
glue
_check_video_codecs
(
tech_pvt
);
sofia_
media
_tech_prepare_codecs
(
tech_pvt
);
sofia_
media
_check_video_codecs
(
tech_pvt
);
check_decode
(
cid_name
,
session
);
check_decode
(
cid_num
,
session
);
...
...
@@ -1171,7 +1171,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
}
if
(
!
switch_channel_get_private
(
tech_pvt
->
channel
,
"t38_options"
)
||
zstr
(
tech_pvt
->
local_sdp_str
))
{
sofia_
glue
_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
sofia_
media
_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
}
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_READY
);
...
...
@@ -1593,7 +1593,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
if
(
switch_rtp_ready
(
tech_pvt
->
rtp_session
))
{
sofia_glue_tech_proxy_remote_addr
(
tech_pvt
,
NULL
);
}
sofia_
glue
_tech_patch_sdp
(
tech_pvt
);
sofia_
media
_tech_patch_sdp
(
tech_pvt
);
}
if
(
!
zstr
(
tech_pvt
->
dest
))
{
...
...
@@ -1632,7 +1632,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
tech_pvt
->
nh
->
nh_has_invite
=
1
;
}
if
((
mp
=
sofia_
glue
_get_multipart
(
session
,
SOFIA_MULTIPART_PREFIX
,
tech_pvt
->
local_sdp_str
,
&
mp_type
)))
{
if
((
mp
=
sofia_
media
_get_multipart
(
session
,
SOFIA_MULTIPART_PREFIX
,
tech_pvt
->
local_sdp_str
,
&
mp_type
)))
{
sofia_clear_flag
(
tech_pvt
,
TFLAG_ENABLE_SOA
);
}
...
...
@@ -2510,7 +2510,7 @@ int sofia_recover_callback(switch_core_session_t *session)
tech_pvt
->
pt
=
tech_pvt
->
agreed_pt
=
(
switch_payload_t
)
atoi
(
tmp
);
}
sofia_
glue
_tech_set_codec
(
tech_pvt
,
1
);
sofia_
media
_tech_set_codec
(
tech_pvt
,
1
);
tech_pvt
->
adv_sdp_audio_ip
=
tech_pvt
->
extrtpip
=
(
char
*
)
ip
;
tech_pvt
->
adv_sdp_audio_port
=
tech_pvt
->
local_sdp_audio_port
=
(
switch_port_t
)
atoi
(
port
);
...
...
@@ -2559,10 +2559,10 @@ int sofia_recover_callback(switch_core_session_t *session)
tech_pvt
->
remote_sdp_video_ip
=
(
char
*
)
r_ip
;
tech_pvt
->
remote_sdp_video_port
=
(
switch_port_t
)
atoi
(
r_port
);
}
//sofia_
glue
_tech_set_video_codec(tech_pvt, 1);
//sofia_
media
_tech_set_video_codec(tech_pvt, 1);
}
sofia_
glue
_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
1
);
sofia_
media
_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
1
);
if
(
sofia_media_activate_rtp
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
goto
end
;
...
...
src/mod/endpoints/mod_sofia/sofia_media.c
浏览文件 @
1ab88581
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论