Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
7fbc47f8
提交
7fbc47f8
authored
1月 21, 2011
作者:
Jeff Lenk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-2973 Fix possible segfaults and memory leak during unload, and add new setting odbc-retries
上级
1c95ad98
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
14 行增加
和
2 行删除
+14
-2
easyroute.conf.xml
conf/autoload_configs/easyroute.conf.xml
+3
-0
mod_easyroute.c
src/mod/applications/mod_easyroute/mod_easyroute.c
+11
-2
没有找到文件。
conf/autoload_configs/easyroute.conf.xml
浏览文件 @
7fbc47f8
...
...
@@ -11,6 +11,9 @@
<!-- IP or Hostname of Default Route -->
<param
name=
"default-gateway"
value=
"192.168.66.6"
/>
<!-- Number of times to retry ODBC connection on connection problems, default is 120 -->
<param
name=
"odbc-retries"
value=
"120"
/>
<!-- Customer Query. Use this with Care!!! We are not responsible if you mess
This up!!! Query *MUST* return columns in the following order!
gateway varchar(128) - contains destination gateway host:port pair (ex: 192.168.1.1:5060 )
...
...
src/mod/applications/mod_easyroute/mod_easyroute.c
浏览文件 @
7fbc47f8
...
...
@@ -65,6 +65,7 @@ static struct {
switch_mutex_t
*
mutex
;
char
*
custom_query
;
switch_odbc_handle_t
*
master_odbc
;
int
odbc_num_retries
;
}
globals
;
SWITCH_MODULE_LOAD_FUNCTION
(
mod_easyroute_load
);
...
...
@@ -120,6 +121,8 @@ static switch_status_t load_config(void)
set_global_default_gateway
(
val
);
}
else
if
(
!
strcasecmp
(
var
,
"custom-query"
))
{
set_global_custom_query
(
val
);
}
else
if
(
!
strcasecmp
(
var
,
"odbc-retries"
))
{
globals
.
odbc_num_retries
=
atoi
(
val
);
}
}
}
...
...
@@ -143,6 +146,9 @@ static switch_status_t load_config(void)
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Opened ODBC Database!
\n
"
);
}
if
(
globals
.
odbc_num_retries
)
{
switch_odbc_set_num_retries
(
globals
.
master_odbc
,
globals
.
odbc_num_retries
);
}
if
(
switch_odbc_handle_connect
(
globals
.
master_odbc
)
!=
SWITCH_ODBC_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Cannot Open ODBC Database!
\n
"
);
status
=
SWITCH_STATUS_FALSE
;
...
...
@@ -205,7 +211,7 @@ static switch_status_t route_lookup(char *dn, easyroute_results_t *results, int
switch_mutex_lock
(
globals
.
mutex
);
}
/* Do the Query */
if
(
switch_odbc_handle_callback_exec
(
globals
.
master_odbc
,
sql
,
route_callback
,
&
pdata
,
NULL
)
==
SWITCH_ODBC_SUCCESS
)
{
if
(
globals
.
master_odbc
&&
switch_odbc_handle_callback_exec
(
globals
.
master_odbc
,
sql
,
route_callback
,
&
pdata
,
NULL
)
==
SWITCH_ODBC_SUCCESS
)
{
char
tmp_profile
[
129
];
char
tmp_gateway
[
129
];
...
...
@@ -418,7 +424,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_easyroute_load)
SWITCH_MODULE_SHUTDOWN_FUNCTION
(
mod_easyroute_shutdown
)
{
switch_odbc_handle_disconnect
(
globals
.
master_odbc
);
if
(
globals
.
master_odbc
)
{
switch_odbc_handle_disconnect
(
globals
.
master_odbc
);
switch_odbc_handle_destroy
(
&
globals
.
master_odbc
);
}
switch_safe_free
(
globals
.
db_username
);
switch_safe_free
(
globals
.
db_password
);
switch_safe_free
(
globals
.
db_dsn
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论