Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
75c95fa9
提交
75c95fa9
authored
12月 22, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MILESTONE: working audio and no reference to rtp_session in all of sofia
上级
caee4cbf
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
155 行增加
和
64 行删除
+155
-64
switch_core_media.h
src/include/switch_core_media.h
+15
-16
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+11
-10
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+14
-17
sofia_media.c
src/mod/endpoints/mod_sofia/sofia_media.c
+0
-3
switch_core_media.c
src/switch_core_media.c
+115
-18
没有找到文件。
src/include/switch_core_media.h
浏览文件 @
75c95fa9
...
@@ -142,12 +142,6 @@ typedef struct switch_core_media_params_s {
...
@@ -142,12 +142,6 @@ typedef struct switch_core_media_params_s {
int
num_codecs
;
//x:tp
int
num_codecs
;
//x:tp
int
hold_laps
;
//x:tp
int
hold_laps
;
//x:tp
// HACK REMOVE ME
switch_rtp_t
*
rtp_session
;
switch_rtp_t
*
video_rtp_session
;
}
switch_core_media_params_t
;
}
switch_core_media_params_t
;
static
inline
const
char
*
switch_media_type2str
(
switch_media_type_t
type
)
static
inline
const
char
*
switch_media_type2str
(
switch_media_type_t
type
)
...
@@ -222,16 +216,21 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
...
@@ -222,16 +216,21 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
SWITCH_DECLARE
(
void
)
switch_core_media_break
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
);
SWITCH_DECLARE
(
void
)
switch_core_media_break
(
switch_core_session_t
*
session
,
switch_media_type_t
type
);
SWITCH_DECLARE
(
void
)
switch_core_media_kill_socket
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
);
SWITCH_DECLARE
(
void
)
switch_core_media_kill_socket
(
switch_core_session_t
*
session
,
switch_media_type_t
type
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_queue_rfc2833
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
,
const
switch_dtmf_t
*
dtmf
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_queue_rfc2833
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
const
switch_dtmf_t
*
dtmf
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_queue_rfc2833_in
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
,
const
switch_dtmf_t
*
dtmf
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_queue_rfc2833_in
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
const
switch_dtmf_t
*
dtmf
);
SWITCH_DECLARE
(
uint8_t
)
switch_core_media_ready
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
);
SWITCH_DECLARE
(
uint8_t
)
switch_core_media_ready
(
switch_core_session_t
*
session
,
switch_media_type_t
type
);
SWITCH_DECLARE
(
void
)
switch_core_media_set_recv_pt
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
,
switch_payload_t
pt
);
SWITCH_DECLARE
(
void
)
switch_core_media_set_recv_pt
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
switch_payload_t
pt
);
SWITCH_DECLARE
(
void
)
switch_core_media_set_telephony_event
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
,
switch_payload_t
te
);
SWITCH_DECLARE
(
void
)
switch_core_media_set_telephony_event
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
switch_payload_t
te
);
SWITCH_DECLARE
(
void
)
switch_core_media_set_telephony_recv_event
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
,
switch_payload_t
te
);
SWITCH_DECLARE
(
void
)
switch_core_media_set_telephony_recv_event
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
switch_payload_t
te
);
SWITCH_DECLARE
(
switch_rtp_stats_t
*
)
switch_core_media_stats
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
,
switch_memory_pool_t
*
pool
);
SWITCH_DECLARE
(
switch_rtp_stats_t
*
)
switch_core_media_stats
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
switch_memory_pool_t
*
pool
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_udptl_mode
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_udptl_mode
(
switch_core_session_t
*
session
,
switch_media_type_t
type
);
SWITCH_DECLARE
(
void
)
switch_core_media_set_rtp_flag
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
switch_rtp_flag_t
flag
);
SWITCH_DECLARE
(
void
)
switch_core_media_clear_rtp_flag
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
switch_rtp_flag_t
flag
);
SWITCH_DECLARE
(
stfu_instance_t
*
)
switch_core_media_get_jb
(
switch_core_session_t
*
session
,
switch_media_type_t
type
);
SWITCH_DECLARE
(
switch_rtp_stats_t
*
)
switch_core_media_get_stats
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
switch_memory_pool_t
*
pool
);
SWITCH_END_EXTERN_C
SWITCH_END_EXTERN_C
#endif
#endif
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
75c95fa9
...
@@ -5154,14 +5154,14 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
...
@@ -5154,14 +5154,14 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
}
}
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
)
&&
has_t38
)
{
if
(
switch_channel_test_flag
(
channel
,
CF_PROXY_MEDIA
)
&&
has_t38
)
{
if
(
switch_core_media_ready
(
tech_pvt
->
media_handle
,
SWITCH_MEDIA_TYPE_AUDIO
))
{
if
(
switch_core_media_ready
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
))
{
switch_core_media_udptl_mode
(
tech_pvt
->
media_handle
,
SWITCH_MEDIA_TYPE_AUDIO
);
switch_core_media_udptl_mode
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
);
if
((
uuid
=
switch_channel_get_partner_uuid
(
channel
))
&&
(
other_session
=
switch_core_session_locate
(
uuid
)))
{
if
((
uuid
=
switch_channel_get_partner_uuid
(
channel
))
&&
(
other_session
=
switch_core_session_locate
(
uuid
)))
{
if
(
switch_core_session_compare
(
session
,
other_session
))
{
if
(
switch_core_session_compare
(
session
,
other_session
))
{
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
);
if
(
switch_
rtp_ready
(
other_tech_pvt
->
rtp_session
))
{
if
(
switch_
core_media_ready
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
))
{
switch_
rtp_udptl_mode
(
other_tech_pvt
->
rtp_session
);
switch_
core_media_udptl_mode
(
other_tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
);
}
}
}
}
switch_core_session_rwunlock
(
other_session
);
switch_core_session_rwunlock
(
other_session
);
...
@@ -5234,9 +5234,10 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
...
@@ -5234,9 +5234,10 @@ 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
(
switch_core_media_ready
(
tech_pvt
->
media_handle
,
SWITCH_MEDIA_TYPE_AUDIO
)
&&
switch_rtp_ready
(
other_tech_pvt
->
rtp_session
))
{
if
(
switch_core_media_ready
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
)
&&
switch_core_media_ready
(
other_tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
))
{
switch_channel_clear_flag
(
tech_pvt
->
channel
,
CF_NOTIMER_DURING_BRIDGE
);
switch_channel_clear_flag
(
tech_pvt
->
channel
,
CF_NOTIMER_DURING_BRIDGE
);
switch_core_media_udptl_mode
(
tech_pvt
->
media_handle
,
SWITCH_MEDIA_TYPE_AUDIO
);
switch_core_media_udptl_mode
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_INFO
,
"Activating T38 Passthru
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_INFO
,
"Activating T38 Passthru
\n
"
);
}
}
}
}
...
@@ -5387,8 +5388,8 @@ void *SWITCH_THREAD_FUNC media_on_hold_thread_run(switch_thread_t *thread, void
...
@@ -5387,8 +5388,8 @@ void *SWITCH_THREAD_FUNC media_on_hold_thread_run(switch_thread_t *thread, void
switch_ivr_media
(
switch_core_session_get_uuid
(
other_session
),
SMF_REBRIDGE
);
switch_ivr_media
(
switch_core_session_get_uuid
(
other_session
),
SMF_REBRIDGE
);
if
(
tech_pvt
->
rtp_session
)
{
if
(
switch_core_media_ready
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
)
)
{
switch_
rtp_clear_flag
(
tech_pvt
->
rtp_session
,
SWITCH_RTP_FLAG_AUTOADJ
);
switch_
core_media_clear_rtp_flag
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
SWITCH_RTP_FLAG_AUTOADJ
);
}
}
switch_core_media_toggle_hold
(
session
,
1
);
switch_core_media_toggle_hold
(
session
,
1
);
...
@@ -5998,7 +5999,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
...
@@ -5998,7 +5999,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
}
if
(
!
switch_core_media_ready
(
tech_pvt
->
media_handle
,
SWITCH_MEDIA_TYPE_AUDIO
))
{
if
(
!
switch_core_media_ready
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
))
{
switch_core_media_prepare_codecs
(
tech_pvt
->
session
,
SWITCH_FALSE
);
switch_core_media_prepare_codecs
(
tech_pvt
->
session
,
SWITCH_FALSE
);
if
((
status
=
switch_core_media_choose_port
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
0
))
!=
SWITCH_STATUS_SUCCESS
)
{
if
((
status
=
switch_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_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
...
@@ -6156,7 +6157,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
...
@@ -6156,7 +6157,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
}
break
;
break
;
case
nua_callstate_ready
:
case
nua_callstate_ready
:
if
(
r_sdp
&&
!
is_dup_sdp
&&
switch_core_media_ready
(
tech_pvt
->
media_handle
,
SWITCH_MEDIA_TYPE_AUDIO
)
&&
!
sofia_test_flag
(
tech_pvt
,
TFLAG_NOSDP_REINVITE
))
{
if
(
r_sdp
&&
!
is_dup_sdp
&&
switch_core_media_ready
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
)
&&
!
sofia_test_flag
(
tech_pvt
,
TFLAG_NOSDP_REINVITE
))
{
/* sdp changed since 18X w sdp, we're supposed to ignore it but we, of course, were pressured into supporting it */
/* sdp changed since 18X w sdp, we're supposed to ignore it but we, of course, were pressured into supporting it */
uint8_t
match
=
0
;
uint8_t
match
=
0
;
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
75c95fa9
...
@@ -1142,7 +1142,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
...
@@ -1142,7 +1142,7 @@ 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_core_media_ready
(
tech_pvt
->
media_handle
,
SWITCH_MEDIA_TYPE_AUDIO
))
{
if
(
switch_core_media_ready
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
))
{
switch_core_media_proxy_remote_addr
(
session
,
NULL
);
switch_core_media_proxy_remote_addr
(
session
,
NULL
);
}
}
switch_core_media_patch_sdp
(
tech_pvt
->
session
);
switch_core_media_patch_sdp
(
tech_pvt
->
session
);
...
@@ -1325,11 +1325,13 @@ void sofia_glue_do_xfer_invite(switch_core_session_t *session)
...
@@ -1325,11 +1325,13 @@ void sofia_glue_do_xfer_invite(switch_core_session_t *session)
#define add_stat(_i, _s) \
#define add_stat(_i, _s) \
switch_snprintf(var_name, sizeof(var_name), "rtp_%s_%s", switch_str_nil(prefix), _s) ; \
switch_snprintf(var_name, sizeof(var_name), "rtp_%s_%s", switch_str_nil(prefix), _s) ; \
switch_snprintf(var_val, sizeof(var_val), "%" SWITCH_SIZE_T_FMT, _i); \
switch_snprintf(var_val, sizeof(var_val), "%" SWITCH_SIZE_T_FMT, _i); \
switch_channel_set_variable(
tech_pvt->
channel, var_name, var_val)
switch_channel_set_variable(channel, var_name, var_val)
static
void
set_stats
(
switch_
rtp_t
*
rtp_session
,
private_object_t
*
tech_pvt
,
const
char
*
prefix
)
static
void
set_stats
(
switch_
core_session_t
*
session
,
switch_media_type_t
type
,
const
char
*
prefix
)
{
{
switch_rtp_stats_t
*
stats
=
switch_rtp_get_stats
(
rtp_session
,
NULL
);
switch_rtp_stats_t
*
stats
=
switch_core_media_get_stats
(
session
,
type
,
NULL
);
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
char
var_name
[
256
]
=
""
,
var_val
[
35
]
=
""
;
char
var_name
[
256
]
=
""
,
var_val
[
35
]
=
""
;
if
(
stats
)
{
if
(
stats
)
{
...
@@ -1361,13 +1363,8 @@ static void set_stats(switch_rtp_t *rtp_session, private_object_t *tech_pvt, con
...
@@ -1361,13 +1363,8 @@ static void set_stats(switch_rtp_t *rtp_session, private_object_t *tech_pvt, con
void
sofia_glue_set_rtp_stats
(
private_object_t
*
tech_pvt
)
void
sofia_glue_set_rtp_stats
(
private_object_t
*
tech_pvt
)
{
{
if
(
tech_pvt
->
rtp_session
)
{
set_stats
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
"audio"
);
set_stats
(
tech_pvt
->
rtp_session
,
tech_pvt
,
"audio"
);
set_stats
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_VIDEO
,
"video"
);
}
if
(
tech_pvt
->
video_rtp_session
)
{
set_stats
(
tech_pvt
->
video_rtp_session
,
tech_pvt
,
"video"
);
}
}
}
/* map sip responses to QSIG cause codes ala RFC4497 section 8.4.4 */
/* map sip responses to QSIG cause codes ala RFC4497 section 8.4.4 */
...
@@ -1991,24 +1988,24 @@ int sofia_recover_callback(switch_core_session_t *session)
...
@@ -1991,24 +1988,24 @@ int sofia_recover_callback(switch_core_session_t *session)
goto
end
;
goto
end
;
}
}
if
(
switch_core_media_ready
(
tech_pvt
->
media_handle
,
SWITCH_MEDIA_TYPE_AUDIO
))
{
if
(
switch_core_media_ready
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
))
{
if
((
tmp
=
switch_channel_get_variable
(
channel
,
"sip_audio_recv_pt"
)))
{
if
((
tmp
=
switch_channel_get_variable
(
channel
,
"sip_audio_recv_pt"
)))
{
switch_core_media_set_recv_pt
(
tech_pvt
->
media_handle
,
SWITCH_MEDIA_TYPE_AUDIO
,
(
switch_payload_t
)
atoi
(
tmp
));
switch_core_media_set_recv_pt
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
(
switch_payload_t
)
atoi
(
tmp
));
}
}
}
}
if
(
switch_core_media_ready
(
tech_pvt
->
media_handle
,
SWITCH_MEDIA_TYPE_VIDEO
))
{
if
(
switch_core_media_ready
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_VIDEO
))
{
if
((
tmp
=
switch_channel_get_variable
(
channel
,
"sip_video_recv_pt"
)))
{
if
((
tmp
=
switch_channel_get_variable
(
channel
,
"sip_video_recv_pt"
)))
{
switch_core_media_set_recv_pt
(
tech_pvt
->
media_handle
,
SWITCH_MEDIA_TYPE_AUDIO
,
(
switch_payload_t
)
atoi
(
tmp
));
switch_core_media_set_recv_pt
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
(
switch_payload_t
)
atoi
(
tmp
));
}
}
}
}
if
(
tech_pvt
->
te
)
{
if
(
tech_pvt
->
te
)
{
switch_core_media_set_telephony_event
(
tech_pvt
->
media_handle
,
SWITCH_MEDIA_TYPE_AUDIO
,
tech_pvt
->
te
);
switch_core_media_set_telephony_event
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
tech_pvt
->
te
);
}
}
if
(
tech_pvt
->
recv_te
)
{
if
(
tech_pvt
->
recv_te
)
{
switch_core_media_set_telephony_recv_event
(
tech_pvt
->
media_handle
,
SWITCH_MEDIA_TYPE_AUDIO
,
tech_pvt
->
recv_te
);
switch_core_media_set_telephony_recv_event
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_AUDIO
,
tech_pvt
->
recv_te
);
}
}
}
}
...
...
src/mod/endpoints/mod_sofia/sofia_media.c
浏览文件 @
75c95fa9
...
@@ -122,9 +122,6 @@ switch_status_t sofia_media_activate_rtp(private_object_t *tech_pvt)
...
@@ -122,9 +122,6 @@ switch_status_t sofia_media_activate_rtp(private_object_t *tech_pvt)
status
=
switch_core_media_activate_rtp
(
tech_pvt
->
session
);
status
=
switch_core_media_activate_rtp
(
tech_pvt
->
session
);
switch_mutex_unlock
(
tech_pvt
->
sofia_mutex
);
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
)
{
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
sofia_set_flag
(
tech_pvt
,
TFLAG_RTP
);
sofia_set_flag
(
tech_pvt
,
TFLAG_RTP
);
...
...
src/switch_core_media.c
浏览文件 @
75c95fa9
...
@@ -386,7 +386,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_process_t38_passthru(switch_co
...
@@ -386,7 +386,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_process_t38_passthru(switch_co
switch_media_handle_t
*
smh
;
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
if
(
!
(
smh
=
session
->
media_handle
))
{
return
SWITCH_STATUS_FALSE
;
;
return
SWITCH_STATUS_FALSE
;
}
}
a_engine
=
&
smh
->
engines
[
SWITCH_MEDIA_TYPE_AUDIO
];
a_engine
=
&
smh
->
engines
[
SWITCH_MEDIA_TYPE_AUDIO
];
...
@@ -2931,7 +2931,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
...
@@ -2931,7 +2931,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
switch_media_handle_t
*
smh
;
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
if
(
!
(
smh
=
session
->
media_handle
))
{
return
SWITCH_STATUS_FALSE
;
;
return
SWITCH_STATUS_FALSE
;
}
}
a_engine
=
&
smh
->
engines
[
SWITCH_MEDIA_TYPE_AUDIO
];
a_engine
=
&
smh
->
engines
[
SWITCH_MEDIA_TYPE_AUDIO
];
...
@@ -3142,8 +3142,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
...
@@ -3142,8 +3142,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
a_engine
->
read_impl
.
samples_per_packet
,
a_engine
->
read_impl
.
samples_per_packet
,
a_engine
->
codec_params
.
codec_ms
*
1000
,
a_engine
->
codec_params
.
codec_ms
*
1000
,
flags
,
timer_name
,
&
err
,
switch_core_session_get_pool
(
session
));
flags
,
timer_name
,
&
err
,
switch_core_session_get_pool
(
session
));
//HACK REMOVE ME
smh
->
mparams
->
rtp_session
=
a_engine
->
rtp_session
;
}
}
if
(
switch_rtp_ready
(
a_engine
->
rtp_session
))
{
if
(
switch_rtp_ready
(
a_engine
->
rtp_session
))
{
...
@@ -3514,9 +3512,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
...
@@ -3514,9 +3512,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
1
,
90000
,
flags
,
NULL
,
&
err
,
switch_core_session_get_pool
(
session
));
1
,
90000
,
flags
,
NULL
,
&
err
,
switch_core_session_get_pool
(
session
));
//HACK REMOVE ME
smh
->
mparams
->
video_rtp_session
=
v_engine
->
rtp_session
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"%sVIDEO RTP [%s] %s:%d->%s:%d codec: %u ms: %d [%s]
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"%sVIDEO RTP [%s] %s:%d->%s:%d codec: %u ms: %d [%s]
\n
"
,
switch_channel_test_flag
(
session
->
channel
,
CF_PROXY_MEDIA
)
?
"PROXY "
:
""
,
switch_channel_test_flag
(
session
->
channel
,
CF_PROXY_MEDIA
)
?
"PROXY "
:
""
,
switch_channel_get_name
(
session
->
channel
),
switch_channel_get_name
(
session
->
channel
),
...
@@ -4813,7 +4808,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
...
@@ -4813,7 +4808,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
SWITCH_DECLARE
(
void
)
switch_core_media_start_udptl
(
switch_core_session_t
*
session
,
switch_t38_options_t
*
t38_options
)
SWITCH_DECLARE
(
void
)
switch_core_media_start_udptl
(
switch_core_session_t
*
session
,
switch_t38_options_t
*
t38_options
)
{
{
switch_media_handle_t
*
smh
;
switch_media_handle_t
*
smh
;
switch_rtp_engine_t
*
a_engine
;
;
switch_rtp_engine_t
*
a_engine
;
if
(
!
(
smh
=
session
->
media_handle
))
{
if
(
!
(
smh
=
session
->
media_handle
))
{
return
;
return
;
...
@@ -5234,64 +5229,146 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
...
@@ -5234,64 +5229,146 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
}
}
SWITCH_DECLARE
(
void
)
switch_core_media_break
(
switch_
media_handle_t
*
smh
,
switch_media_type_t
type
)
SWITCH_DECLARE
(
void
)
switch_core_media_break
(
switch_
core_session_t
*
session
,
switch_media_type_t
type
)
{
{
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
return
;
}
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
switch_rtp_break
(
smh
->
engines
[
type
].
rtp_session
);
switch_rtp_break
(
smh
->
engines
[
type
].
rtp_session
);
}
}
}
}
SWITCH_DECLARE
(
void
)
switch_core_media_kill_socket
(
switch_
media_handle_t
*
smh
,
switch_media_type_t
type
)
SWITCH_DECLARE
(
void
)
switch_core_media_kill_socket
(
switch_
core_session_t
*
session
,
switch_media_type_t
type
)
{
{
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
return
;
}
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
switch_rtp_kill_socket
(
smh
->
engines
[
type
].
rtp_session
);
switch_rtp_kill_socket
(
smh
->
engines
[
type
].
rtp_session
);
}
}
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_queue_rfc2833
(
switch_
media_handle_t
*
smh
,
switch_media_type_t
type
,
const
switch_dtmf_t
*
dtmf
)
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_queue_rfc2833
(
switch_
core_session_t
*
session
,
switch_media_type_t
type
,
const
switch_dtmf_t
*
dtmf
)
{
{
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
return
SWITCH_STATUS_FALSE
;
}
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
return
switch_rtp_queue_rfc2833
(
smh
->
engines
[
type
].
rtp_session
,
dtmf
);
return
switch_rtp_queue_rfc2833
(
smh
->
engines
[
type
].
rtp_session
,
dtmf
);
}
}
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_queue_rfc2833_in
(
switch_
media_handle_t
*
smh
,
switch_media_type_t
type
,
const
switch_dtmf_t
*
dtmf
)
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_queue_rfc2833_in
(
switch_
core_session_t
*
session
,
switch_media_type_t
type
,
const
switch_dtmf_t
*
dtmf
)
{
{
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
return
SWITCH_STATUS_FALSE
;
}
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
return
switch_rtp_queue_rfc2833_in
(
smh
->
engines
[
type
].
rtp_session
,
dtmf
);
return
switch_rtp_queue_rfc2833_in
(
smh
->
engines
[
type
].
rtp_session
,
dtmf
);
}
}
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
}
}
SWITCH_DECLARE
(
uint8_t
)
switch_core_media_ready
(
switch_
media_handle_t
*
smh
,
switch_media_type_t
type
)
SWITCH_DECLARE
(
uint8_t
)
switch_core_media_ready
(
switch_
core_session_t
*
session
,
switch_media_type_t
type
)
{
{
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
return
0
;
}
return
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
);
return
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
);
}
}
SWITCH_DECLARE
(
void
)
switch_core_media_set_recv_pt
(
switch_media_handle_t
*
smh
,
switch_media_type_t
type
,
switch_payload_t
pt
)
SWITCH_DECLARE
(
void
)
switch_core_media_set_rtp_flag
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
switch_rtp_flag_t
flag
)
{
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
return
;
}
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
switch_rtp_set_flag
(
smh
->
engines
[
type
].
rtp_session
,
flag
);
}
}
SWITCH_DECLARE
(
void
)
switch_core_media_clear_rtp_flag
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
switch_rtp_flag_t
flag
)
{
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
return
;
}
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
switch_rtp_clear_flag
(
smh
->
engines
[
type
].
rtp_session
,
flag
);
}
}
SWITCH_DECLARE
(
void
)
switch_core_media_set_recv_pt
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
switch_payload_t
pt
)
{
{
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
return
;
}
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
switch_rtp_set_recv_pt
(
smh
->
engines
[
type
].
rtp_session
,
pt
);
switch_rtp_set_recv_pt
(
smh
->
engines
[
type
].
rtp_session
,
pt
);
}
}
}
}
SWITCH_DECLARE
(
void
)
switch_core_media_set_telephony_event
(
switch_
media_handle_t
*
smh
,
switch_media_type_t
type
,
switch_payload_t
te
)
SWITCH_DECLARE
(
void
)
switch_core_media_set_telephony_event
(
switch_
core_session_t
*
session
,
switch_media_type_t
type
,
switch_payload_t
te
)
{
{
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
return
;
}
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
switch_rtp_set_telephony_event
(
smh
->
engines
[
type
].
rtp_session
,
te
);
switch_rtp_set_telephony_event
(
smh
->
engines
[
type
].
rtp_session
,
te
);
}
}
}
}
SWITCH_DECLARE
(
void
)
switch_core_media_set_telephony_recv_event
(
switch_
media_handle_t
*
smh
,
switch_media_type_t
type
,
switch_payload_t
te
)
SWITCH_DECLARE
(
void
)
switch_core_media_set_telephony_recv_event
(
switch_
core_session_t
*
session
,
switch_media_type_t
type
,
switch_payload_t
te
)
{
{
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
return
;
}
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
switch_rtp_set_telephony_recv_event
(
smh
->
engines
[
type
].
rtp_session
,
te
);
switch_rtp_set_telephony_recv_event
(
smh
->
engines
[
type
].
rtp_session
,
te
);
}
}
}
}
SWITCH_DECLARE
(
switch_rtp_stats_t
*
)
switch_core_media_get_stats
(
switch_
media_handle_t
*
smh
,
switch_media_type_t
type
,
switch_memory_pool_t
*
pool
)
SWITCH_DECLARE
(
switch_rtp_stats_t
*
)
switch_core_media_get_stats
(
switch_
core_session_t
*
session
,
switch_media_type_t
type
,
switch_memory_pool_t
*
pool
)
{
{
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
return
NULL
;
}
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
return
switch_rtp_get_stats
(
smh
->
engines
[
type
].
rtp_session
,
pool
);
return
switch_rtp_get_stats
(
smh
->
engines
[
type
].
rtp_session
,
pool
);
}
}
...
@@ -5299,15 +5376,35 @@ SWITCH_DECLARE(switch_rtp_stats_t *) switch_core_media_get_stats(switch_media_ha
...
@@ -5299,15 +5376,35 @@ SWITCH_DECLARE(switch_rtp_stats_t *) switch_core_media_get_stats(switch_media_ha
return
NULL
;
return
NULL
;
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_udptl_mode
(
switch_
media_handle_t
*
smh
,
switch_media_type_t
type
)
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_udptl_mode
(
switch_
core_session_t
*
session
,
switch_media_type_t
type
)
{
{
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
return
SWITCH_STATUS_FALSE
;
}
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
return
switch_rtp_udptl_mode
(
smh
->
engines
[
type
].
rtp_session
);
return
switch_rtp_udptl_mode
(
smh
->
engines
[
type
].
rtp_session
);
}
}
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
}
}
SWITCH_DECLARE
(
stfu_instance_t
*
)
switch_core_media_get_jb
(
switch_core_session_t
*
session
,
switch_media_type_t
type
)
{
switch_media_handle_t
*
smh
;
if
(
!
(
smh
=
session
->
media_handle
))
{
return
NULL
;
}
if
(
switch_rtp_ready
(
smh
->
engines
[
type
].
rtp_session
))
{
return
switch_rtp_get_jitter_buffer
(
smh
->
engines
[
type
].
rtp_session
);
}
return
NULL
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论