Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
957361cf
提交
957361cf
authored
10月 19, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
presence tweaks
上级
9bf000b5
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
71 行增加
和
20 行删除
+71
-20
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+31
-11
mod_valet_parking.c
src/mod/applications/mod_valet_parking/mod_valet_parking.c
+34
-7
sofia_presence.c
src/mod/endpoints/mod_sofia/sofia_presence.c
+6
-2
没有找到文件。
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
957361cf
...
...
@@ -886,7 +886,12 @@ static switch_status_t conference_add_member(conference_obj_t *conference, confe
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_PRESENCE_IN
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
CONF_CHAT_PROTO
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
conference
->
name
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
conference
->
name
,
conference
->
domain
);
if
(
strchr
(
conference
->
name
,
'@'
))
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
conference
->
name
);
}
else
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
conference
->
name
,
conference
->
domain
);
}
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"force-status"
,
"Active (%d caller%s)"
,
conference
->
count
,
conference
->
count
==
1
?
""
:
"s"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"event_type"
,
"presence"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"alt_event_type"
,
"dialog"
);
...
...
@@ -1107,7 +1112,12 @@ static switch_status_t conference_del_member(conference_obj_t *conference, confe
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_PRESENCE_IN
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
CONF_CHAT_PROTO
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
conference
->
name
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
conference
->
name
,
conference
->
domain
);
if
(
strchr
(
conference
->
name
,
'@'
))
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
conference
->
name
);
}
else
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
conference
->
name
,
conference
->
domain
);
}
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"force-status"
,
"Active (%d caller%s)"
,
conference
->
count
,
conference
->
count
==
1
?
""
:
"s"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"event_type"
,
"presence"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"alt_event_type"
,
"dialog"
);
...
...
@@ -1701,7 +1711,12 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_PRESENCE_IN
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
CONF_CHAT_PROTO
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
conference
->
name
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
conference
->
name
,
conference
->
domain
);
if
(
strchr
(
conference
->
name
,
'@'
))
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
conference
->
name
);
}
else
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
conference
->
name
,
conference
->
domain
);
}
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"force-status"
,
"Inactive"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"rpid"
,
"unknown"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"event_type"
,
"presence"
);
...
...
@@ -6057,7 +6072,7 @@ SWITCH_STANDARD_APP(conference_function)
}
/* is there profile specification ? */
if
((
profile_name
=
strchr
(
conf_name
,
'@'
)))
{
if
((
profile_name
=
str
r
chr
(
conf_name
,
'@'
)))
{
*
profile_name
++
=
'\0'
;
}
else
{
profile_name
=
"default"
;
...
...
@@ -6665,6 +6680,7 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
switch_xml_t
xml_kvp
;
char
*
timer_name
=
NULL
;
char
*
domain
=
NULL
;
char
*
name_domain
=
NULL
;
char
*
tts_engine
=
NULL
;
char
*
tts_voice
=
NULL
;
char
*
enter_sound
=
NULL
;
...
...
@@ -7116,7 +7132,10 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
conference
->
announce_count
=
announce_count
;
conference
->
name
=
switch_core_strdup
(
conference
->
pool
,
name
);
if
(
domain
)
{
if
((
name_domain
=
strchr
(
conference
->
name
,
'@'
)))
{
conference
->
domain
=
switch_core_strdup
(
conference
->
pool
,
name_domain
);
}
else
if
(
domain
)
{
conference
->
domain
=
switch_core_strdup
(
conference
->
pool
,
domain
);
}
else
{
conference
->
domain
=
"cluecon.com"
;
...
...
@@ -7173,7 +7192,7 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
static
void
pres_event_handler
(
switch_event_t
*
event
)
{
char
*
to
=
switch_event_get_header
(
event
,
"to"
);
char
*
dup_to
=
NULL
,
*
conf_name
,
*
e
;
char
*
dup_to
=
NULL
,
*
conf_name
;
conference_obj_t
*
conference
;
if
(
!
to
||
strncasecmp
(
to
,
"conf+"
,
5
))
{
...
...
@@ -7186,15 +7205,16 @@ static void pres_event_handler(switch_event_t *event)
conf_name
=
dup_to
+
5
;
if
((
e
=
strchr
(
conf_name
,
'@'
)))
{
*
e
=
'\0'
;
}
if
((
conference
=
conference_find
(
conf_name
)))
{
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_PRESENCE_IN
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
CONF_CHAT_PROTO
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
conference
->
name
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
conference
->
name
,
conference
->
domain
);
if
(
strchr
(
conference
->
name
,
'@'
))
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
conference
->
name
);
}
else
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
conference
->
name
,
conference
->
domain
);
}
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"force-status"
,
"Active (%d caller%s)"
,
conference
->
count
,
conference
->
count
==
1
?
""
:
"s"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"event_type"
,
"presence"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"alt_event_type"
,
"dialog"
);
...
...
src/mod/applications/mod_valet_parking/mod_valet_parking.c
浏览文件 @
957361cf
...
...
@@ -244,7 +244,12 @@ static void valet_send_presence(const char *lot_name, valet_lot_t *lot, valet_to
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_PRESENCE_IN
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
VALET_PROTO
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
lot_name
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
lot_name
,
domain_name
);
if
(
strchr
(
lot_name
,
'@'
))
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
lot_name
);
}
else
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
lot_name
,
domain_name
);
}
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"force-status"
,
"Active (%d caller%s)"
,
count
,
count
==
1
?
""
:
"s"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"rpid"
,
"active"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"event_type"
,
"presence"
);
...
...
@@ -260,7 +265,12 @@ static void valet_send_presence(const char *lot_name, valet_lot_t *lot, valet_to
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_PRESENCE_IN
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
VALET_PROTO
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
lot_name
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
lot_name
,
domain_name
);
if
(
strchr
(
lot_name
,
'@'
))
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
lot_name
);
}
else
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
lot_name
,
domain_name
);
}
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"force-status"
,
"Empty"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"rpid"
,
"unknown"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"event_type"
,
"presence"
);
...
...
@@ -660,7 +670,11 @@ static void pres_event_handler(switch_event_t *event)
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_PRESENCE_IN
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
VALET_PROTO
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
lot_name
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
lot_name
,
domain_name
);
if
(
strchr
(
lot_name
,
'@'
))
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
lot_name
);
}
else
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
lot_name
,
domain_name
);
}
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"force-status"
,
"Active (%d caller%s)"
,
count
,
count
==
1
?
""
:
"s"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"rpid"
,
"active"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"event_type"
,
"presence"
);
...
...
@@ -676,8 +690,12 @@ static void pres_event_handler(switch_event_t *event)
}
else
{
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_PRESENCE_IN
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
VALET_PROTO
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
lot_name
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
lot_name
,
domain_name
);
if
(
strchr
(
lot_name
,
'@'
))
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
lot_name
);
}
else
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
lot_name
,
domain_name
);
}
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"force-status"
,
"Empty"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"rpid"
,
"unknown"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"event_type"
,
"presence"
);
...
...
@@ -715,7 +733,12 @@ static void pres_event_handler(switch_event_t *event)
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_PRESENCE_IN
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
VALET_PROTO
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
lot_name
);
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
lot_name
,
domain_name
);
if
(
strchr
(
lot_name
,
'@'
))
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
lot_name
);
}
else
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
lot_name
,
domain_name
);
}
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"force-status"
,
"Active"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"event_type"
,
"presence"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"alt_event_type"
,
"dialog"
);
...
...
@@ -738,7 +761,11 @@ static void pres_event_handler(switch_event_t *event)
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_PRESENCE_IN
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"proto"
,
VALET_PROTO
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"login"
,
lot_name
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
to
);
if
(
strchr
(
lot_name
,
'@'
))
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
lot_name
);
}
else
{
switch_event_add_header
(
event
,
SWITCH_STACK_BOTTOM
,
"from"
,
"%s@%s"
,
lot_name
,
domain_name
);
}
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"force-status"
,
"Empty"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"rpid"
,
"unknown"
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"event_type"
,
"presence"
);
...
...
src/mod/endpoints/mod_sofia/sofia_presence.c
浏览文件 @
957361cf
...
...
@@ -912,6 +912,10 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
sofia_glue_execute_sql_callback
(
profile
,
profile
->
ireg_mutex
,
sql
,
sofia_presence_dialog_callback
,
&
dh
);
switch_safe_free
(
sql
);
if
(
zstr
(
proto
))
{
proto
=
SOFIA_CHAT_PROTO
;
}
if
((
sql
=
switch_mprintf
(
"select distinct 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,"
...
...
@@ -925,12 +929,13 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
"sip_subscriptions.profile_name=sip_presence.profile_name) "
"where sip_subscriptions.version > -1 and sip_subscriptions.expires > -1 and "
"sip_subscriptions.proto='%q' and "
"(event='%q' or event='%q') and sub_to_user='%q' "
"and (sub_to_host='%q' or presence_hosts like '%%%q%%') "
"and (sip_subscriptions.profile_name = '%q' or sip_subscriptions.presence_hosts != sip_subscriptions.sub_to_host) "
,
switch_str_nil
(
status
),
switch_str_nil
(
rpid
),
host
,
dh
.
status
,
dh
.
rpid
,
dh
.
presence_id
,
dh
.
status
,
dh
.
rpid
,
dh
.
presence_id
,
proto
,
event_type
,
alt_event_type
,
euser
,
host
,
host
,
profile
->
name
)))
{
struct
presence_helper
helper
=
{
0
};
...
...
@@ -1476,7 +1481,6 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
user
=
free_me
;
}
in
=
helper
->
event
&&
helper
->
event
->
event_id
==
SWITCH_EVENT_PRESENCE_IN
;
if
(
zstr
(
rpid
))
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论