Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
f657a378
提交
f657a378
authored
10月 29, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix regression from config refactor in rescan behaviour to pick up new gateways
上级
5533d713
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
89 行增加
和
25 行删除
+89
-25
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+89
-25
没有找到文件。
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
f657a378
...
@@ -4581,40 +4581,104 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
...
@@ -4581,40 +4581,104 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
}
}
}
}
if
(
profile
&&
!
profile_already_started
)
{
switch_xml_t
aliases_tag
,
alias_tag
;
if
((
aliases_tag
=
switch_xml_child
(
xprofile
,
"aliases"
)))
{
if
(
profile
)
{
for
(
alias_tag
=
switch_xml_child
(
aliases_tag
,
"alias"
);
alias_tag
;
alias_tag
=
alias_tag
->
next
)
{
if
(
profile_already_started
)
{
char
*
aname
=
(
char
*
)
switch_xml_attr_soft
(
alias_tag
,
"name"
);
switch_xml_t
gateways_tag
,
domain_tag
,
domains_tag
,
aliases_tag
,
alias_tag
;
if
(
!
zstr
(
aname
))
{
if
(
sofia_glue_add_profile
(
switch_core_strdup
(
profile
->
pool
,
aname
),
profile
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
sofia_test_flag
(
profile
,
TFLAG_ZRTP_PASSTHRU
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"Adding Alias [%s] for profile [%s]
\n
"
,
aname
,
profile
->
name
);
sofia_set_flag
(
profile
,
TFLAG_LATE_NEGOTIATION
);
}
else
{
}
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Error Adding Alias [%s] for profile [%s] (name in use)
\n
"
,
aname
,
profile
->
name
);
if
((
gateways_tag
=
switch_xml_child
(
xprofile
,
"gateways"
)))
{
parse_gateways
(
profile
,
gateways_tag
);
}
status
=
SWITCH_STATUS_SUCCESS
;
if
((
domains_tag
=
switch_xml_child
(
xprofile
,
"domains"
)))
{
switch_event_t
*
xml_params
;
switch_event_create
(
&
xml_params
,
SWITCH_EVENT_REQUEST_PARAMS
);
switch_assert
(
xml_params
);
switch_event_add_header_string
(
xml_params
,
SWITCH_STACK_BOTTOM
,
"purpose"
,
"gateways"
);
switch_event_add_header_string
(
xml_params
,
SWITCH_STACK_BOTTOM
,
"profile"
,
profile
->
name
);
for
(
domain_tag
=
switch_xml_child
(
domains_tag
,
"domain"
);
domain_tag
;
domain_tag
=
domain_tag
->
next
)
{
switch_xml_t
droot
,
x_domain_tag
;
const
char
*
dname
=
switch_xml_attr_soft
(
domain_tag
,
"name"
);
const
char
*
parse
=
switch_xml_attr_soft
(
domain_tag
,
"parse"
);
const
char
*
alias
=
switch_xml_attr_soft
(
domain_tag
,
"alias"
);
if
(
!
zstr
(
dname
))
{
if
(
!
strcasecmp
(
dname
,
"all"
))
{
switch_xml_t
xml_root
,
x_domains
;
if
(
switch_xml_locate
(
"directory"
,
NULL
,
NULL
,
NULL
,
&
xml_root
,
&
x_domains
,
xml_params
,
SWITCH_FALSE
)
==
SWITCH_STATUS_SUCCESS
)
{
for
(
x_domain_tag
=
switch_xml_child
(
x_domains
,
"domain"
);
x_domain_tag
;
x_domain_tag
=
x_domain_tag
->
next
)
{
dname
=
switch_xml_attr_soft
(
x_domain_tag
,
"name"
);
parse_domain_tag
(
profile
,
x_domain_tag
,
dname
,
parse
,
alias
);
}
switch_xml_free
(
xml_root
);
}
}
else
if
(
switch_xml_locate_domain
(
dname
,
xml_params
,
&
droot
,
&
x_domain_tag
)
==
SWITCH_STATUS_SUCCESS
)
{
parse_domain_tag
(
profile
,
x_domain_tag
,
dname
,
parse
,
alias
);
switch_xml_free
(
droot
);
}
}
}
}
}
switch_event_destroy
(
&
xml_params
);
}
}
}
if
(
profile
->
sipip
)
{
if
((
aliases_tag
=
switch_xml_child
(
xprofile
,
"aliases"
)))
{
launch_sofia_profile_thread
(
profile
);
for
(
alias_tag
=
switch_xml_child
(
aliases_tag
,
"alias"
);
alias_tag
;
alias_tag
=
alias_tag
->
next
)
{
if
(
profile
->
odbc_dsn
)
{
char
*
aname
=
(
char
*
)
switch_xml_attr_soft
(
alias_tag
,
"name"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"Connecting ODBC Profile %s [%s]
\n
"
,
profile
->
name
,
url
);
if
(
!
zstr
(
aname
))
{
switch_yield
(
1000000
);
}
else
{
if
(
sofia_glue_add_profile
(
switch_core_strdup
(
profile
->
pool
,
aname
),
profile
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"Started Profile %s [%s]
\n
"
,
profile
->
name
,
url
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"Adding Alias [%s] for profile [%s]
\n
"
,
aname
,
profile
->
name
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Alias [%s] for profile [%s] (already exists)
\n
"
,
aname
,
profile
->
name
);
}
}
}
}
}
}
else
{
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"Unable to start Profile %s due to no configured sip-ip
\n
"
,
profile
->
name
);
switch_xml_t
aliases_tag
,
alias_tag
;
sofia_profile_start_failure
(
profile
,
profile
->
name
);
if
((
aliases_tag
=
switch_xml_child
(
xprofile
,
"aliases"
)))
{
for
(
alias_tag
=
switch_xml_child
(
aliases_tag
,
"alias"
);
alias_tag
;
alias_tag
=
alias_tag
->
next
)
{
char
*
aname
=
(
char
*
)
switch_xml_attr_soft
(
alias_tag
,
"name"
);
if
(
!
zstr
(
aname
))
{
if
(
sofia_glue_add_profile
(
switch_core_strdup
(
profile
->
pool
,
aname
),
profile
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"Adding Alias [%s] for profile [%s]
\n
"
,
aname
,
profile
->
name
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Error Adding Alias [%s] for profile [%s] (name in use)
\n
"
,
aname
,
profile
->
name
);
}
}
}
}
if
(
profile
->
sipip
)
{
launch_sofia_profile_thread
(
profile
);
if
(
profile
->
odbc_dsn
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"Connecting ODBC Profile %s [%s]
\n
"
,
profile
->
name
,
url
);
switch_yield
(
1000000
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"Started Profile %s [%s]
\n
"
,
profile
->
name
,
url
);
}
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"Unable to start Profile %s due to no configured sip-ip
\n
"
,
profile
->
name
);
sofia_profile_start_failure
(
profile
,
profile
->
name
);
}
profile
=
NULL
;
}
if
(
profile_found
)
{
break
;
}
}
profile
=
NULL
;
}
if
(
profile_found
)
{
break
;
}
}
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论