Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
e54ab070
提交
e54ab070
authored
5月 10, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
put presence-data in events
上级
921de944
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
92 行增加
和
10 行删除
+92
-10
switch_event.h
src/include/switch_event.h
+2
-0
switch_channel.c
src/switch_channel.c
+33
-0
switch_core_sqldb.c
src/switch_core_sqldb.c
+1
-1
switch_event.c
src/switch_event.c
+27
-0
switch_ivr_bridge.c
src/switch_ivr_bridge.c
+29
-9
没有找到文件。
src/include/switch_event.h
浏览文件 @
e54ab070
...
...
@@ -402,6 +402,8 @@ SWITCH_DECLARE(void) switch_event_deliver(switch_event_t **event);
SWITCH_DECLARE
(
char
*
)
switch_event_build_param_string
(
switch_event_t
*
event
,
const
char
*
prefix
,
switch_hash_t
*
vars_map
);
SWITCH_DECLARE
(
int
)
switch_event_check_permission_list
(
switch_event_t
*
list
,
const
char
*
name
);
SWITCH_DECLARE
(
void
)
switch_event_add_presence_data_cols
(
switch_channel_t
*
channel
,
switch_event_t
*
event
,
const
char
*
prefix
);
///\}
SWITCH_END_EXTERN_C
...
...
src/switch_channel.c
浏览文件 @
e54ab070
...
...
@@ -1160,6 +1160,38 @@ SWITCH_DECLARE(uint32_t) switch_channel_del_variable_prefix(switch_channel_t *ch
return
r
;
}
SWITCH_DECLARE
(
void
)
switch_channel_set_presence_data_vals
(
switch_channel_t
*
channel
,
const
char
*
presence_data_cols
)
{
if
(
!
zstr
(
presence_data_cols
))
{
char
*
cols
[
128
]
=
{
0
};
char
header_name
[
128
]
=
""
;
int
col_count
=
0
,
i
=
0
;
char
*
data_copy
=
NULL
;
if
(
zstr
(
presence_data_cols
))
{
presence_data_cols
=
switch_channel_get_variable_dup
(
channel
,
"presence_data_cols"
,
SWITCH_FALSE
,
-
1
);
if
(
zstr
(
presence_data_cols
))
{
return
;
}
}
data_copy
=
strdup
(
presence_data_cols
);
col_count
=
switch_split
(
data_copy
,
':'
,
cols
);
for
(
i
=
0
;
i
<
col_count
;
i
++
)
{
const
char
*
val
=
NULL
;
switch_snprintf
(
header_name
,
sizeof
(
header_name
),
"PD-%s"
,
cols
[
i
]);
val
=
switch_channel_get_variable
(
channel
,
cols
[
i
]);
switch_channel_set_profile_var
(
channel
,
header_name
,
val
);
}
switch_safe_free
(
data_copy
);
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_channel_set_variable_var_check
(
switch_channel_t
*
channel
,
const
char
*
varname
,
const
char
*
value
,
switch_bool_t
var_check
)
{
...
...
@@ -2192,6 +2224,7 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann
if
((
v
=
switch_channel_get_variable
(
channel
,
"presence_data_cols"
)))
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Presence-Data-Cols"
,
v
);
switch_event_add_presence_data_cols
(
channel
,
event
,
"PD-"
);
}
if
((
v
=
switch_channel_get_variable
(
channel
,
"call_uuid"
)))
{
...
...
src/switch_core_sqldb.c
浏览文件 @
e54ab070
...
...
@@ -1171,7 +1171,7 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
static
char
*
parse_presence_data_cols
(
switch_event_t
*
event
)
{
char
*
cols
[
25
]
=
{
0
};
char
*
cols
[
128
]
=
{
0
};
int
col_count
=
0
;
char
*
data_copy
;
switch_stream_handle_t
stream
=
{
0
};
...
...
src/switch_event.c
浏览文件 @
e54ab070
...
...
@@ -2399,7 +2399,34 @@ SWITCH_DECLARE(int) switch_event_check_permission_list(switch_event_t *list, con
return
r
;
}
SWITCH_DECLARE
(
void
)
switch_event_add_presence_data_cols
(
switch_channel_t
*
channel
,
switch_event_t
*
event
,
const
char
*
prefix
)
{
const
char
*
data
;
if
(
!
prefix
)
prefix
=
""
;
if
((
data
=
switch_channel_get_variable
(
channel
,
"presence_data_cols"
)))
{
char
*
cols
[
128
]
=
{
0
};
char
header_name
[
128
]
=
""
;
int
col_count
=
0
,
i
=
0
;
char
*
data_copy
=
NULL
;
data_copy
=
strdup
(
data
);
col_count
=
switch_split
(
data_copy
,
':'
,
cols
);
for
(
i
=
0
;
i
<
col_count
;
i
++
)
{
const
char
*
val
=
NULL
;
switch_snprintf
(
header_name
,
sizeof
(
header_name
),
"%s%s"
,
prefix
,
cols
[
i
]);
val
=
switch_channel_get_variable
(
channel
,
cols
[
i
]);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
header_name
,
val
);
}
switch_safe_free
(
data_copy
);
}
}
/* For Emacs:
...
...
src/switch_ivr_bridge.c
浏览文件 @
e54ab070
...
...
@@ -968,9 +968,16 @@ static switch_status_t signal_bridge_on_hibernate(switch_core_session_t *session
if
(
switch_channel_test_flag
(
channel
,
CF_BRIDGE_ORIGINATOR
))
{
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_BRIDGE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_core_session_t
*
other_session
;
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Bridge-A-Unique-ID"
,
switch_core_session_get_uuid
(
session
));
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Bridge-B-Unique-ID"
,
msg
.
string_arg
);
switch_channel_event_set_data
(
channel
,
event
);
if
((
other_session
=
switch_core_session_locate
(
msg
.
string_arg
)))
{
switch_channel_t
*
other_channel
=
switch_core_session_get_channel
(
other_session
);
switch_event_add_presence_data_cols
(
other_channel
,
event
,
"Bridge-B-PD-"
);
switch_core_session_rwunlock
(
other_session
);
}
switch_event_fire
(
&
event
);
}
}
...
...
@@ -1052,16 +1059,27 @@ static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session)
}
}
switch_core_session_rwunlock
(
other_session
);
}
if
(
switch_channel_test_flag
(
channel
,
CF_BRIDGE_ORIGINATOR
))
{
switch_channel_clear_flag_recursive
(
channel
,
CF_BRIDGE_ORIGINATOR
);
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_UNBRIDGE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Bridge-A-Unique-ID"
,
switch_core_session_get_uuid
(
session
));
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Bridge-B-Unique-ID"
,
uuid
);
switch_event_add_presence_data_cols
(
other_channel
,
event
,
"Bridge-B-PD-"
);
switch_channel_event_set_data
(
channel
,
event
);
switch_event_fire
(
&
event
);
}
}
if
(
switch_channel_test_flag
(
channel
,
CF_BRIDGE_ORIGINATOR
))
{
switch_channel_clear_flag_recursive
(
channel
,
CF_BRIDGE_ORIGINATOR
);
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_UNBRIDGE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Bridge-A-Unique-ID"
,
switch_core_session_get_uuid
(
session
));
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Bridge-B-Unique-ID"
,
uuid
);
switch_channel_event_set_data
(
channel
,
event
);
switch_event_fire
(
&
event
);
switch_core_session_rwunlock
(
other_session
);
}
else
{
if
(
switch_channel_test_flag
(
channel
,
CF_BRIDGE_ORIGINATOR
))
{
switch_channel_clear_flag_recursive
(
channel
,
CF_BRIDGE_ORIGINATOR
);
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_UNBRIDGE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Bridge-A-Unique-ID"
,
switch_core_session_get_uuid
(
session
));
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Bridge-B-Unique-ID"
,
uuid
);
switch_channel_event_set_data
(
channel
,
event
);
switch_event_fire
(
&
event
);
}
}
}
...
...
@@ -1242,6 +1260,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Bridge-A-Unique-ID"
,
switch_core_session_get_uuid
(
session
));
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Bridge-B-Unique-ID"
,
switch_core_session_get_uuid
(
peer_session
));
switch_channel_event_set_data
(
caller_channel
,
event
);
switch_event_add_presence_data_cols
(
peer_channel
,
event
,
"Bridge-B-PD-"
);
switch_event_fire
(
&
event
);
br
=
1
;
}
...
...
@@ -1425,6 +1444,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Bridge-A-Unique-ID"
,
switch_core_session_get_uuid
(
session
));
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Bridge-B-Unique-ID"
,
switch_core_session_get_uuid
(
peer_session
));
switch_channel_event_set_data
(
caller_channel
,
event
);
switch_event_add_presence_data_cols
(
peer_channel
,
event
,
"Bridge-B-PD-"
);
switch_event_fire
(
&
event
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论