Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
589502d3
提交
589502d3
authored
10月 01, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-2747
上级
56f8c11f
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
17 行增加
和
6 行删除
+17
-6
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+3
-2
sofia_presence.c
src/mod/endpoints/mod_sofia/sofia_presence.c
+14
-4
没有找到文件。
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
589502d3
...
@@ -5216,7 +5216,8 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
...
@@ -5216,7 +5216,8 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
" profile_name VARCHAR(255),
\n
"
" profile_name VARCHAR(255),
\n
"
" hostname VARCHAR(255),
\n
"
" hostname VARCHAR(255),
\n
"
" network_port VARCHAR(6),
\n
"
" network_port VARCHAR(6),
\n
"
" network_ip VARCHAR(255)
\n
"
" network_ip VARCHAR(255),
\n
"
" version INTEGER DEFAULT 0 NOT NULL
\n
"
");
\n
"
;
");
\n
"
;
char
auth_sql
[]
=
char
auth_sql
[]
=
...
@@ -5336,7 +5337,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
...
@@ -5336,7 +5337,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
free
(
test_sql
);
free
(
test_sql
);
test_sql
=
switch_mprintf
(
"delete from sip_subscriptions where hostname='%q' and network_ip like '%%' and network_port like '%%'"
,
test_sql
=
switch_mprintf
(
"delete from sip_subscriptions where hostname='%q' and
version < 0 and
network_ip like '%%' and network_port like '%%'"
,
mod_sofia_globals
.
hostname
);
mod_sofia_globals
.
hostname
);
switch_cache_db_test_reactive
(
dbh
,
test_sql
,
"DROP TABLE sip_subscriptions"
,
sub_sql
);
switch_cache_db_test_reactive
(
dbh
,
test_sql
,
"DROP TABLE sip_subscriptions"
,
sub_sql
);
...
...
src/mod/endpoints/mod_sofia/sofia_presence.c
浏览文件 @
589502d3
...
@@ -700,7 +700,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
...
@@ -700,7 +700,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
"sip_subscriptions.contact,sip_subscriptions.call_id,sip_subscriptions.full_from,"
"sip_subscriptions.contact,sip_subscriptions.call_id,sip_subscriptions.full_from,"
"sip_subscriptions.full_via,sip_subscriptions.expires,sip_subscriptions.user_agent,"
"sip_subscriptions.full_via,sip_subscriptions.expires,sip_subscriptions.user_agent,"
"sip_subscriptions.accept,sip_subscriptions.profile_name"
"sip_subscriptions.accept,sip_subscriptions.profile_name"
",'%q','%q','%q',sip_presence.status,sip_presence.rpid,sip_presence.open_closed,'%q','%q' "
",'%q','%q','%q',sip_presence.status,sip_presence.rpid,sip_presence.open_closed,'%q','%q'
,sip_subscriptions.version
"
"from sip_subscriptions "
"from sip_subscriptions "
"left join sip_presence on "
"left join sip_presence on "
"(sip_subscriptions.sub_to_user=sip_presence.sip_user and sip_subscriptions.sub_to_host=sip_presence.sip_host and "
"(sip_subscriptions.sub_to_user=sip_presence.sip_user and sip_subscriptions.sub_to_host=sip_presence.sip_host and "
...
@@ -743,6 +743,15 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
...
@@ -743,6 +743,15 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
sofia_glue_execute_sql_callback
(
profile
,
NULL
,
sql
,
sofia_presence_sub_callback
,
&
helper
);
sofia_glue_execute_sql_callback
(
profile
,
NULL
,
sql
,
sofia_presence_sub_callback
,
&
helper
);
sql
=
switch_mprintf
(
"update sip_subscriptions set version=version+1 where event='dialog' and sub_to_user='%q' "
"and (sub_to_host='%q' or presence_hosts like '%%%q%%') "
"and (profile_name = '%q' or presence_hosts != sub_to_host)"
,
euser
,
host
,
host
,
profile
->
name
);
sofia_glue_execute_sql_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
if
(
mod_sofia_globals
.
debug_presence
>
0
)
{
if
(
mod_sofia_globals
.
debug_presence
>
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"%s END_PRESENCE_SQL (%s)
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"%s END_PRESENCE_SQL (%s)
\n
"
,
event
->
event_id
==
SWITCH_EVENT_PRESENCE_IN
?
"IN"
:
"OUT"
,
profile
->
name
);
event
->
event_id
==
SWITCH_EVENT_PRESENCE_IN
?
"IN"
:
"OUT"
,
profile
->
name
);
...
@@ -1193,7 +1202,8 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
...
@@ -1193,7 +1202,8 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
int
kill_handle
=
0
;
int
kill_handle
=
0
;
char
expires_str
[
10
]
=
""
;
char
expires_str
[
10
]
=
""
;
char
status_line
[
256
]
=
""
;
char
status_line
[
256
]
=
""
;
char
*
version
=
"0"
;
//int i;
//int i;
//for(i = 0; i < argc; i++) {
//for(i = 0; i < argc; i++) {
...
@@ -1213,6 +1223,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
...
@@ -1213,6 +1223,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
if
(
argc
>
20
)
{
if
(
argc
>
20
)
{
dialog_status
=
argv
[
20
];
dialog_status
=
argv
[
20
];
dialog_rpid
=
argv
[
21
];
dialog_rpid
=
argv
[
21
];
version
=
argv
[
22
];
}
}
in
=
helper
->
event
&&
helper
->
event
->
event_id
==
SWITCH_EVENT_PRESENCE_IN
;
in
=
helper
->
event
&&
helper
->
event
->
event_id
==
SWITCH_EVENT_PRESENCE_IN
;
...
@@ -1317,8 +1328,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
...
@@ -1317,8 +1328,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
}
}
if
(
is_dialog
)
{
if
(
is_dialog
)
{
char
*
version
=
switch_event_get_header
(
helper
->
event
,
"event_count"
);
if
(
zstr
(
version
))
{
if
(
!
version
)
{
version
=
"0"
;
version
=
"0"
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论