Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
bf607b0d
提交
bf607b0d
authored
4月 17, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-5319 --resolve
上级
c4e34838
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
31 行增加
和
1 行删除
+31
-1
switch_types.h
src/include/switch_types.h
+7
-0
switch.c
src/switch.c
+16
-0
switch_core.c
src/switch_core.c
+7
-0
switch_xml.c
src/switch_xml.c
+1
-1
没有找到文件。
src/include/switch_types.h
浏览文件 @
bf607b0d
...
@@ -494,6 +494,13 @@ struct switch_directories {
...
@@ -494,6 +494,13 @@ struct switch_directories {
typedef
struct
switch_directories
switch_directories
;
typedef
struct
switch_directories
switch_directories
;
SWITCH_DECLARE_DATA
extern
switch_directories
SWITCH_GLOBAL_dirs
;
SWITCH_DECLARE_DATA
extern
switch_directories
SWITCH_GLOBAL_dirs
;
struct
switch_filenames
{
char
*
conf_name
;
};
typedef
struct
switch_filenames
switch_filenames
;
SWITCH_DECLARE_DATA
extern
switch_filenames
SWITCH_GLOBAL_filenames
;
#define SWITCH_MAX_STACKS 16
#define SWITCH_MAX_STACKS 16
#define SWITCH_THREAD_STACKSIZE 240 * 1024
#define SWITCH_THREAD_STACKSIZE 240 * 1024
#define SWITCH_SYSTEM_THREAD_STACKSIZE 8192 * 1024
#define SWITCH_SYSTEM_THREAD_STACKSIZE 8192 * 1024
...
...
src/switch.c
浏览文件 @
bf607b0d
...
@@ -366,6 +366,7 @@ static const char usage[] =
...
@@ -366,6 +366,7 @@ static const char usage[] =
"
\t
-c -- output to a console and stay in the foreground
\n
"
"
\t
-c -- output to a console and stay in the foreground
\n
"
"
\n\t
Options to control locations of files:
\n
"
"
\n\t
Options to control locations of files:
\n
"
"
\t
-base [basedir] -- alternate prefix directory
\n
"
"
\t
-base [basedir] -- alternate prefix directory
\n
"
"
\t
-cfgname [filename] -- alternate filename for FreeSWITCH main configuration file
\n
"
"
\t
-conf [confdir] -- alternate directory for FreeSWITCH configuration files
\n
"
"
\t
-conf [confdir] -- alternate directory for FreeSWITCH configuration files
\n
"
"
\t
-log [logdir] -- alternate directory for logfiles
\n
"
"
\t
-log [logdir] -- alternate directory for logfiles
\n
"
"
\t
-run [rundir] -- alternate directory for runtime files
\n
"
"
\t
-run [rundir] -- alternate directory for runtime files
\n
"
...
@@ -857,6 +858,21 @@ int main(int argc, char *argv[])
...
@@ -857,6 +858,21 @@ int main(int argc, char *argv[])
strcpy
(
SWITCH_GLOBAL_dirs
.
sounds_dir
,
local_argv
[
x
]);
strcpy
(
SWITCH_GLOBAL_dirs
.
sounds_dir
,
local_argv
[
x
]);
}
}
else
if
(
!
strcmp
(
local_argv
[
x
],
"-cfgname"
))
{
x
++
;
if
(
switch_strlen_zero
(
local_argv
[
x
])
||
is_option
(
local_argv
[
x
]))
{
fprintf
(
stderr
,
"When using -cfgname you must specify a filename
\n
"
);
return
255
;
}
SWITCH_GLOBAL_filenames
.
conf_name
=
(
char
*
)
malloc
(
strlen
(
local_argv
[
x
])
+
1
);
if
(
!
SWITCH_GLOBAL_filenames
.
conf_name
)
{
fprintf
(
stderr
,
"Allocation error
\n
"
);
return
255
;
}
strcpy
(
SWITCH_GLOBAL_filenames
.
conf_name
,
local_argv
[
x
]);
}
/* Unknown option (always last!) */
/* Unknown option (always last!) */
else
{
else
{
fprintf
(
stderr
,
"Unknown option '%s', see '%s -help' for a list of valid options
\n
"
,
fprintf
(
stderr
,
"Unknown option '%s', see '%s -help' for a list of valid options
\n
"
,
...
...
src/switch_core.c
浏览文件 @
bf607b0d
...
@@ -53,6 +53,7 @@
...
@@ -53,6 +53,7 @@
SWITCH_DECLARE_DATA
switch_directories
SWITCH_GLOBAL_dirs
=
{
0
};
SWITCH_DECLARE_DATA
switch_directories
SWITCH_GLOBAL_dirs
=
{
0
};
SWITCH_DECLARE_DATA
switch_filenames
SWITCH_GLOBAL_filenames
=
{
0
};
/* The main runtime obj we keep this hidden for ourselves */
/* The main runtime obj we keep this hidden for ourselves */
struct
switch_runtime
runtime
=
{
0
};
struct
switch_runtime
runtime
=
{
0
};
...
@@ -739,6 +740,10 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
...
@@ -739,6 +740,10 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
#endif
#endif
}
}
if
(
!
SWITCH_GLOBAL_filenames
.
conf_name
&&
(
SWITCH_GLOBAL_filenames
.
conf_name
=
(
char
*
)
malloc
(
BUFSIZE
)))
{
switch_snprintf
(
SWITCH_GLOBAL_filenames
.
conf_name
,
BUFSIZE
,
"%s"
,
"freeswitch.xml"
);
}
/* Do this last because it being empty is part of the above logic */
/* Do this last because it being empty is part of the above logic */
if
(
!
SWITCH_GLOBAL_dirs
.
base_dir
&&
(
SWITCH_GLOBAL_dirs
.
base_dir
=
(
char
*
)
malloc
(
BUFSIZE
)))
{
if
(
!
SWITCH_GLOBAL_dirs
.
base_dir
&&
(
SWITCH_GLOBAL_dirs
.
base_dir
=
(
char
*
)
malloc
(
BUFSIZE
)))
{
switch_snprintf
(
SWITCH_GLOBAL_dirs
.
base_dir
,
BUFSIZE
,
"%s"
,
base_dir
);
switch_snprintf
(
SWITCH_GLOBAL_dirs
.
base_dir
,
BUFSIZE
,
"%s"
,
base_dir
);
...
@@ -758,6 +763,8 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
...
@@ -758,6 +763,8 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
switch_assert
(
SWITCH_GLOBAL_dirs
.
sounds_dir
);
switch_assert
(
SWITCH_GLOBAL_dirs
.
sounds_dir
);
switch_assert
(
SWITCH_GLOBAL_dirs
.
certs_dir
);
switch_assert
(
SWITCH_GLOBAL_dirs
.
certs_dir
);
switch_assert
(
SWITCH_GLOBAL_dirs
.
temp_dir
);
switch_assert
(
SWITCH_GLOBAL_dirs
.
temp_dir
);
switch_assert
(
SWITCH_GLOBAL_filenames
.
conf_name
);
}
}
...
...
src/switch_xml.c
浏览文件 @
bf607b0d
...
@@ -2167,7 +2167,7 @@ SWITCH_DECLARE_NONSTD(switch_xml_t) __switch_xml_open_root(uint8_t reload, const
...
@@ -2167,7 +2167,7 @@ SWITCH_DECLARE_NONSTD(switch_xml_t) __switch_xml_open_root(uint8_t reload, const
}
}
}
}
switch_snprintf
(
path_buf
,
sizeof
(
path_buf
),
"%s%s%s"
,
SWITCH_GLOBAL_dirs
.
conf_dir
,
SWITCH_PATH_SEPARATOR
,
"freeswitch.xml"
);
switch_snprintf
(
path_buf
,
sizeof
(
path_buf
),
"%s%s%s"
,
SWITCH_GLOBAL_dirs
.
conf_dir
,
SWITCH_PATH_SEPARATOR
,
SWITCH_GLOBAL_filenames
.
conf_name
);
if
((
new_main
=
switch_xml_parse_file
(
path_buf
)))
{
if
((
new_main
=
switch_xml_parse_file
(
path_buf
)))
{
*
err
=
switch_xml_error
(
new_main
);
*
err
=
switch_xml_error
(
new_main
);
switch_copy_string
(
not_so_threadsafe_error_buffer
,
*
err
,
sizeof
(
not_so_threadsafe_error_buffer
));
switch_copy_string
(
not_so_threadsafe_error_buffer
,
*
err
,
sizeof
(
not_so_threadsafe_error_buffer
));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论