Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
145a8522
提交
145a8522
authored
1月 29, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix sql string leak regressions
上级
ccad34f0
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
31 行增加
和
20 行删除
+31
-20
sofia_presence.c
src/mod/endpoints/mod_sofia/sofia_presence.c
+24
-20
sofia_reg.c
src/mod/endpoints/mod_sofia/sofia_reg.c
+7
-0
没有找到文件。
src/mod/endpoints/mod_sofia/sofia_presence.c
浏览文件 @
145a8522
...
...
@@ -399,6 +399,7 @@ void sofia_presence_cancel(void)
sofia_profile_t
*
profile
;
struct
presence_helper
helper
=
{
0
};
switch_console_callback_match_t
*
matches
;
switch_bool_t
r
;
if
(
!
mod_sofia_globals
.
profile_hash
)
{
return
;
...
...
@@ -407,19 +408,23 @@ void sofia_presence_cancel(void)
if
(
list_profiles_full
(
NULL
,
NULL
,
&
matches
,
SWITCH_FALSE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_console_callback_match_node_t
*
m
;
sql
=
switch_mprintf
(
"select proto,sip_user,sip_host,sub_to_user,sub_to_host,event,contact,call_id,full_from,"
"full_via,expires,user_agent,accept,profile_name,network_ip"
",-1,'unavailable','unavailable' from sip_subscriptions where "
"event='presence' and hostname='%q'"
,
mod_sofia_globals
.
hostname
);
for
(
m
=
matches
->
head
;
m
;
m
=
m
->
next
)
{
if
((
profile
=
sofia_glue_find_profile
(
m
->
val
)))
{
if
(
profile
->
pres_type
==
PRES_TYPE_FULL
)
{
helper
.
profile
=
profile
;
helper
.
event
=
NULL
;
if
(
sofia_glue_execute_sql_callback
(
profile
,
profile
->
ireg_mutex
,
sql
,
sofia_presence_sub_callback
,
&
helper
)
!=
SWITCH_TRUE
)
{
sql
=
switch_mprintf
(
"select proto,sip_user,sip_host,sub_to_user,sub_to_host,event,contact,call_id,full_from,"
"full_via,expires,user_agent,accept,profile_name,network_ip"
",-1,'unavailable','unavailable' from sip_subscriptions where "
"event='presence' and hostname='%q' and profile_name='%q'"
,
mod_sofia_globals
.
hostname
,
profile
->
name
);
r
=
sofia_glue_execute_sql_callback
(
profile
,
profile
->
ireg_mutex
,
sql
,
sofia_presence_sub_callback
,
&
helper
);
switch_safe_free
(
sql
);
if
(
r
!=
SWITCH_TRUE
)
{
sofia_glue_release_profile
(
profile
);
continue
;
}
...
...
@@ -428,7 +433,6 @@ void sofia_presence_cancel(void)
}
}
switch_safe_free
(
sql
);
switch_console_free_matches
(
&
matches
);
}
...
...
@@ -737,11 +741,10 @@ static void do_normal_probe(switch_event_t *event)
}
sofia_glue_execute_sql_callback
(
profile
,
profile
->
ireg_mutex
,
sql
,
sofia_presence_resub_callback
,
&
h
);
switch_safe_free
(
sql
);
if
(
!
h
.
rowcount
)
{
h
.
noreg
++
;
switch_safe_free
(
sql
);
/* find ones with presence_id defined that are not registred */
sql
=
switch_mprintf
(
"select sip_from_user, sip_from_host, 'Registered', '', '', "
...
...
@@ -765,6 +768,7 @@ static void do_normal_probe(switch_event_t *event)
}
sofia_glue_execute_sql_callback
(
profile
,
profile
->
ireg_mutex
,
sql
,
sofia_presence_resub_callback
,
&
h
);
switch_safe_free
(
sql
);
if
(
mod_sofia_globals
.
debug_presence
>
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"%s END_PRESENCE_PROBE_SQL
\n\n
"
,
profile
->
name
);
...
...
@@ -784,7 +788,6 @@ static void do_normal_probe(switch_event_t *event)
sofia_glue_release_profile
(
profile
);
switch_safe_free
(
sql
);
}
...
...
@@ -981,6 +984,7 @@ static void send_conference_data(sofia_profile_t *profile, switch_event_t *event
}
sofia_glue_execute_sql_callback
(
profile
,
profile
->
ireg_mutex
,
sql
,
sofia_presence_send_sql
,
&
cb
);
switch_safe_free
(
sql
);
if
(
switch_true
(
final
))
{
if
(
call_id
)
{
...
...
@@ -999,7 +1003,7 @@ static void send_conference_data(sofia_profile_t *profile, switch_event_t *event
sofia_glue_execute_sql_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
}
switch_safe_free
(
sql
);
}
...
...
src/mod/endpoints/mod_sofia/sofia_reg.c
浏览文件 @
145a8522
...
...
@@ -800,6 +800,7 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot)
"profile_name='%s'"
,
mod_sofia_globals
.
hostname
,
profile
->
name
);
sofia_glue_execute_sql_callback
(
profile
,
profile
->
ireg_mutex
,
sql
,
sofia_reg_nat_callback
,
profile
);
switch_safe_free
(
sql
);
}
else
if
(
sofia_test_pflag
(
profile
,
PFLAG_NAT_OPTIONS_PING
))
{
sql
=
switch_mprintf
(
"select call_id,sip_user,sip_host,contact,status,rpid,"
"expires,user_agent,server_user,server_host,profile_name"
...
...
@@ -808,6 +809,7 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot)
"and profile_name='%s'"
,
mod_sofia_globals
.
hostname
,
profile
->
name
);
sofia_glue_execute_sql_callback
(
profile
,
profile
->
ireg_mutex
,
sql
,
sofia_reg_nat_callback
,
profile
);
switch_safe_free
(
sql
);
}
}
...
...
@@ -873,6 +875,8 @@ void sofia_reg_check_sync(sofia_profile_t *profile)
sofia_glue_execute_sql_callback
(
profile
,
profile
->
ireg_mutex
,
sql
,
sofia_reg_del_callback
,
profile
);
switch_safe_free
(
sql
);
sql
=
switch_mprintf
(
"delete from sip_registrations where expires > 0 and hostname='%q'"
,
mod_sofia_globals
.
hostname
);
sofia_glue_execute_sql_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
...
...
@@ -913,6 +917,7 @@ char *sofia_reg_find_reg_url(sofia_profile_t *profile, const char *user, const c
sofia_glue_execute_sql_callback
(
profile
,
profile
->
ireg_mutex
,
sql
,
sofia_reg_find_callback
,
&
cbt
);
switch_safe_free
(
sql
);
if
(
cbt
.
matches
)
{
return
val
;
...
...
@@ -942,6 +947,8 @@ switch_console_callback_match_t *sofia_reg_find_reg_url_multi(sofia_profile_t *p
sofia_glue_execute_sql_callback
(
profile
,
profile
->
ireg_mutex
,
sql
,
sofia_reg_find_callback
,
&
cbt
);
switch_safe_free
(
sql
);
return
cbt
.
list
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论