Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d6374535
提交
d6374535
authored
12月 23, 2011
作者:
Marc Olivier Chouinard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-3029 --resolve
上级
377fb371
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
47 行增加
和
21 行删除
+47
-21
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+16
-0
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+1
-0
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+30
-21
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
d6374535
...
@@ -3516,6 +3516,22 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
...
@@ -3516,6 +3516,22 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
goto
done
;
goto
done
;
}
}
if
(
!
strcasecmp
(
argv
[
1
],
"recover"
))
{
if
(
argv
[
2
]
&&
!
strcasecmp
(
argv
[
2
],
"flush"
))
{
sofia_glue_profile_recover
(
profile
,
SWITCH_TRUE
);
stream
->
write_function
(
stream
,
"Flushing recovery database.
\n
"
);
}
else
{
int
x
=
sofia_glue_profile_recover
(
profile
,
SWITCH_FALSE
);
if
(
x
)
{
stream
->
write_function
(
stream
,
"Recovered %d call(s)
\n
"
,
x
);
}
else
{
stream
->
write_function
(
stream
,
"No calls to recover.
\n
"
);
}
}
goto
done
;
}
if
(
!
strcasecmp
(
argv
[
1
],
"register"
))
{
if
(
!
strcasecmp
(
argv
[
1
],
"register"
))
{
char
*
gname
=
argv
[
2
];
char
*
gname
=
argv
[
2
];
...
...
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
d6374535
...
@@ -1120,6 +1120,7 @@ int sofia_sla_supported(sip_t const *sip);
...
@@ -1120,6 +1120,7 @@ int sofia_sla_supported(sip_t const *sip);
void
sofia_glue_tech_untrack
(
sofia_profile_t
*
profile
,
switch_core_session_t
*
session
,
switch_bool_t
force
);
void
sofia_glue_tech_untrack
(
sofia_profile_t
*
profile
,
switch_core_session_t
*
session
,
switch_bool_t
force
);
void
sofia_glue_tech_track
(
sofia_profile_t
*
profile
,
switch_core_session_t
*
session
);
void
sofia_glue_tech_track
(
sofia_profile_t
*
profile
,
switch_core_session_t
*
session
);
int
sofia_glue_recover
(
switch_bool_t
flush
);
int
sofia_glue_recover
(
switch_bool_t
flush
);
int
sofia_glue_profile_recover
(
sofia_profile_t
*
profile
,
switch_bool_t
flush
);
void
sofia_profile_destroy
(
sofia_profile_t
*
profile
);
void
sofia_profile_destroy
(
sofia_profile_t
*
profile
);
switch_status_t
sip_dig_function
(
_In_opt_z_
const
char
*
cmd
,
_In_opt_
switch_core_session_t
*
session
,
_In_
switch_stream_handle_t
*
stream
);
switch_status_t
sip_dig_function
(
_In_opt_z_
const
char
*
cmd
,
_In_opt_
switch_core_session_t
*
session
,
_In_
switch_stream_handle_t
*
stream
);
const
char
*
sofia_gateway_status_name
(
sofia_gateway_status_t
status
);
const
char
*
sofia_gateway_status_name
(
sofia_gateway_status_t
status
);
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
d6374535
...
@@ -5715,7 +5715,6 @@ static int recover_callback(void *pArg, int argc, char **argv, char **columnName
...
@@ -5715,7 +5715,6 @@ static int recover_callback(void *pArg, int argc, char **argv, char **columnName
int
sofia_glue_recover
(
switch_bool_t
flush
)
int
sofia_glue_recover
(
switch_bool_t
flush
)
{
{
sofia_profile_t
*
profile
;
sofia_profile_t
*
profile
;
char
*
sql
;
int
r
=
0
;
int
r
=
0
;
switch_console_callback_match_t
*
matches
;
switch_console_callback_match_t
*
matches
;
...
@@ -5724,34 +5723,44 @@ int sofia_glue_recover(switch_bool_t flush)
...
@@ -5724,34 +5723,44 @@ int sofia_glue_recover(switch_bool_t flush)
switch_console_callback_match_node_t
*
m
;
switch_console_callback_match_node_t
*
m
;
for
(
m
=
matches
->
head
;
m
;
m
=
m
->
next
)
{
for
(
m
=
matches
->
head
;
m
;
m
=
m
->
next
)
{
if
((
profile
=
sofia_glue_find_profile
(
m
->
val
)))
{
if
((
profile
=
sofia_glue_find_profile
(
m
->
val
)))
{
r
+=
sofia_glue_profile_recover
(
profile
,
flush
);
}
}
switch_console_free_matches
(
&
matches
);
}
return
r
;
}
struct
recover_helper
h
=
{
0
};
int
sofia_glue_profile_recover
(
sofia_profile_t
*
profile
,
switch_bool_t
flush
)
h
.
profile
=
profile
;
{
h
.
total
=
0
;
char
*
sql
;
int
r
=
0
;
sofia_clear_pflag_locked
(
profile
,
PFLAG_STANDBY
);
if
(
profile
)
{
struct
recover_helper
h
=
{
0
};
h
.
profile
=
profile
;
h
.
total
=
0
;
if
(
flush
)
{
sofia_clear_pflag_locked
(
profile
,
PFLAG_STANDBY
);
sql
=
switch_mprintf
(
"delete from sip_recovery where profile_name='%q'"
,
profile
->
name
);
sofia_glue_execute_sql_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
}
else
{
sql
=
switch_mprintf
(
"select profile_name, hostname, uuid, metadata "
if
(
flush
)
{
"from sip_recovery where runtime_uuid!='%q' and profile_name='%q'"
,
switch_core_get_uuid
(),
profile
->
name
);
sql
=
switch_mprintf
(
"delete from sip_recovery where profile_name='%q'"
,
profile
->
name
);
sofia_glue_execute_sql_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
}
else
{
sofia_glue_execute_sql_callback
(
profile
,
profile
->
ireg_mutex
,
sql
,
recover_callback
,
&
h
);
sql
=
switch_mprintf
(
"select profile_name, hostname, uuid, metadata "
r
+=
h
.
total
;
"from sip_recovery where runtime_uuid!='%q' and profile_name='%q'"
,
switch_core_get_uuid
(),
profile
->
name
);
free
(
sql
);
sql
=
NULL
;
sql
=
switch_mprintf
(
"delete "
sofia_glue_execute_sql_callback
(
profile
,
profile
->
ireg_mutex
,
sql
,
recover_callback
,
&
h
);
"from sip_recovery where runtime_uuid!='%q' and profile_name='%q'"
,
switch_core_get_uuid
(),
profile
->
name
);
r
+=
h
.
total
;
free
(
sql
);
sql
=
NULL
;
sofia_glue_execute_sql_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
sql
=
switch_mprintf
(
"delete "
}
"from sip_recovery where runtime_uuid!='%q' and profile_name='%q'"
,
switch_core_get_uuid
(),
profile
->
name
);
}
sofia_glue_execute_sql_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
}
}
switch_console_free_matches
(
&
matches
);
}
}
return
r
;
return
r
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论