Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d012c5f3
提交
d012c5f3
authored
12月 22, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
omg it can make calls ... long way to go ...
上级
48554d1a
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
97 行增加
和
135 行删除
+97
-135
switch_core_media.h
src/include/switch_core_media.h
+16
-0
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+2
-12
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+23
-23
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+12
-5
sofia_media.c
src/mod/endpoints/mod_sofia/sofia_media.c
+5
-64
switch_core_media.c
src/switch_core_media.c
+38
-31
switch_ivr_play_say.c
src/switch_ivr_play_say.c
+1
-0
没有找到文件。
src/include/switch_core_media.h
浏览文件 @
d012c5f3
...
...
@@ -138,6 +138,13 @@ typedef struct switch_core_media_params_s {
char
*
adv_sdp_audio_ip
;
int
num_codecs
;
//x:tp
// HACK REMOVE ME
switch_rtp_t
*
rtp_session
;
switch_rtp_t
*
video_rtp_session
;
}
switch_core_media_params_t
;
static
inline
const
char
*
switch_media_type2str
(
switch_media_type_t
type
)
...
...
@@ -202,6 +209,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_ext_address_lookup
(
switch_core_session_t
*
session
,
char
**
ip
,
switch_port_t
*
port
,
const
char
*
sourceip
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_process_t38_passthru
(
switch_core_session_t
*
session
,
switch_core_session_t
*
other_session
,
switch_t38_options_t
*
t38_options
);
SWITCH_DECLARE
(
void
)
switch_core_media_gen_local_sdp
(
switch_core_session_t
*
session
,
const
char
*
ip
,
switch_port_t
port
,
const
char
*
sr
,
int
force
);
SWITCH_DECLARE
(
void
)
switch_core_media_set_local_sdp
(
switch_core_session_t
*
session
,
const
char
*
sdp_str
,
switch_bool_t
dup
);
SWITCH_DECLARE
(
void
)
switch_core_media_patch_sdp
(
switch_core_session_t
*
session
);
SWITCH_DECLARE
(
void
)
switch_core_media_set_image_sdp
(
switch_core_session_t
*
session
,
switch_t38_options_t
*
t38_options
,
int
insist
);
SWITCH_DECLARE
(
void
)
switch_core_media_prepare_codecs
(
switch_core_session_t
*
session
,
switch_bool_t
force
);
SWITCH_END_EXTERN_C
#endif
...
...
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
d012c5f3
...
...
@@ -685,7 +685,7 @@ struct private_object {
char
*
codec_order
[
SWITCH_MAX_CODECS
];
int
codec_order_last
;
const
switch_codec_implementation_t
*
codecs
[
SWITCH_MAX_CODECS
];
int
num_codecs
;
const
switch_codec_implementation_t
*
negotiated_codecs
[
SWITCH_MAX_CODECS
];
int
num_negotiated_codecs
;
switch_codec_t
read_codec
;
...
...
@@ -873,18 +873,10 @@ void sofia_glue_global_standby(switch_bool_t on);
switch_status_t
sofia_media_activate_rtp
(
private_object_t
*
tech_pvt
);
void
sofia_glue_deactivate_rtp
(
private_object_t
*
tech_pvt
);
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_media_tech_prepare_codecs
(
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
);
switch_status_t
sofia_glue_tech_choose_port
(
private_object_t
*
tech_pvt
,
int
force
);
switch_status_t
sofia_glue_do_invite
(
switch_core_session_t
*
session
);
uint8_t
sofia_media_negotiate_sdp
(
switch_core_session_t
*
session
,
const
char
*
r_sdp
);
...
...
@@ -1069,7 +1061,7 @@ char *sofia_glue_strip_uri(const char *str);
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_media_tech_patch_sdp
(
private_object_t
*
tech_pvt
);
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
);
...
...
@@ -1086,7 +1078,6 @@ void sofia_reg_send_reboot(sofia_profile_t *profile, const char *callid, const c
void
sofia_glue_restart_all_profiles
(
void
);
const
char
*
sofia_state_string
(
int
state
);
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
);
/*
* Logging control functions
...
...
@@ -1111,7 +1102,6 @@ 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_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
);
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
d012c5f3
...
...
@@ -5805,7 +5805,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
else
{
uint8_t
match
=
0
;
if
(
tech_pvt
->
num_codecs
)
{
if
(
tech_pvt
->
mparams
->
num_codecs
)
{
match
=
sofia_media_negotiate_sdp
(
session
,
r_sdp
);
}
...
...
@@ -5888,8 +5888,8 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_MANDATORY_IE_MISSING
);
}
else
{
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"RECEIVED_NOSDP"
);
s
ofia_glue_tech_choose_port
(
tech_pvt
,
0
);
s
ofia_media_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
s
witch_core_media_choose_port
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
0
);
s
witch_core_media_gen_local_sdp
(
session
,
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
))
{
...
...
@@ -5911,8 +5911,8 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
// 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"
);
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_3PCC
);
//s
ofia_glue_tech_choose_port(tech_pvt
, 0);
//s
ofia_media_set_local_sdp(tech_pvt
, NULL, 0, NULL, 0);
//s
witch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO
, 0);
//s
witch_core_media_gen_local_sdp(session
, 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
);
...
...
@@ -5980,14 +5980,14 @@ 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
);
s
ofia_media_tech_set_local_sdp
(
tech_pvt
,
NULL
,
SWITCH_FALSE
);
s
witch_core_media_set_local_sdp
(
tech_pvt
->
session
,
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
;
s
ofia_media_tech_prepare_codecs
(
tech_pvt
);
s
witch_core_media_prepare_codecs
(
tech_pvt
->
session
,
SWITCH_TRUE
);
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
;
...
...
@@ -5999,14 +5999,14 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if
(
!
switch_rtp_ready
(
tech_pvt
->
rtp_session
))
{
s
ofia_media_tech_prepare_codecs
(
tech_pvt
);
if
((
status
=
s
ofia_glue_tech_choose_port
(
tech_pvt
,
0
))
!=
SWITCH_STATUS_SUCCESS
)
{
s
witch_core_media_prepare_codecs
(
tech_pvt
->
session
,
SWITCH_FALSE
);
if
((
status
=
s
witch_core_media_choose_port
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
0
))
!=
SWITCH_STATUS_SUCCESS
)
{
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
switch_core_session_rwunlock
(
other_session
);
goto
done
;
}
}
s
ofia_media_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
1
);
s
witch_core_media_gen_local_sdp
(
session
,
NULL
,
0
,
NULL
,
1
);
if
(
sofia_use_soa
(
tech_pvt
))
{
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
...
...
@@ -6098,7 +6098,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_REINVITE
);
if
(
tech_pvt
->
num_codecs
)
{
if
(
tech_pvt
->
mparams
->
num_codecs
)
{
match
=
sofia_media_negotiate_sdp
(
session
,
r_sdp
);
}
...
...
@@ -6108,11 +6108,11 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
if
(
match
)
{
if
(
s
ofia_glue_tech_choose_port
(
tech_pvt
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
s
witch_core_media_choose_port
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
goto
done
;
}
s
ofia_media_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
s
witch_core_media_gen_local_sdp
(
session
,
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
"
);
...
...
@@ -6131,7 +6131,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
))
{
s
ofia_media_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
s
witch_core_media_gen_local_sdp
(
session
,
NULL
,
0
,
NULL
,
0
);
}
if
(
sofia_use_soa
(
tech_pvt
))
{
nua_respond
(
tech_pvt
->
nh
,
SIP_200_OK
,
...
...
@@ -6162,14 +6162,14 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_REINVITE
);
if
(
tech_pvt
->
num_codecs
)
{
if
(
tech_pvt
->
mparams
->
num_codecs
)
{
match
=
sofia_media_negotiate_sdp
(
session
,
r_sdp
);
}
if
(
match
)
{
if
(
s
ofia_glue_tech_choose_port
(
tech_pvt
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
s
witch_core_media_choose_port
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
goto
done
;
}
s
ofia_media_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
s
witch_core_media_gen_local_sdp
(
session
,
NULL
,
0
,
NULL
,
0
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"Processing updated SDP
\n
"
);
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_REINVITE
);
...
...
@@ -6222,7 +6222,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
uint8_t
match
=
0
;
int
is_ok
=
1
;
if
(
tech_pvt
->
num_codecs
)
{
if
(
tech_pvt
->
mparams
->
num_codecs
)
{
match
=
sofia_media_negotiate_sdp
(
session
,
r_sdp
);
}
...
...
@@ -6255,7 +6255,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_REINVITE
);
tech_pvt
->
nh
=
tech_pvt
->
nh2
;
tech_pvt
->
nh2
=
NULL
;
if
(
s
ofia_glue_tech_choose_port
(
tech_pvt
,
0
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
s
witch_core_media_choose_port
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
0
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
sofia_media_activate_rtp
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Cheater Reinvite RTP Error!
\n
"
);
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
...
...
@@ -6318,7 +6318,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
else
{
uint8_t
match
=
0
;
if
(
tech_pvt
->
num_codecs
)
{
if
(
tech_pvt
->
mparams
->
num_codecs
)
{
match
=
sofia_media_negotiate_sdp
(
session
,
r_sdp
);
}
...
...
@@ -6327,7 +6327,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if
(
match
)
{
switch_channel_check_zrtp
(
channel
);
if
(
s
ofia_glue_tech_choose_port
(
tech_pvt
,
0
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
s
witch_core_media_choose_port
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
0
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
sofia_media_activate_rtp
(
tech_pvt
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_channel_mark_answered
(
channel
);
}
else
{
...
...
@@ -8119,7 +8119,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
}
//sofia_glue_set_name(tech_pvt, channel_name);
s
ofia_media_tech_prepare_codecs
(
tech_pvt
);
s
witch_core_media_prepare_codecs
(
tech_pvt
->
session
,
SWITCH_FALSE
);
switch_channel_set_variable
(
channel
,
SWITCH_ENDPOINT_DISPOSITION_VARIABLE
,
"INBOUND CALL"
);
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
d012c5f3
...
...
@@ -83,6 +83,9 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
switch_mutex_lock
(
profile
->
flag_mutex
);
tech_pvt
->
mparams
=
switch_core_session_alloc
(
session
,
sizeof
(
*
tech_pvt
->
mparams
));
/* copy flags from profile to the sofia private */
for
(
x
=
0
;
x
<
TFLAG_MAX
;
x
++
)
{
tech_pvt
->
flags
[
x
]
=
profile
->
flags
[
x
];
...
...
@@ -138,6 +141,8 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
switch_channel_set_cap
(
tech_pvt
->
channel
,
CC_FS_RTP
);
switch_channel_set_cap
(
tech_pvt
->
channel
,
CC_QUEUEABLE_DTMF_DELAY
);
tech_pvt
->
mparams
->
ndlb
=
tech_pvt
->
profile
->
mndlb
;
tech_pvt
->
mparams
->
inbound_codec_string
=
profile
->
inbound_codec_string
;
tech_pvt
->
mparams
->
outbound_codec_string
=
profile
->
outbound_codec_string
;
...
...
@@ -153,6 +158,8 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
tech_pvt
->
mparams
->
jb_msec
=
profile
->
jb_msec
;
tech_pvt
->
mparams
->
rtcp_audio_interval_msec
=
profile
->
rtcp_audio_interval_msec
;
tech_pvt
->
mparams
->
rtcp_video_interval_msec
=
profile
->
rtcp_video_interval_msec
;
tech_pvt
->
mparams
->
sdp_username
=
profile
->
sdp_username
;
switch_media_handle_create
(
&
tech_pvt
->
media_handle
,
session
,
tech_pvt
->
mparams
);
switch_media_handle_set_media_flags
(
tech_pvt
->
media_handle
,
tech_pvt
->
profile
->
media_flags
);
...
...
@@ -696,7 +703,7 @@ 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
;
s
ofia_media_tech_prepare_codecs
(
tech_pvt
);
s
witch_core_media_prepare_codecs
(
tech_pvt
->
session
,
SWITCH_FALSE
);
switch_core_media_check_video_codecs
(
tech_pvt
->
session
);
check_decode
(
cid_name
,
session
);
check_decode
(
cid_num
,
session
);
...
...
@@ -708,13 +715,13 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
max_forwards
=
switch_channel_get_variable
(
channel
,
SWITCH_MAX_FORWARDS_VARIABLE
);
if
((
status
=
s
ofia_glue_tech_choose_port
(
tech_pvt
,
0
))
!=
SWITCH_STATUS_SUCCESS
)
{
if
((
status
=
s
witch_core_media_choose_port
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
0
))
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
tech_pvt
->
session
),
SWITCH_LOG_ERROR
,
"Port Error!
\n
"
);
return
status
;
}
if
(
!
switch_channel_get_private
(
tech_pvt
->
channel
,
"t38_options"
)
||
zstr
(
tech_pvt
->
mparams
->
local_sdp_str
))
{
s
ofia_media_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
0
);
s
witch_core_media_gen_local_sdp
(
session
,
NULL
,
0
,
NULL
,
0
);
}
sofia_set_flag_locked
(
tech_pvt
,
TFLAG_READY
);
...
...
@@ -1136,7 +1143,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
if
(
switch_rtp_ready
(
tech_pvt
->
rtp_session
))
{
switch_core_media_proxy_remote_addr
(
session
,
NULL
);
}
s
ofia_media_tech_patch_sdp
(
tech_pvt
);
s
witch_core_media_patch_sdp
(
tech_pvt
->
session
);
}
if
(
!
zstr
(
tech_pvt
->
dest
))
{
...
...
@@ -1976,7 +1983,7 @@ int sofia_recover_callback(switch_core_session_t *session)
//sofia_media_tech_set_video_codec(tech_pvt, 1);
}
s
ofia_media_set_local_sdp
(
tech_pvt
,
NULL
,
0
,
NULL
,
1
);
s
witch_core_media_gen_local_sdp
(
session
,
NULL
,
0
,
NULL
,
1
);
if
(
sofia_media_activate_rtp
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
goto
end
;
...
...
src/mod/endpoints/mod_sofia/sofia_media.c
浏览文件 @
d012c5f3
...
...
@@ -122,6 +122,10 @@ switch_status_t sofia_media_activate_rtp(private_object_t *tech_pvt)
status
=
switch_core_media_activate_rtp
(
tech_pvt
->
session
);
switch_mutex_unlock
(
tech_pvt
->
sofia_mutex
);
///HACK REMOVE ME
tech_pvt
->
rtp_session
=
tech_pvt
->
mparams
->
rtp_session
;
tech_pvt
->
video_rtp_session
=
tech_pvt
->
mparams
->
video_rtp_session
;
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
sofia_set_flag
(
tech_pvt
,
TFLAG_RTP
);
sofia_set_flag
(
tech_pvt
,
TFLAG_IO
);
...
...
@@ -394,7 +398,7 @@ switch_status_t sofia_media_tech_media(private_object_t *tech_pvt, const char *r
}
if
((
match
=
sofia_media_negotiate_sdp
(
tech_pvt
->
session
,
r_sdp
)))
{
if
(
s
ofia_glue_tech_choose_port
(
tech_pvt
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
s
witch_core_media_choose_port
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
return
SWITCH_STATUS_FALSE
;
}
if
(
sofia_media_activate_rtp
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
...
...
@@ -411,69 +415,6 @@ switch_status_t sofia_media_tech_media(private_object_t *tech_pvt, const char *r
}
void
sofia_media_tech_prepare_codecs
(
private_object_t
*
tech_pvt
)
{
const
char
*
abs
,
*
codec_string
=
NULL
;
const
char
*
ocodec
=
NULL
;
if
(
switch_channel_test_flag
(
tech_pvt
->
channel
,
CF_PROXY_MODE
)
||
switch_channel_test_flag
(
tech_pvt
->
channel
,
CF_PROXY_MEDIA
))
{
return
;
}
if
(
tech_pvt
->
num_codecs
)
{
return
;
}
tech_pvt
->
payload_space
=
0
;
switch_assert
(
tech_pvt
->
session
!=
NULL
);
if
((
abs
=
switch_channel_get_variable
(
tech_pvt
->
channel
,
"absolute_codec_string"
)))
{
/* inherit_codec == true will implicitly clear the absolute_codec_string
variable if used since it was the reason it was set in the first place and is no longer needed */
if
(
switch_true
(
switch_channel_get_variable
(
tech_pvt
->
channel
,
"inherit_codec"
)))
{
switch_channel_set_variable
(
tech_pvt
->
channel
,
"absolute_codec_string"
,
NULL
);
}
codec_string
=
abs
;
goto
ready
;
}
if
(
!
(
codec_string
=
switch_channel_get_variable
(
tech_pvt
->
channel
,
"codec_string"
)))
{
codec_string
=
switch_core_media_get_codec_string
(
tech_pvt
->
session
);
}
if
(
codec_string
&&
*
codec_string
==
'='
)
{
codec_string
++
;
goto
ready
;
}
if
((
ocodec
=
switch_channel_get_variable
(
tech_pvt
->
channel
,
SWITCH_ORIGINATOR_CODEC_VARIABLE
)))
{
if
(
!
codec_string
||
sofia_test_pflag
(
tech_pvt
->
profile
,
PFLAG_DISABLE_TRANSCODING
))
{
codec_string
=
ocodec
;
}
else
{
if
(
!
(
codec_string
=
switch_core_session_sprintf
(
tech_pvt
->
session
,
"%s,%s"
,
ocodec
,
codec_string
)))
{
codec_string
=
ocodec
;
}
}
}
ready:
if
(
codec_string
)
{
char
*
tmp_codec_string
=
switch_core_session_strdup
(
tech_pvt
->
session
,
codec_string
);
tech_pvt
->
codec_order_last
=
switch_separate_string
(
tmp_codec_string
,
','
,
tech_pvt
->
codec_order
,
SWITCH_MAX_CODECS
);
tech_pvt
->
num_codecs
=
switch_loadable_module_get_codecs_sorted
(
tech_pvt
->
codecs
,
SWITCH_MAX_CODECS
,
tech_pvt
->
codec_order
,
tech_pvt
->
codec_order_last
);
}
else
{
tech_pvt
->
num_codecs
=
switch_loadable_module_get_codecs
(
tech_pvt
->
codecs
,
sizeof
(
tech_pvt
->
codecs
)
/
sizeof
(
tech_pvt
->
codecs
[
0
]));
}
}
void
sofia_media_deactivate_rtp
(
private_object_t
*
tech_pvt
)
{
int
loops
=
0
;
...
...
src/switch_core_media.c
浏览文件 @
d012c5f3
差异被折叠。
点击展开。
src/switch_ivr_play_say.c
浏览文件 @
d012c5f3
...
...
@@ -1610,6 +1610,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
tstatus
=
switch_core_session_read_frame
(
session
,
&
read_frame
,
SWITCH_IO_FLAG_SINGLE_READ
,
0
);
if
(
!
SWITCH_READ_ACCEPTABLE
(
tstatus
))
{
break
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论