Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
786ca1f9
提交
786ca1f9
authored
7月 30, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
presence changes
上级
3604bd05
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
158 行增加
和
70 行删除
+158
-70
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+8
-7
sofia_presence.c
src/mod/endpoints/mod_sofia/sofia_presence.c
+142
-57
sofia_reg.c
src/mod/endpoints/mod_sofia/sofia_reg.c
+7
-5
switch_core_state_machine.c
src/switch_core_state_machine.c
+1
-1
没有找到文件。
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
786ca1f9
...
@@ -4732,8 +4732,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
...
@@ -4732,8 +4732,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
" hostname VARCHAR(255),
\n
"
" hostname VARCHAR(255),
\n
"
" network_ip VARCHAR(255),
\n
"
" network_ip VARCHAR(255),
\n
"
" network_port VARCHAR(6),
\n
"
" network_port VARCHAR(6),
\n
"
" content_type VARCHAR(255),
\n
"
" open_closed VARCHAR(255)
\n
"
" content text"
");
\n
"
;
");
\n
"
;
char
dialog_sql
[]
=
char
dialog_sql
[]
=
...
@@ -4756,7 +4755,9 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
...
@@ -4756,7 +4755,9 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
" presence_data VARCHAR(255),
\n
"
" presence_data VARCHAR(255),
\n
"
" call_info VARCHAR(255),
\n
"
" call_info VARCHAR(255),
\n
"
" call_info_state VARCHAR(255),
\n
"
" call_info_state VARCHAR(255),
\n
"
" expires INTEGER default 0
\n
"
" expires INTEGER default 0,
\n
"
" status VARCHAR(255),
\n
"
" rpid VARCHAR(255)
\n
"
");
\n
"
;
");
\n
"
;
char
sub_sql
[]
=
char
sub_sql
[]
=
...
@@ -4915,7 +4916,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
...
@@ -4915,7 +4916,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
}
}
free
(
test_sql
);
free
(
test_sql
);
test_sql
=
switch_mprintf
(
"delete from sip_dialogs where hostname='%q' and expires <> -9999"
,
mod_sofia_globals
.
hostname
);
test_sql
=
switch_mprintf
(
"delete from sip_dialogs where hostname='%q' and expires <> -9999
or rpid=''
"
,
mod_sofia_globals
.
hostname
);
if
(
switch_odbc_handle_exec
(
odbc_dbh
,
test_sql
,
NULL
,
NULL
)
!=
SWITCH_ODBC_SUCCESS
)
{
if
(
switch_odbc_handle_exec
(
odbc_dbh
,
test_sql
,
NULL
,
NULL
)
!=
SWITCH_ODBC_SUCCESS
)
{
switch_odbc_handle_exec
(
odbc_dbh
,
"DROP TABLE sip_dialogs"
,
NULL
,
NULL
);
switch_odbc_handle_exec
(
odbc_dbh
,
"DROP TABLE sip_dialogs"
,
NULL
,
NULL
);
...
@@ -4923,7 +4924,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
...
@@ -4923,7 +4924,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
}
}
free
(
test_sql
);
free
(
test_sql
);
test_sql
=
switch_mprintf
(
"delete from sip_presence where hostname='%q' or
content_type
=''"
,
mod_sofia_globals
.
hostname
);
test_sql
=
switch_mprintf
(
"delete from sip_presence where hostname='%q' or
open_closed
=''"
,
mod_sofia_globals
.
hostname
);
if
(
switch_odbc_handle_exec
(
odbc_dbh
,
test_sql
,
NULL
,
NULL
)
!=
SWITCH_ODBC_SUCCESS
)
{
if
(
switch_odbc_handle_exec
(
odbc_dbh
,
test_sql
,
NULL
,
NULL
)
!=
SWITCH_ODBC_SUCCESS
)
{
switch_odbc_handle_exec
(
odbc_dbh
,
"DROP TABLE sip_presence"
,
NULL
,
NULL
);
switch_odbc_handle_exec
(
odbc_dbh
,
"DROP TABLE sip_presence"
,
NULL
,
NULL
);
...
@@ -4995,11 +4996,11 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
...
@@ -4995,11 +4996,11 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
switch_core_db_test_reactive
(
db
,
test_sql
,
"DROP TABLE sip_subscriptions"
,
sub_sql
);
switch_core_db_test_reactive
(
db
,
test_sql
,
"DROP TABLE sip_subscriptions"
,
sub_sql
);
free
(
test_sql
);
free
(
test_sql
);
test_sql
=
switch_mprintf
(
"delete from sip_dialogs where hostname='%q' and expires <> -9999"
,
mod_sofia_globals
.
hostname
);
test_sql
=
switch_mprintf
(
"delete from sip_dialogs where hostname='%q' and expires <> -9999
or rpid=''
"
,
mod_sofia_globals
.
hostname
);
switch_core_db_test_reactive
(
db
,
test_sql
,
"DROP TABLE sip_dialogs"
,
dialog_sql
);
switch_core_db_test_reactive
(
db
,
test_sql
,
"DROP TABLE sip_dialogs"
,
dialog_sql
);
free
(
test_sql
);
free
(
test_sql
);
test_sql
=
switch_mprintf
(
"delete from sip_presence where hostname='%q' or
content_type
=''"
,
mod_sofia_globals
.
hostname
);
test_sql
=
switch_mprintf
(
"delete from sip_presence where hostname='%q' or
open_closed
=''"
,
mod_sofia_globals
.
hostname
);
switch_core_db_test_reactive
(
db
,
test_sql
,
"DROP TABLE sip_presence"
,
pres_sql
);
switch_core_db_test_reactive
(
db
,
test_sql
,
"DROP TABLE sip_presence"
,
pres_sql
);
free
(
test_sql
);
free
(
test_sql
);
...
...
src/mod/endpoints/mod_sofia/sofia_presence.c
浏览文件 @
786ca1f9
差异被折叠。
点击展开。
src/mod/endpoints/mod_sofia/sofia_reg.c
浏览文件 @
786ca1f9
...
@@ -567,7 +567,7 @@ void sofia_reg_expire_call_id(sofia_profile_t *profile, const char *call_id, int
...
@@ -567,7 +567,7 @@ void sofia_reg_expire_call_id(sofia_profile_t *profile, const char *call_id, int
switch_safe_free
(
sql
);
switch_safe_free
(
sql
);
sql
=
switch_mprintf
(
"delete from sip_registrations where call_id='%q' or (sip_user='%q' and sip_host='%q')"
,
call_id
,
user
,
host
);
sql
=
switch_mprintf
(
"delete from sip_registrations where call_id='%q' or (sip_user='%q' and sip_host='%q')"
,
call_id
,
user
,
host
);
sofia_glue_execute_sql
(
profile
,
&
sql
,
SWITCH_FALSE
);
sofia_glue_execute_sql
_now
(
profile
,
&
sql
,
SWITCH_FALSE
);
switch_safe_free
(
sql
);
switch_safe_free
(
sql
);
switch_safe_free
(
dup
);
switch_safe_free
(
dup
);
...
@@ -1127,6 +1127,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
...
@@ -1127,6 +1127,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
sofia_glue_execute_sql_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
sofia_glue_execute_sql_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
switch_find_local_ip
(
guess_ip4
,
sizeof
(
guess_ip4
),
NULL
,
AF_INET
);
switch_find_local_ip
(
guess_ip4
,
sizeof
(
guess_ip4
),
NULL
,
AF_INET
);
sql
=
switch_mprintf
(
"insert into sip_registrations "
sql
=
switch_mprintf
(
"insert into sip_registrations "
"(call_id,sip_user,sip_host,presence_hosts,contact,status,rpid,expires,"
"(call_id,sip_user,sip_host,presence_hosts,contact,status,rpid,expires,"
"user_agent,server_user,server_host,profile_name,hostname,network_ip,network_port,sip_username,sip_realm,"
"user_agent,server_user,server_host,profile_name,hostname,network_ip,network_port,sip_username,sip_realm,"
...
@@ -1141,6 +1142,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
...
@@ -1141,6 +1142,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
sofia_glue_execute_sql_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
sofia_glue_execute_sql_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
}
}
switch_mutex_unlock
(
profile
->
ireg_mutex
);
switch_mutex_unlock
(
profile
->
ireg_mutex
);
if
(
switch_event_create_subclass
(
&
s_event
,
SWITCH_EVENT_CUSTOM
,
MY_EVENT_REGISTER
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_event_create_subclass
(
&
s_event
,
SWITCH_EVENT_CUSTOM
,
MY_EVENT_REGISTER
)
==
SWITCH_STATUS_SUCCESS
)
{
...
@@ -1245,7 +1247,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
...
@@ -1245,7 +1247,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
sql
=
switch_mprintf
(
"delete from sip_subscriptions where call_id='%q'"
,
call_id
);
sql
=
switch_mprintf
(
"delete from sip_subscriptions where call_id='%q'"
,
call_id
);
}
}
sofia_glue_execute_sql
(
profile
,
&
sql
,
SWITCH_TRUE
);
sofia_glue_execute_sql
_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
if
(
multi_reg_contact
)
{
if
(
multi_reg_contact
)
{
sql
=
sql
=
...
@@ -1254,16 +1256,16 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
...
@@ -1254,16 +1256,16 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
sql
=
switch_mprintf
(
"delete from sip_registrations where call_id='%q'"
,
call_id
);
sql
=
switch_mprintf
(
"delete from sip_registrations where call_id='%q'"
,
call_id
);
}
}
sofia_glue_execute_sql
(
profile
,
&
sql
,
SWITCH_TRUE
);
sofia_glue_execute_sql
_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
switch_safe_free
(
icontact
);
switch_safe_free
(
icontact
);
}
else
{
}
else
{
if
((
sql
=
switch_mprintf
(
"delete from sip_subscriptions where sip_user='%q' and sip_host='%q'"
,
to_user
,
reg_host
)))
{
if
((
sql
=
switch_mprintf
(
"delete from sip_subscriptions where sip_user='%q' and sip_host='%q'"
,
to_user
,
reg_host
)))
{
sofia_glue_execute_sql
(
profile
,
&
sql
,
SWITCH_TRUE
);
sofia_glue_execute_sql
_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
}
}
if
((
sql
=
switch_mprintf
(
"delete from sip_registrations where sip_user='%q' and sip_host='%q'"
,
to_user
,
reg_host
)))
{
if
((
sql
=
switch_mprintf
(
"delete from sip_registrations where sip_user='%q' and sip_host='%q'"
,
to_user
,
reg_host
)))
{
sofia_glue_execute_sql
(
profile
,
&
sql
,
SWITCH_TRUE
);
sofia_glue_execute_sql
_now
(
profile
,
&
sql
,
SWITCH_TRUE
);
}
}
}
}
}
}
...
...
src/switch_core_state_machine.c
浏览文件 @
786ca1f9
...
@@ -528,7 +528,7 @@ SWITCH_DECLARE(void) switch_core_session_hangup_state(switch_core_session_t *ses
...
@@ -528,7 +528,7 @@ SWITCH_DECLARE(void) switch_core_session_hangup_state(switch_core_session_t *ses
switch_channel_set_variable
(
session
->
channel
,
"hangup_cause"
,
switch_channel_cause2str
(
cause
));
switch_channel_set_variable
(
session
->
channel
,
"hangup_cause"
,
switch_channel_cause2str
(
cause
));
switch_channel_set_variable_printf
(
session
->
channel
,
"hangup_cause_q850"
,
"%d"
,
cause_q850
);
switch_channel_set_variable_printf
(
session
->
channel
,
"hangup_cause_q850"
,
"%d"
,
cause_q850
);
switch_channel_presence
(
session
->
channel
,
"unknown"
,
switch_channel_cause2str
(
cause
),
NULL
);
//
switch_channel_presence(session->channel, "unknown", switch_channel_cause2str(cause), NULL);
switch_channel_set_timestamps
(
session
->
channel
);
switch_channel_set_timestamps
(
session
->
channel
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论