Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
464ecd1b
提交
464ecd1b
authored
6月 24, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
revert part of
92bd8966
FSCORE-598
上级
64a71c57
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
15 行增加
和
39 行删除
+15
-39
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+12
-20
sofia_presence.c
src/mod/endpoints/mod_sofia/sofia_presence.c
+3
-19
没有找到文件。
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
464ecd1b
...
...
@@ -3871,7 +3871,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
switch_channel_t
*
a_channel
;
const
char
*
sip_redirect_profile
,
*
sip_redirect_context
,
*
sip_redirect_dialplan
,
*
sip_redirect_fork
;
if
((
a_session
=
switch_core_session_locate
(
br
))
&&
(
a_channel
=
switch_core_session_get_channel
(
a_session
)))
{
switch_stream_handle_t
stream
=
{
0
};
char
separator
[
2
]
=
"|"
;
...
...
@@ -4103,7 +4103,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
if
(
profile
->
pres_type
)
{
const
char
*
presence_data
=
switch_channel_get_variable
(
channel
,
"presence_data"
);
//
const char *presence_id = switch_channel_get_variable(channel, "presence_id");
const
char
*
presence_id
=
switch_channel_get_variable
(
channel
,
"presence_id"
);
char
*
full_contact
=
""
;
char
*
p
=
NULL
;
...
...
@@ -4114,26 +4114,18 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
if
(
call_info
&&
(
p
=
strchr
(
call_info
,
';'
)))
{
p
++
;
}
sql
=
switch_mprintf
(
"update sip_dialogs set "
"call_id='%q', "
"sip_to_user='%q', "
"sip_to_host='%q', "
"sip_from_user='%q', "
"sip_from_host='%q', "
"contact_user='%q', "
"contact_host='%q', "
"state='%q', "
"user_agent='%q', "
"contact='%q', "
"presence_data='%q', "
"call_info='%q' where uuid='%q'"
,
sql
=
switch_mprintf
(
"insert into sip_dialogs "
"(call_id,uuid,sip_to_user,sip_to_host,sip_from_user,sip_from_host,contact_user,"
"contact_host,state,direction,user_agent,profile_name,hostname,contact,presence_id,presence_data,call_info) "
"values('%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q')"
,
call_id
,
switch_core_session_get_uuid
(
session
),
to_user
,
to_host
,
from_user
,
from_host
,
contact_user
,
contact_host
,
astate
,
user_agent
,
switch_str_nil
(
full_contact
),
switch_str_nil
(
presence_data
),
switch_str_nil
(
p
),
switch_core_session_get_uuid
(
session
));
contact_host
,
astate
,
"outbound"
,
user_agent
,
profile
->
name
,
mod_sofia_globals
.
hostname
,
switch_str_nil
(
full_contact
),
switch_str_nil
(
presence_id
),
switch_str_nil
(
presence_data
),
switch_str_nil
(
p
));
switch_assert
(
sql
);
sofia_glue_actually_execute_sql
(
profile
,
sql
,
profile
->
ireg_mutex
);
switch_safe_free
(
sql
);
...
...
src/mod/endpoints/mod_sofia/sofia_presence.c
浏览文件 @
464ecd1b
...
...
@@ -581,7 +581,6 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
if
(
!
mod_sofia_globals
.
profile_hash
)
goto
done
;
switch_mutex_lock
(
mod_sofia_globals
.
hash_mutex
);
for
(
hi
=
switch_hash_first
(
NULL
,
mod_sofia_globals
.
profile_hash
);
hi
;
hi
=
switch_hash_next
(
hi
))
{
switch_hash_this
(
hi
,
&
var
,
NULL
,
&
val
);
...
...
@@ -601,10 +600,10 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
continue
;
}
if
(
call_info
)
{
const
char
*
uuid
=
switch_event_get_header
(
event
,
"unique-id"
);
#if 0
if (mod_sofia_globals.debug_sla > 1) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SLA EVENT:\n");
...
...
@@ -634,24 +633,9 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
}
sync_sla
(
profile
,
euser
,
host
,
SWITCH_TRUE
,
SWITCH_TRUE
);
}
else
{
char
count_buf
[
128
]
=
""
;
int
count
=
0
;
const
char
*
state
=
switch_event_get_header
(
event
,
"channel-state"
);
sql
=
switch_mprintf
(
"select count(*) from sip_dialogs "
"where hostname='%q' and presence_id='%q@%q'"
,
mod_sofia_globals
.
hostname
,
euser
,
host
);
sofia_glue_execute_sql2str
(
profile
,
profile
->
ireg_mutex
,
sql
,
count_buf
,
sizeof
(
count_buf
));
count
=
atoi
(
count_buf
);
switch_safe_free
(
sql
);
if
(
count
>
1
||
(
count
>
0
&&
switch_stristr
(
"hangup"
,
state
)))
{
continue
;
}
}
if
((
sql
=
switch_mprintf
(
"select sip_subscriptions.proto,sip_subscriptions.sip_user,sip_subscriptions.sip_host,"
"sip_subscriptions.sub_to_user,sip_subscriptions.sub_to_host,sip_subscriptions.event,"
"sip_subscriptions.contact,sip_subscriptions.call_id,sip_subscriptions.full_from,"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论