Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b3337149
提交
b3337149
authored
6月 11, 2014
作者:
Michael Jerris
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix coverity warnings
上级
bfaf20c2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
23 行增加
和
19 行删除
+23
-19
mcast.c
src/mod/endpoints/mod_verto/mcast/mcast.c
+8
-3
mod_verto.c
src/mod/endpoints/mod_verto/mod_verto.c
+15
-16
没有找到文件。
src/mod/endpoints/mod_verto/mcast/mcast.c
浏览文件 @
b3337149
...
...
@@ -51,7 +51,7 @@ int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle,
memset
(
handle
,
0
,
sizeof
(
*
handle
));
if
((
!
(
flags
&
MCAST_SEND
)
&&
!
(
flags
&
MCAST_RECV
))
||
!
(
handle
->
sock
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
))
)
{
if
((
!
(
flags
&
MCAST_SEND
)
&&
!
(
flags
&
MCAST_RECV
))
||
(
handle
->
sock
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
))
<=
0
)
{
return
-
1
;
}
...
...
@@ -59,7 +59,10 @@ int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle,
handle
->
send_addr
.
sin_addr
.
s_addr
=
inet_addr
(
host
);
handle
->
send_addr
.
sin_port
=
htons
(
port
);
setsockopt
(
handle
->
sock
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
one
,
sizeof
(
one
));
if
(
setsockopt
(
handle
->
sock
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
one
,
sizeof
(
one
))
!=
0
)
{
close
(
handle
->
sock
);
return
-
1
;
}
if
((
flags
&
MCAST_RECV
))
{
...
...
@@ -113,7 +116,9 @@ int mcast_socket_create(const char *host, int16_t port, mcast_handle_t *handle,
handle
->
ttl
=
255
;
}
setsockopt
(
handle
->
sock
,
IPPROTO_IP
,
IP_MULTICAST_TTL
,
&
handle
->
ttl
,
sizeof
(
handle
->
ttl
));
if
(
setsockopt
(
handle
->
sock
,
IPPROTO_IP
,
IP_MULTICAST_TTL
,
&
handle
->
ttl
,
sizeof
(
handle
->
ttl
))
!=
0
)
{
return
-
1
;
}
handle
->
ready
=
1
;
...
...
src/mod/endpoints/mod_verto/mod_verto.c
浏览文件 @
b3337149
...
...
@@ -515,7 +515,7 @@ static switch_ssize_t ws_write_json(jsock_t *jsock, cJSON **json, switch_bool_t
return
r
;
}
if
(
jsock
->
uuid_str
)
{
if
(
!
zstr
(
jsock
->
uuid_str
)
)
{
cJSON
*
result
=
cJSON_GetObjectItem
(
*
json
,
"result"
);
if
(
result
)
{
...
...
@@ -2065,6 +2065,9 @@ static switch_bool_t attended_transfer(switch_core_session_t *session, switch_co
tech_pvt
=
switch_core_session_get_private_class
(
session
,
SWITCH_PVT_SECONDARY
);
b_tech_pvt
=
switch_core_session_get_private_class
(
b_session
,
SWITCH_PVT_SECONDARY
);
switch_assert
(
b_tech_pvt
);
switch_assert
(
tech_pvt
);
switch_channel_set_variable
(
tech_pvt
->
channel
,
"refer_uuid"
,
switch_core_session_get_uuid
(
b_tech_pvt
->
session
));
switch_channel_set_variable
(
b_tech_pvt
->
channel
,
"transfer_disposition"
,
"replaced"
);
...
...
@@ -2130,9 +2133,7 @@ static switch_bool_t attended_transfer(switch_core_session_t *session, switch_co
result
=
SWITCH_TRUE
;
if
(
b_tech_pvt
)
{
switch_channel_hangup
(
b_tech_pvt
->
channel
,
SWITCH_CAUSE_NORMAL_CLEARING
);
}
switch_channel_hangup
(
b_tech_pvt
->
channel
,
SWITCH_CAUSE_NORMAL_CLEARING
);
}
else
{
result
=
SWITCH_FALSE
;
}
...
...
@@ -2347,11 +2348,6 @@ static switch_bool_t verto__attach_func(const char *method, cJSON *params, jsock
err
=
1
;
goto
cleanup
;
}
if
(
!
(
call_id
=
cJSON_GetObjectCstr
(
dialog
,
"callID"
)))
{
cJSON_AddItemToObject
(
obj
,
"message"
,
cJSON_CreateString
(
"CallID missing"
));
err
=
1
;
goto
cleanup
;
}
if
(
!
(
sdp
=
cJSON_GetObjectCstr
(
params
,
"sdp"
)))
{
cJSON_AddItemToObject
(
obj
,
"message"
,
cJSON_CreateString
(
"SDP missing"
));
err
=
1
;
goto
cleanup
;
...
...
@@ -2850,8 +2846,9 @@ static switch_bool_t verto__broadcast_func(const char *method, cJSON *params, js
if
(
jsock
->
profile
->
mcast_pub
.
sock
>
-
1
)
{
if
((
json_text
=
cJSON_PrintUnformatted
(
params
)))
{
mcast_socket_send
(
&
jsock
->
profile
->
mcast_pub
,
json_text
,
strlen
(
json_text
)
+
1
);
if
(
mcast_socket_send
(
&
jsock
->
profile
->
mcast_pub
,
json_text
,
strlen
(
json_text
)
+
1
)
<
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"multicast socket send error!
\n
"
);
}
free
(
json_text
);
json_text
=
NULL
;
...
...
@@ -3058,7 +3055,9 @@ static int prepare_socket(int ip, int port)
die
(
"Socket Error!
\n
"
);
}
setsockopt
(
sock
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
reuse_addr
,
sizeof
(
reuse_addr
));
if
(
setsockopt
(
sock
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
reuse_addr
,
sizeof
(
reuse_addr
))
<
0
)
{
die
(
"Socket setsockopt Error!
\n
"
);
}
memset
(
&
addr
,
0
,
sizeof
(
addr
));
addr
.
sin_family
=
AF_INET
;
...
...
@@ -3288,11 +3287,11 @@ static verto_profile_t *find_profile(const char *name)
}
}
if
(
!
r
->
in_thread
||
!
r
->
running
)
{
if
(
r
&&
(
!
r
->
in_thread
||
!
r
->
running
)
)
{
r
=
NULL
;
}
if
(
switch_thread_rwlock_tryrdlock
(
r
->
rwlock
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
r
&&
switch_thread_rwlock_tryrdlock
(
r
->
rwlock
)
!=
SWITCH_STATUS_SUCCESS
)
{
r
=
NULL
;
}
switch_mutex_unlock
(
globals
.
mutex
);
...
...
@@ -3476,7 +3475,7 @@ static switch_status_t parse_config(const char *cf)
}
if
(
zstr
(
profile
->
inbound_codec_string
))
{
profile
->
out
bound_codec_string
=
profile
->
outbound_codec_string
;
profile
->
in
bound_codec_string
=
profile
->
outbound_codec_string
;
}
if
(
zstr
(
profile
->
timer_name
))
{
...
...
@@ -4014,7 +4013,7 @@ static cJSON *json_retrieve(const char *name, switch_mutex_t *mutex)
static
switch_bool_t
json_commit
(
cJSON
*
json
,
const
char
*
name
,
switch_mutex_t
*
mutex
)
{
char
*
ascii
=
cJSON_PrintUnformatted
(
json
)
;
char
*
ascii
;
char
*
sql
;
char
del_sql
[
128
]
=
""
;
switch_cache_db_handle_t
*
dbh
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论