Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
a121665b
提交
a121665b
authored
2月 05, 2014
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-6190 --resolve slightly modified, please test
上级
6f52c549
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
20 行增加
和
3 行删除
+20
-3
sofia_presence.c
src/mod/endpoints/mod_sofia/sofia_presence.c
+20
-3
没有找到文件。
src/mod/endpoints/mod_sofia/sofia_presence.c
浏览文件 @
a121665b
...
...
@@ -693,6 +693,7 @@ static void do_normal_probe(switch_event_t *event)
struct
resub_helper
h
=
{
0
};
char
*
to
=
switch_event_get_header
(
event
,
"to"
);
char
*
proto
=
switch_event_get_header
(
event
,
"proto"
);
char
*
profile_name
=
switch_event_get_header
(
event
,
"sip_profile"
);
char
*
probe_user
=
NULL
,
*
probe_euser
,
*
probe_host
,
*
p
;
struct
dialog_helper
dh
=
{
{
0
}
};
char
*
sub_call_id
=
switch_event_get_header
(
event
,
"sub-call-id"
);
...
...
@@ -716,7 +717,8 @@ static void do_normal_probe(switch_event_t *event)
probe_euser
=
(
p
+
1
);
}
if
(
probe_euser
&&
probe_host
&&
(
profile
=
sofia_glue_find_profile
(
probe_host
)))
{
if
(
probe_euser
&&
probe_host
&&
((
profile
=
sofia_glue_find_profile
(
probe_host
))
||
(
profile_name
&&
(
profile
=
sofia_glue_find_profile
(
profile_name
)))))
{
sql
=
switch_mprintf
(
"select state,status,rpid,presence_id,uuid from sip_dialogs "
"where hostname='%q' and profile_name='%q' and call_info_state != 'seized' and "
"((sip_from_user='%q' and sip_from_host='%q') or presence_id='%q@%q') order by rcd desc"
,
...
...
@@ -817,6 +819,7 @@ static void do_normal_probe(switch_event_t *event)
if
(
switch_event_create
(
&
sevent
,
SWITCH_EVENT_PRESENCE_IN
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"proto"
,
SOFIA_CHAT_PROTO
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"login"
,
profile
->
name
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"sip_profile"
,
profile
->
name
);
switch_event_add_header
(
sevent
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
probe_euser
,
probe_host
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"status"
,
"Unregistered"
);
switch_event_fire
(
&
sevent
);
...
...
@@ -838,7 +841,6 @@ static void do_dialog_probe(switch_event_t *event)
char
*
sql
;
char
*
to
=
switch_event_get_header
(
event
,
"to"
);
char
*
probe_user
=
NULL
,
*
probe_euser
,
*
probe_host
,
*
p
;
sofia_profile_t
*
profile
;
if
(
!
to
||
!
(
probe_user
=
strdup
(
to
)))
{
return
;
...
...
@@ -852,11 +854,19 @@ static void do_dialog_probe(switch_event_t *event)
probe_euser
=
(
p
+
1
);
}
if
(
probe_euser
&&
probe_host
&&
(
profile
=
sofia_glue_find_profile
(
probe_host
))
)
{
if
(
probe_euser
&&
probe_host
)
{
char
*
sub_call_id
=
switch_event_get_header
(
event
,
"sub-call-id"
);
char
*
profile_name
=
switch_event_get_header
(
event
,
"sip_profile"
);
sofia_profile_t
*
profile
=
sofia_glue_find_profile
(
probe_host
);
struct
rfc4235_helper
*
h4235
=
{
0
};
switch_memory_pool_t
*
pool
;
if
(
!
profile
&&
profile_name
)
{
profile
=
sofia_glue_find_profile
(
profile_name
);
}
else
if
(
!
profile
)
{
switch_safe_free
(
probe_user
);
}
// We need all dialogs with presence_id matching the subscription entity,
// or from a registered set matching the subscription entity.
// We need the "proto" of the subscription in case it is for the special "conf" or "park".
...
...
@@ -1743,6 +1753,7 @@ static int sofia_presence_sub_reg_callback(void *pArg, int argc, char **argv, ch
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_PRESENCE_PROBE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
SOFIA_CHAT_PROTO
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
profile
->
url
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"sip_profile"
,
profile
->
name
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
user
,
host
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"event_type"
,
"presence"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"event_subtype"
,
"probe"
);
...
...
@@ -1829,6 +1840,7 @@ static int sofia_presence_resub_callback(void *pArg, int argc, char **argv, char
if
(
do_event
&&
switch_event_create
(
&
event
,
SWITCH_EVENT_PRESENCE_IN
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
proto
?
proto
:
SOFIA_CHAT_PROTO
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
profile
->
url
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"sip_profile"
,
profile
->
name
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
user
,
host
);
...
...
@@ -4176,6 +4188,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"orig_proto"
,
orig_proto
);
}
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"login"
,
profile
->
name
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"sip_profile"
,
profile
->
name
);
switch_event_add_header
(
sevent
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
to_user
,
to_host
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"rpid"
,
"active"
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"status"
,
"Click To Call"
);
...
...
@@ -4189,6 +4202,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"orig_proto"
,
orig_proto
);
}
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"login"
,
profile
->
name
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"sip_profile"
,
profile
->
name
);
switch_event_add_header
(
sevent
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
from_user
,
from_host
);
switch_event_add_header
(
sevent
,
SWITCH_STACK_BOTTOM
,
"to"
,
"%s%s%s@%s"
,
proto
,
"+"
,
to_user
,
to_host
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"proto-specific-event-name"
,
event
);
...
...
@@ -4206,6 +4220,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"probe-type"
,
"dialog"
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"proto"
,
SOFIA_CHAT_PROTO
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"login"
,
profile
->
name
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"sip_profile"
,
profile
->
name
);
switch_event_add_header
(
sevent
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
from_user
,
from_host
);
switch_event_add_header
(
sevent
,
SWITCH_STACK_BOTTOM
,
"to"
,
"%s@%s"
,
to_user
,
to_host
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"proto-specific-event-name"
,
event
);
...
...
@@ -4220,6 +4235,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
if
(
switch_event_create
(
&
sevent
,
SWITCH_EVENT_PRESENCE_PROBE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"proto"
,
SOFIA_CHAT_PROTO
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"login"
,
profile
->
name
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"sip_profile"
,
profile
->
name
);
switch_event_add_header_string
(
sevent
,
SWITCH_STACK_BOTTOM
,
"presence-source"
,
"subscribe"
);
switch_event_add_header
(
sevent
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
from_user
,
from_host
);
switch_event_add_header
(
sevent
,
SWITCH_STACK_BOTTOM
,
"to"
,
"%s@%s"
,
to_user
,
to_host
);
...
...
@@ -4533,6 +4549,7 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
SOFIA_CHAT_PROTO
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"rpid"
,
rpid
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
profile
->
url
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"sip_profile"
,
profile
->
name
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"user-agent"
,
full_agent
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
from_user
,
from_host
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"status"
,
note_txt
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论