Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
eeeb4fa4
提交
eeeb4fa4
authored
4月 24, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-5340 --resolve
上级
032761c0
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
39 行增加
和
6 行删除
+39
-6
mod_sofia.h
src/mod/endpoints/mod_sofia/mod_sofia.h
+2
-0
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+4
-1
sofia_reg.c
src/mod/endpoints/mod_sofia/sofia_reg.c
+33
-5
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.h
浏览文件 @
eeeb4fa4
...
...
@@ -600,6 +600,7 @@ struct sofia_profile {
sofia_gateway_t
*
gateways
;
//su_home_t *home;
switch_hash_t
*
chat_hash
;
switch_hash_t
*
reg_nh_hash
;
switch_hash_t
*
mwi_debounce_hash
;
//switch_core_db_t *master_db;
switch_thread_rwlock_t
*
rwlock
;
...
...
@@ -1107,6 +1108,7 @@ int sofia_glue_check_nat(sofia_profile_t *profile, const char *network_ip);
switch_status_t
sofia_glue_ext_address_lookup
(
sofia_profile_t
*
profile
,
char
**
ip
,
switch_port_t
*
port
,
const
char
*
sourceip
,
switch_memory_pool_t
*
pool
);
void
sofia_reg_check_socket
(
sofia_profile_t
*
profile
,
const
char
*
call_id
,
const
char
*
network_addr
,
const
char
*
network_ip
);
void
sofia_reg_close_handles
(
sofia_profile_t
*
profile
);
/* For Emacs:
* Local Variables:
...
...
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
eeeb4fa4
...
...
@@ -2611,6 +2611,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
}
sofia_clear_pflag_locked
(
profile
,
PFLAG_RUNNING
);
sofia_reg_close_handles
(
profile
);
switch_core_session_hupall_matching_var
(
"sofia_profile_name"
,
profile
->
name
,
SWITCH_CAUSE_MANAGER_REQUEST
);
sanity
=
10
;
...
...
@@ -2628,7 +2629,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
sofia_reg_unregister
(
profile
);
nua_shutdown
(
profile
->
nua
);
sanity
=
10
;
sanity
=
10
0
;
while
(
!
sofia_test_pflag
(
profile
,
PFLAG_SHUTDOWN
)
||
profile
->
queued_events
>
0
)
{
su_root_step
(
profile
->
s_root
,
1000
);
if
(
!--
sanity
)
{
...
...
@@ -2702,6 +2703,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
sofia_glue_del_profile
(
profile
);
switch_core_hash_destroy
(
&
profile
->
chat_hash
);
switch_core_hash_destroy
(
&
profile
->
reg_nh_hash
);
switch_core_hash_destroy
(
&
profile
->
mwi_debounce_hash
);
switch_thread_rwlock_unlock
(
profile
->
rwlock
);
...
...
@@ -3622,6 +3624,7 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
profile
->
dbname
=
switch_core_strdup
(
profile
->
pool
,
url
);
switch_core_hash_init
(
&
profile
->
chat_hash
,
profile
->
pool
);
switch_core_hash_init
(
&
profile
->
reg_nh_hash
,
profile
->
pool
);
switch_core_hash_init
(
&
profile
->
mwi_debounce_hash
,
profile
->
pool
);
switch_thread_rwlock_create
(
&
profile
->
rwlock
,
profile
->
pool
);
switch_mutex_init
(
&
profile
->
flag_mutex
,
SWITCH_MUTEX_NESTED
,
profile
->
pool
);
...
...
src/mod/endpoints/mod_sofia/sofia_reg.c
浏览文件 @
eeeb4fa4
...
...
@@ -644,9 +644,10 @@ void sofia_reg_check_socket(sofia_profile_t *profile, const char *call_id, const
switch_snprintf
(
key
,
sizeof
(
key
),
"%s%s%s"
,
call_id
,
network_addr
,
network_ip
);
switch_mutex_lock
(
profile
->
flag_mutex
);
if
((
hnh
=
switch_core_hash_find
(
profile
->
chat
_hash
,
key
)))
{
switch_core_hash_delete
(
profile
->
chat
_hash
,
key
);
if
((
hnh
=
switch_core_hash_find
(
profile
->
reg_nh
_hash
,
key
)))
{
switch_core_hash_delete
(
profile
->
reg_nh
_hash
,
key
);
nua_handle_unref
(
hnh
);
nua_handle_destroy
(
hnh
);
}
switch_mutex_unlock
(
profile
->
flag_mutex
);
}
...
...
@@ -1081,7 +1082,34 @@ static int debounce_check(sofia_profile_t *profile, const char *user, const char
return
r
;
}
void
sofia_reg_close_handles
(
sofia_profile_t
*
profile
)
{
nua_handle_t
*
nh
=
NULL
;
switch_hash_index_t
*
hi
;
const
void
*
var
;
void
*
val
;
switch_mutex_lock
(
profile
->
flag_mutex
);
if
(
profile
->
reg_nh_hash
)
{
top:
for
(
hi
=
switch_hash_first
(
NULL
,
profile
->
reg_nh_hash
);
hi
;
hi
=
switch_hash_next
(
hi
))
{
switch_hash_this
(
hi
,
&
var
,
NULL
,
&
val
);
if
((
nh
=
(
nua_handle_t
*
)
val
))
{
nua_handle_unref
(
nh
);
nua_handle_destroy
(
nh
);
switch_core_hash_delete
(
profile
->
reg_nh_hash
,
(
char
*
)
var
);
goto
top
;
}
}
}
switch_mutex_unlock
(
profile
->
flag_mutex
);
return
;
}
uint8_t
sofia_reg_handle_register
(
nua_t
*
nua
,
sofia_profile_t
*
profile
,
nua_handle_t
*
nh
,
sip_t
const
*
sip
,
sofia_dispatch_event_t
*
de
,
sofia_regtype_t
regtype
,
char
*
key
,
...
...
@@ -1699,7 +1727,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
switch_snprintf
(
key
,
sizeof
(
key
),
"%s%s%s"
,
call_id
,
network_ip
,
network_port_c
);
switch_mutex_lock
(
profile
->
flag_mutex
);
hnh
=
switch_core_hash_find
(
profile
->
chat
_hash
,
key
);
hnh
=
switch_core_hash_find
(
profile
->
reg_nh
_hash
,
key
);
switch_mutex_unlock
(
profile
->
flag_mutex
);
if
(
!
hnh
)
{
...
...
@@ -1716,7 +1744,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
*
sofia_private_p
=
sofia_private
;
nua_handle_bind
(
nh
,
sofia_private
);
nua_handle_ref
(
nh
);
switch_core_hash_insert
(
profile
->
chat
_hash
,
key
,
nh
);
switch_core_hash_insert
(
profile
->
reg_nh
_hash
,
key
,
nh
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论