Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
c9eb818e
提交
c9eb818e
authored
3月 13, 2017
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-10120: [mod_verto] Move text support behind a param
上级
f7fa8415
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
43 行增加
和
28 行删除
+43
-28
mod_verto.c
src/mod/endpoints/mod_verto/mod_verto.c
+43
-28
没有找到文件。
src/mod/endpoints/mod_verto/mod_verto.c
浏览文件 @
c9eb818e
...
...
@@ -2443,7 +2443,7 @@ static void verto_set_media_options(verto_pvt_t *tech_pvt, verto_profile_t *prof
switch_core_media_add_ice_acl
(
tech_pvt
->
session
,
SWITCH_MEDIA_TYPE_VIDEO
,
profile
->
cand_acl
[
i
]);
}
if
(
profile
->
enable_text
)
{
if
(
profile
->
enable_text
&&
!
tech_pvt
->
text_read_buffer
)
{
set_text_funcs
(
tech_pvt
->
session
);
}
}
...
...
@@ -2619,14 +2619,15 @@ static int verto_recover_callback(switch_core_session_t *session)
tech_pvt
->
call_id
=
switch_core_session_strdup
(
session
,
switch_core_session_get_uuid
(
session
));
switch_snprintf
(
name
,
sizeof
(
name
),
"verto.rtc/%s"
,
tech_pvt
->
jsock_uuid
);
switch_channel_set_name
(
channel
,
name
);
if
((
tech_pvt
->
smh
=
switch_core_session_get_media_handle
(
session
)))
{
tech_pvt
->
mparams
=
switch_core_media_get_mparams
(
tech_pvt
->
smh
);
verto_set_media_options
(
tech_pvt
,
profile
);
}
switch_snprintf
(
name
,
sizeof
(
name
),
"verto.rtc/%s"
,
tech_pvt
->
jsock_uuid
);
switch_channel_set_name
(
channel
,
name
);
switch_channel_add_state_handler
(
channel
,
&
verto_state_handlers
);
switch_core_event_hook_add_receive_message
(
session
,
messagehook
);
...
...
@@ -3355,32 +3356,35 @@ static switch_bool_t verto__info_func(const char *method, cJSON *params, jsock_t
char
*
chardata
=
NULL
;
cJSON
*
data
;
if
((
data
=
cJSON_GetObjectItem
(
txt
,
"code"
)))
{
charbuf
[
0
]
=
data
->
valueint
;
chardata
=
charbuf
;
}
else
if
((
data
=
cJSON_GetObjectItem
(
txt
,
"chars"
)))
{
if
(
data
->
valuestring
)
{
chardata
=
data
->
valuestring
;
}
else
if
(
data
->
valueint
)
{
if
(
tech_pvt
->
text_read_buffer
)
{
if
((
data
=
cJSON_GetObjectItem
(
txt
,
"code"
)))
{
charbuf
[
0
]
=
data
->
valueint
;
chardata
=
charbuf
;
}
else
if
((
data
=
cJSON_GetObjectItem
(
txt
,
"chars"
)))
{
if
(
data
->
valuestring
)
{
chardata
=
data
->
valuestring
;
}
else
if
(
data
->
valueint
)
{
charbuf
[
0
]
=
data
->
valueint
;
chardata
=
charbuf
;
}
}
}
if
(
chardata
)
{
switch_mutex_lock
(
tech_pvt
->
text_read_mutex
);
switch_buffer_write
(
tech_pvt
->
text_read_buffer
,
chardata
,
strlen
(
chardata
));
switch_mutex_unlock
(
tech_pvt
->
text_read_mutex
);
if
(
chardata
)
{
switch_mutex_lock
(
tech_pvt
->
text_read_mutex
);
switch_buffer_write
(
tech_pvt
->
text_read_buffer
,
chardata
,
strlen
(
chardata
));
switch_mutex_unlock
(
tech_pvt
->
text_read_mutex
);
if
((
switch_mutex_trylock
(
tech_pvt
->
text_cond_mutex
)
==
SWITCH_STATUS_SUCCESS
))
{
switch_thread_cond_signal
(
tech_pvt
->
text_cond
);
switch_mutex_unlock
(
tech_pvt
->
text_cond_mutex
);
if
((
switch_mutex_trylock
(
tech_pvt
->
text_cond_mutex
)
==
SWITCH_STATUS_SUCCESS
))
{
switch_thread_cond_signal
(
tech_pvt
->
text_cond
);
switch_mutex_unlock
(
tech_pvt
->
text_cond_mutex
);
}
}
}
switch_core_session_rwunlock
(
session
);
}
}
if
((
msg
=
cJSON_GetObjectItem
(
params
,
"msg"
)))
{
...
...
@@ -3526,6 +3530,14 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock
switch_core_session_set_private_class
(
session
,
tech_pvt
,
SWITCH_PVT_SECONDARY
);
tech_pvt
->
call_id
=
switch_core_session_strdup
(
session
,
call_id
);
if
(
!
(
destination_number
=
cJSON_GetObjectCstr
(
dialog
,
"destination_number"
)))
{
destination_number
=
"service"
;
}
switch_snprintf
(
name
,
sizeof
(
name
),
"verto.rtc/%s"
,
destination_number
);
switch_channel_set_name
(
channel
,
name
);
if
((
tech_pvt
->
smh
=
switch_core_session_get_media_handle
(
session
)))
{
tech_pvt
->
mparams
=
switch_core_media_get_mparams
(
tech_pvt
->
smh
);
verto_set_media_options
(
tech_pvt
,
jsock
->
profile
);
...
...
@@ -3534,10 +3546,6 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock
err
=
1
;
goto
cleanup
;
}
if
(
!
(
destination_number
=
cJSON_GetObjectCstr
(
dialog
,
"destination_number"
)))
{
destination_number
=
"service"
;
}
if
((
screenShare
=
cJSON_GetObjectItem
(
dialog
,
"screenShare"
))
&&
screenShare
->
type
==
cJSON_True
)
{
switch_channel_set_variable
(
channel
,
"video_screen_share"
,
"true"
);
switch_channel_set_flag
(
channel
,
CF_VIDEO_ONLY
);
...
...
@@ -3611,8 +3619,7 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock
parse_user_vars
(
dialog
,
session
);
switch_snprintf
(
name
,
sizeof
(
name
),
"verto.rtc/%s"
,
destination_number
);
switch_channel_set_name
(
channel
,
name
);
switch_channel_set_variable
(
channel
,
"jsock_uuid_str"
,
jsock
->
uuid_str
);
switch_channel_set_variable
(
channel
,
"verto_user"
,
jsock
->
uid
);
switch_channel_set_variable
(
channel
,
"presence_id"
,
jsock
->
uid
);
...
...
@@ -5160,6 +5167,10 @@ static switch_status_t verto_read_text_frame(switch_core_session_t *session, swi
verto_pvt_t
*
tech_pvt
=
switch_core_session_get_private_class
(
session
,
SWITCH_PVT_SECONDARY
);
switch_status_t
status
;
if
(
!
tech_pvt
->
text_read_buffer
)
{
return
SWITCH_STATUS_FALSE
;
}
switch_mutex_lock
(
tech_pvt
->
text_cond_mutex
);
status
=
switch_thread_cond_timedwait
(
tech_pvt
->
text_cond
,
tech_pvt
->
text_cond_mutex
,
100000
);
...
...
@@ -5226,9 +5237,13 @@ static switch_status_t verto_write_text_frame(switch_core_session_t *session, sw
static
void
set_text_funcs
(
switch_core_session_t
*
session
)
{
if
((
switch_core_session_override_io_routines
(
session
,
&
verto_io_override
)
==
SWITCH_STATUS_SUCCESS
))
{
verto_pvt_t
*
tech_pvt
=
switch_core_session_get_private_class
(
session
,
SWITCH_PVT_SECONDARY
);
verto_pvt_t
*
tech_pvt
=
switch_core_session_get_private_class
(
session
,
SWITCH_PVT_SECONDARY
);
if
(
!
tech_pvt
||
tech_pvt
->
text_read_buffer
)
{
return
;
}
if
((
switch_core_session_override_io_routines
(
session
,
&
verto_io_override
)
==
SWITCH_STATUS_SUCCESS
))
{
tech_pvt
->
text_read_frame
.
data
=
tech_pvt
->
text_read_frame_data
;
switch_mutex_init
(
&
tech_pvt
->
text_read_mutex
,
SWITCH_MUTEX_NESTED
,
tech_pvt
->
pool
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论