Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
04bb74fc
提交
04bb74fc
authored
2月 14, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-3050 FS-3051
上级
436413e0
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
8 行增加
和
6 行删除
+8
-6
sofia_reg.c
src/mod/endpoints/mod_sofia/sofia_reg.c
+2
-0
switch_core_sqldb.c
src/switch_core_sqldb.c
+6
-6
没有找到文件。
src/mod/endpoints/mod_sofia/sofia_reg.c
浏览文件 @
04bb74fc
...
@@ -1543,6 +1543,8 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
...
@@ -1543,6 +1543,8 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
}
}
}
}
}
else
{
}
else
{
switch_core_del_registration
(
to_user
,
reg_host
,
call_id
);
if
(
switch_event_create_subclass
(
&
s_event
,
SWITCH_EVENT_CUSTOM
,
MY_EVENT_UNREGISTER
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_event_create_subclass
(
&
s_event
,
SWITCH_EVENT_CUSTOM
,
MY_EVENT_UNREGISTER
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
s_event
,
SWITCH_STACK_BOTTOM
,
"profile-name"
,
profile
->
name
);
switch_event_add_header_string
(
s_event
,
SWITCH_STACK_BOTTOM
,
"profile-name"
,
profile
->
name
);
switch_event_add_header_string
(
s_event
,
SWITCH_STACK_BOTTOM
,
"from-user"
,
to_user
);
switch_event_add_header_string
(
s_event
,
SWITCH_STACK_BOTTOM
,
"from-user"
,
to_user
);
...
...
src/switch_core_sqldb.c
浏览文件 @
04bb74fc
...
@@ -1625,7 +1625,7 @@ static char create_nat_sql[] =
...
@@ -1625,7 +1625,7 @@ static char create_nat_sql[] =
static
char
create_registrations_sql
[]
=
static
char
create_registrations_sql
[]
=
"CREATE TABLE registrations (
\n
"
"CREATE TABLE registrations (
\n
"
" user VARCHAR(256),
\n
"
"
reg_
user VARCHAR(256),
\n
"
" realm VARCHAR(256),
\n
"
" realm VARCHAR(256),
\n
"
" token VARCHAR(256),
\n
"
" token VARCHAR(256),
\n
"
" url TEXT,
\n
"
" url TEXT,
\n
"
...
@@ -1635,7 +1635,7 @@ static char create_registrations_sql[] =
...
@@ -1635,7 +1635,7 @@ static char create_registrations_sql[] =
" network_proto VARCHAR(256),
\n
"
" network_proto VARCHAR(256),
\n
"
" hostname VARCHAR(256)
\n
"
" hostname VARCHAR(256)
\n
"
");
\n
"
");
\n
"
"create index regindex1 on registrations (user,real,hostname);
\n
"
;
"create index regindex1 on registrations (user,real
m
,hostname);
\n
"
;
SWITCH_DECLARE
(
switch_status_t
)
switch_core_add_registration
(
const
char
*
user
,
const
char
*
realm
,
const
char
*
token
,
const
char
*
url
,
uint32_t
expires
,
SWITCH_DECLARE
(
switch_status_t
)
switch_core_add_registration
(
const
char
*
user
,
const
char
*
realm
,
const
char
*
token
,
const
char
*
url
,
uint32_t
expires
,
...
@@ -1653,7 +1653,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_add_registration(const char *user, c
...
@@ -1653,7 +1653,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_add_registration(const char *user, c
switch_cache_db_execute_sql
(
dbh
,
sql
,
NULL
);
switch_cache_db_execute_sql
(
dbh
,
sql
,
NULL
);
free
(
sql
);
free
(
sql
);
sql
=
switch_mprintf
(
"insert into registrations (user,realm,token,url,expires,network_ip,network_port,network_proto,hostname) "
sql
=
switch_mprintf
(
"insert into registrations (
reg_
user,realm,token,url,expires,network_ip,network_port,network_proto,hostname) "
"values ('%q','%q','%q','%q',%ld,'%q','%q','%q','%q')"
,
"values ('%q','%q','%q','%q',%ld,'%q','%q','%q','%q')"
,
switch_str_nil
(
user
),
switch_str_nil
(
user
),
switch_str_nil
(
realm
),
switch_str_nil
(
realm
),
...
@@ -1685,7 +1685,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_del_registration(const char *user, c
...
@@ -1685,7 +1685,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_del_registration(const char *user, c
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
}
}
sql
=
switch_mprintf
(
"delete from registrations where user='%q' and realm='%q' and hostname='%q'"
,
user
,
realm
,
switch_core_get_hostname
());
sql
=
switch_mprintf
(
"delete from registrations where
reg_
user='%q' and realm='%q' and hostname='%q'"
,
user
,
realm
,
switch_core_get_hostname
());
switch_cache_db_execute_sql
(
dbh
,
sql
,
NULL
);
switch_cache_db_execute_sql
(
dbh
,
sql
,
NULL
);
switch_cache_db_release_db_handle
(
&
dbh
);
switch_cache_db_release_db_handle
(
&
dbh
);
...
@@ -1798,7 +1798,7 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
...
@@ -1798,7 +1798,7 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
switch_cache_db_test_reactive
(
dbh
,
"select hostname from complete"
,
"DROP TABLE complete"
,
create_complete_sql
);
switch_cache_db_test_reactive
(
dbh
,
"select hostname from complete"
,
"DROP TABLE complete"
,
create_complete_sql
);
switch_cache_db_test_reactive
(
dbh
,
"select hostname from aliases"
,
"DROP TABLE aliases"
,
create_alias_sql
);
switch_cache_db_test_reactive
(
dbh
,
"select hostname from aliases"
,
"DROP TABLE aliases"
,
create_alias_sql
);
switch_cache_db_test_reactive
(
dbh
,
"select hostname from nat"
,
"DROP TABLE nat"
,
create_nat_sql
);
switch_cache_db_test_reactive
(
dbh
,
"select hostname from nat"
,
"DROP TABLE nat"
,
create_nat_sql
);
switch_cache_db_test_reactive
(
dbh
,
"delete from registrations where network_proto='tcp' or network_proto='tls'"
,
switch_cache_db_test_reactive
(
dbh
,
"delete from registrations where
reg_user='' or
network_proto='tcp' or network_proto='tls'"
,
"DROP TABLE registrations"
,
create_registrations_sql
);
"DROP TABLE registrations"
,
create_registrations_sql
);
...
@@ -1816,7 +1816,7 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
...
@@ -1816,7 +1816,7 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
}
}
switch_cache_db_test_reactive
(
dbh
,
"select ikey from interfaces"
,
"DROP TABLE interfaces"
,
create_interfaces_sql
);
switch_cache_db_test_reactive
(
dbh
,
"select ikey from interfaces"
,
"DROP TABLE interfaces"
,
create_interfaces_sql
);
switch_cache_db_test_reactive
(
dbh
,
"select hostname from tasks"
,
"DROP TABLE tasks"
,
create_tasks_sql
);
switch_cache_db_test_reactive
(
dbh
,
"select hostname from tasks"
,
"DROP TABLE tasks"
,
create_tasks_sql
);
switch_cache_db_test_reactive
(
dbh
,
"delete from registrations where network_proto='tcp' or network_proto='tls'"
,
switch_cache_db_test_reactive
(
dbh
,
"delete from registrations where
reg_user='' or
network_proto='tcp' or network_proto='tls'"
,
"DROP TABLE registrations"
,
create_registrations_sql
);
"DROP TABLE registrations"
,
create_registrations_sql
);
if
(
runtime
.
odbc_dbtype
==
DBTYPE_DEFAULT
)
{
if
(
runtime
.
odbc_dbtype
==
DBTYPE_DEFAULT
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论