Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b92560c5
提交
b92560c5
authored
12月 05, 2012
作者:
Anthony Minessale
提交者:
Ken Rice
12月 06, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-4808 try this
上级
94d044d2
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
20 行增加
和
9 行删除
+20
-9
mod_dingaling.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
+20
-9
没有找到文件。
src/mod/endpoints/mod_dingaling/mod_dingaling.c
浏览文件 @
b92560c5
...
@@ -83,7 +83,8 @@ typedef enum {
...
@@ -83,7 +83,8 @@ typedef enum {
TFLAG_TRANSPORT_ACCEPT
=
(
1
<<
22
),
TFLAG_TRANSPORT_ACCEPT
=
(
1
<<
22
),
TFLAG_READY
=
(
1
<<
23
),
TFLAG_READY
=
(
1
<<
23
),
TFLAG_NAT_MAP
=
(
1
<<
24
),
TFLAG_NAT_MAP
=
(
1
<<
24
),
TFLAG_SECURE
=
(
1
<<
25
)
TFLAG_SECURE
=
(
1
<<
25
),
TFLAG_VIDEO_RTP_READY
=
(
1
<<
7
)
}
TFLAGS
;
}
TFLAGS
;
typedef
enum
{
typedef
enum
{
...
@@ -240,7 +241,7 @@ struct private_object {
...
@@ -240,7 +241,7 @@ struct private_object {
switch_mutex_t
*
flag_mutex
;
switch_mutex_t
*
flag_mutex
;
int
read_count
;
int
read_count
;
switch_time_t
audio_ready
;
};
};
...
@@ -1345,10 +1346,6 @@ static int activate_video_rtp(struct private_object *tech_pvt)
...
@@ -1345,10 +1346,6 @@ static int activate_video_rtp(struct private_object *tech_pvt)
switch_rtp_destroy
(
&
tech_pvt
->
transports
[
LDL_TPORT_VIDEO_RTP
].
rtp_session
);
switch_rtp_destroy
(
&
tech_pvt
->
transports
[
LDL_TPORT_VIDEO_RTP
].
rtp_session
);
}
}
}
else
{
}
else
{
if
(
switch_core_codec_init
(
&
tech_pvt
->
transports
[
LDL_TPORT_VIDEO_RTP
].
read_codec
,
if
(
switch_core_codec_init
(
&
tech_pvt
->
transports
[
LDL_TPORT_VIDEO_RTP
].
read_codec
,
tech_pvt
->
transports
[
LDL_TPORT_VIDEO_RTP
].
codec_name
,
tech_pvt
->
transports
[
LDL_TPORT_VIDEO_RTP
].
codec_name
,
...
@@ -1460,6 +1457,7 @@ static int activate_video_rtp(struct private_object *tech_pvt)
...
@@ -1460,6 +1457,7 @@ static int activate_video_rtp(struct private_object *tech_pvt)
tech_pvt
->
transports
[
LDL_TPORT_VIDEO_RTP
].
local_user
,
tech_pvt
->
transports
[
LDL_TPORT_VIDEO_RTP
].
local_user
,
NULL
);
//tech_pvt->transports[LDL_TPORT_VIDEO_RTP].remote_pass);
NULL
);
//tech_pvt->transports[LDL_TPORT_VIDEO_RTP].remote_pass);
switch_channel_set_flag
(
channel
,
CF_VIDEO
);
switch_channel_set_flag
(
channel
,
CF_VIDEO
);
switch_set_flag
(
tech_pvt
,
TFLAG_VIDEO_RTP_READY
);
//switch_rtp_set_default_payload(tech_pvt->transports[LDL_TPORT_VIDEO_RTP].rtp_session, tech_pvt->transports[LDL_TPORT_VIDEO_RTP].codec_num);
//switch_rtp_set_default_payload(tech_pvt->transports[LDL_TPORT_VIDEO_RTP].rtp_session, tech_pvt->transports[LDL_TPORT_VIDEO_RTP].codec_num);
//switch_rtp_set_recv_pt(tech_pvt->transports[LDL_TPORT_VIDEO_RTP].rtp_session, tech_pvt->transports[LDL_TPORT_VIDEO_RTP].codec_num);
//switch_rtp_set_recv_pt(tech_pvt->transports[LDL_TPORT_VIDEO_RTP].rtp_session, tech_pvt->transports[LDL_TPORT_VIDEO_RTP].codec_num);
...
@@ -1491,11 +1489,15 @@ static int activate_rtp(struct private_object *tech_pvt)
...
@@ -1491,11 +1489,15 @@ static int activate_rtp(struct private_object *tech_pvt)
int
r
=
0
;
int
r
=
0
;
if
(
tech_pvt
->
transports
[
LDL_TPORT_RTP
].
ready
)
{
if
(
tech_pvt
->
transports
[
LDL_TPORT_RTP
].
ready
)
{
r
+=
activate_audio_rtp
(
tech_pvt
);
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_OUTBOUND
)
||
tech_pvt
->
transports
[
LDL_TPORT_RTCP
].
accepted
)
{
r
+=
activate_audio_rtp
(
tech_pvt
);
}
}
}
if
(
tech_pvt
->
transports
[
LDL_TPORT_VIDEO_RTP
].
ready
)
{
if
(
tech_pvt
->
transports
[
LDL_TPORT_VIDEO_RTP
].
ready
)
{
r
+=
activate_video_rtp
(
tech_pvt
);
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_OUTBOUND
)
||
tech_pvt
->
transports
[
LDL_TPORT_VIDEO_RTCP
].
accepted
)
{
r
+=
activate_video_rtp
(
tech_pvt
);
}
}
}
return
r
;
return
r
;
...
@@ -1631,6 +1633,7 @@ static int do_candidates(struct private_object *tech_pvt, int force)
...
@@ -1631,6 +1633,7 @@ static int do_candidates(struct private_object *tech_pvt, int force)
if
((
tech_pvt
->
transports
[
LDL_TPORT_RTP
].
ready
&&
tech_pvt
->
transports
[
LDL_TPORT_RTCP
].
ready
))
{
if
((
tech_pvt
->
transports
[
LDL_TPORT_RTP
].
ready
&&
tech_pvt
->
transports
[
LDL_TPORT_RTCP
].
ready
))
{
switch_set_flag_locked
(
tech_pvt
,
TFLAG_TRANSPORT
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_TRANSPORT
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_RTP_READY
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_RTP_READY
);
tech_pvt
->
audio_ready
=
switch_micro_time_now
();
}
}
...
@@ -1793,7 +1796,7 @@ static switch_status_t negotiate_media(switch_core_session_t *session)
...
@@ -1793,7 +1796,7 @@ static switch_status_t negotiate_media(switch_core_session_t *session)
struct
private_object
*
tech_pvt
=
NULL
;
struct
private_object
*
tech_pvt
=
NULL
;
switch_time_t
started
;
switch_time_t
started
;
switch_time_t
now
;
switch_time_t
now
;
unsigned
int
elapsed
;
unsigned
int
elapsed
,
audio_elapsed
;
tech_pvt
=
switch_core_session_get_private
(
session
);
tech_pvt
=
switch_core_session_get_private
(
session
);
switch_assert
(
tech_pvt
!=
NULL
);
switch_assert
(
tech_pvt
!=
NULL
);
...
@@ -1815,12 +1818,20 @@ static switch_status_t negotiate_media(switch_core_session_t *session)
...
@@ -1815,12 +1818,20 @@ static switch_status_t negotiate_media(switch_core_session_t *session)
while
(
!
(
switch_test_flag
(
tech_pvt
,
TFLAG_CODEC_READY
)
&&
while
(
!
(
switch_test_flag
(
tech_pvt
,
TFLAG_CODEC_READY
)
&&
switch_test_flag
(
tech_pvt
,
TFLAG_RTP_READY
)
&&
switch_test_flag
(
tech_pvt
,
TFLAG_RTP_READY
)
&&
(
switch_test_flag
(
tech_pvt
,
TFLAG_OUTBOUND
)
||
switch_test_flag
(
tech_pvt
,
TFLAG_VIDEO_RTP_READY
))
&&
switch_test_flag
(
tech_pvt
,
TFLAG_ANSWER
)
&&
switch_test_flag
(
tech_pvt
,
TFLAG_TRANSPORT_ACCEPT
)
&&
//tech_pvt->read_count &&
switch_test_flag
(
tech_pvt
,
TFLAG_ANSWER
)
&&
switch_test_flag
(
tech_pvt
,
TFLAG_TRANSPORT_ACCEPT
)
&&
//tech_pvt->read_count &&
tech_pvt
->
transports
[
LDL_TPORT_RTP
].
remote_ip
&&
tech_pvt
->
transports
[
LDL_TPORT_RTP
].
remote_port
&&
switch_test_flag
(
tech_pvt
,
TFLAG_TRANSPORT
)))
{
tech_pvt
->
transports
[
LDL_TPORT_RTP
].
remote_ip
&&
tech_pvt
->
transports
[
LDL_TPORT_RTP
].
remote_port
&&
switch_test_flag
(
tech_pvt
,
TFLAG_TRANSPORT
)))
{
now
=
switch_micro_time_now
();
now
=
switch_micro_time_now
();
elapsed
=
(
unsigned
int
)
((
now
-
started
)
/
1000
);
elapsed
=
(
unsigned
int
)
((
now
-
started
)
/
1000
);
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_RTP_READY
)
&&
!
switch_test_flag
(
tech_pvt
,
TFLAG_VIDEO_RTP_READY
))
{
audio_elapsed
=
(
unsigned
int
)
((
now
-
tech_pvt
->
audio_ready
)
/
1000
);
if
(
audio_elapsed
>
1000
)
{
switch_set_flag
(
tech_pvt
,
TFLAG_VIDEO_RTP_READY
);
}
}
if
(
switch_channel_down
(
channel
)
||
switch_test_flag
(
tech_pvt
,
TFLAG_BYE
))
{
if
(
switch_channel_down
(
channel
)
||
switch_test_flag
(
tech_pvt
,
TFLAG_BYE
))
{
goto
out
;
goto
out
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论