Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b946ee94
提交
b946ee94
authored
8月 04, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update call_uuid stuff
上级
8caef22b
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
33 行增加
和
30 行删除
+33
-30
switch_channel.c
src/switch_channel.c
+2
-0
switch_core_session.c
src/switch_core_session.c
+4
-0
switch_core_sqldb.c
src/switch_core_sqldb.c
+11
-3
switch_core_state_machine.c
src/switch_core_state_machine.c
+5
-0
switch_ivr_bridge.c
src/switch_ivr_bridge.c
+6
-0
switch_ivr_originate.c
src/switch_ivr_originate.c
+5
-27
没有找到文件。
src/switch_channel.c
浏览文件 @
b946ee94
...
@@ -2121,6 +2121,8 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann
...
@@ -2121,6 +2121,8 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann
if
((
v
=
switch_channel_get_variable
(
channel
,
"call_uuid"
)))
{
if
((
v
=
switch_channel_get_variable
(
channel
,
"call_uuid"
)))
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Channel-Call-UUID"
,
v
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Channel-Call-UUID"
,
v
);
}
else
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Channel-Call-UUID"
,
switch_core_session_get_uuid
(
channel
->
session
));
}
}
if
(
switch_channel_down
(
channel
))
{
if
(
switch_channel_down
(
channel
))
{
...
...
src/switch_core_session.c
浏览文件 @
b946ee94
...
@@ -1427,6 +1427,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_uuid(switch_core_session
...
@@ -1427,6 +1427,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_uuid(switch_core_session
profile
->
uuid
=
switch_core_strdup
(
profile
->
pool
,
use_uuid
);
profile
->
uuid
=
switch_core_strdup
(
profile
->
pool
,
use_uuid
);
}
}
switch_channel_set_variable
(
session
->
channel
,
"uuid"
,
use_uuid
);
switch_channel_set_variable
(
session
->
channel
,
"call_uuid"
,
use_uuid
);
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_UUID
);
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_UUID
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Old-Unique-ID"
,
session
->
uuid_str
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Old-Unique-ID"
,
session
->
uuid_str
);
switch_core_hash_delete
(
session_manager
.
session_table
,
session
->
uuid_str
);
switch_core_hash_delete
(
session_manager
.
session_table
,
session
->
uuid_str
);
...
@@ -1729,6 +1732,7 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_uuid(switch_
...
@@ -1729,6 +1732,7 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_uuid(switch_
}
}
switch_channel_set_variable
(
session
->
channel
,
"uuid"
,
session
->
uuid_str
);
switch_channel_set_variable
(
session
->
channel
,
"uuid"
,
session
->
uuid_str
);
switch_channel_set_variable
(
session
->
channel
,
"call_uuid"
,
session
->
uuid_str
);
session
->
endpoint_interface
=
endpoint_interface
;
session
->
endpoint_interface
=
endpoint_interface
;
session
->
raw_write_frame
.
data
=
session
->
raw_write_buf
;
session
->
raw_write_frame
.
data
=
session
->
raw_write_buf
;
...
...
src/switch_core_sqldb.c
浏览文件 @
b946ee94
...
@@ -1221,6 +1221,11 @@ static void core_event_handler(switch_event_t *event)
...
@@ -1221,6 +1221,11 @@ static void core_event_handler(switch_event_t *event)
switch_event_get_header_nil
(
event
,
"unique-id"
),
switch_event_get_header_nil
(
event
,
"unique-id"
),
switch_event_get_header_nil
(
event
,
"old-unique-id"
)
switch_event_get_header_nil
(
event
,
"old-unique-id"
)
);
);
new_sql
()
=
switch_mprintf
(
"update channels set call_uuid='%q' where call_uuid='%q'"
,
switch_event_get_header_nil
(
event
,
"unique-id"
),
switch_event_get_header_nil
(
event
,
"old-unique-id"
)
);
break
;
break
;
}
}
case
SWITCH_EVENT_CHANNEL_CREATE
:
case
SWITCH_EVENT_CHANNEL_CREATE
:
...
@@ -1402,9 +1407,9 @@ static void core_event_handler(switch_event_t *event)
...
@@ -1402,9 +1407,9 @@ static void core_event_handler(switch_event_t *event)
b_uuid
=
switch_event_get_header_nil
(
event
,
"other-leg-unique-id"
);
b_uuid
=
switch_event_get_header_nil
(
event
,
"other-leg-unique-id"
);
}
}
new_sql
()
=
switch_mprintf
(
"update channels set call_uuid='%q' where uuid='%s'"
,
new_sql
()
=
switch_mprintf
(
"update channels set call_uuid='%q' where uuid='%s'
or uuid='%s'
"
,
switch_event_get_header_nil
(
event
,
"channel-call-uuid"
),
switch_event_get_header_nil
(
event
,
"channel-call-uuid"
),
a_uuid
,
b_uuid
);
switch_event_get_header_nil
(
event
,
"unique-id"
));
new_sql
()
=
switch_mprintf
(
"insert into calls (call_uuid,call_created,call_created_epoch,"
new_sql
()
=
switch_mprintf
(
"insert into calls (call_uuid,call_created,call_created_epoch,"
"caller_uuid,callee_uuid,hostname) "
"caller_uuid,callee_uuid,hostname) "
...
@@ -1422,6 +1427,9 @@ static void core_event_handler(switch_event_t *event)
...
@@ -1422,6 +1427,9 @@ static void core_event_handler(switch_event_t *event)
{
{
char
*
uuid
=
switch_event_get_header_nil
(
event
,
"caller-unique-id"
);
char
*
uuid
=
switch_event_get_header_nil
(
event
,
"caller-unique-id"
);
new_sql
()
=
switch_mprintf
(
"update channels set call_uuid=uuid where call_uuid='%s'"
,
switch_event_get_header_nil
(
event
,
"channel-call-uuid"
));
new_sql
()
=
switch_mprintf
(
"delete from calls where (caller_uuid='%q' or callee_uuid='%q')"
,
new_sql
()
=
switch_mprintf
(
"delete from calls where (caller_uuid='%q' or callee_uuid='%q')"
,
uuid
,
uuid
);
uuid
,
uuid
);
break
;
break
;
...
...
src/switch_core_state_machine.c
浏览文件 @
b946ee94
...
@@ -62,6 +62,7 @@ static void switch_core_standard_on_destroy(switch_core_session_t *session)
...
@@ -62,6 +62,7 @@ static void switch_core_standard_on_destroy(switch_core_session_t *session)
static
void
switch_core_standard_on_reset
(
switch_core_session_t
*
session
)
static
void
switch_core_standard_on_reset
(
switch_core_session_t
*
session
)
{
{
switch_channel_set_variable
(
session
->
channel
,
"call_uuid"
,
switch_core_session_get_uuid
(
session
));
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"%s Standard RESET
\n
"
,
switch_channel_get_name
(
session
->
channel
));
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"%s Standard RESET
\n
"
,
switch_channel_get_name
(
session
->
channel
));
}
}
...
@@ -76,6 +77,8 @@ static void switch_core_standard_on_routing(switch_core_session_t *session)
...
@@ -76,6 +77,8 @@ static void switch_core_standard_on_routing(switch_core_session_t *session)
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"%s Standard ROUTING
\n
"
,
switch_channel_get_name
(
session
->
channel
));
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"%s Standard ROUTING
\n
"
,
switch_channel_get_name
(
session
->
channel
));
switch_channel_set_variable
(
session
->
channel
,
"call_uuid"
,
switch_core_session_get_uuid
(
session
));
if
((
switch_channel_test_flag
(
session
->
channel
,
CF_ANSWERED
)
||
if
((
switch_channel_test_flag
(
session
->
channel
,
CF_ANSWERED
)
||
switch_channel_test_flag
(
session
->
channel
,
CF_EARLY_MEDIA
)
||
switch_channel_test_flag
(
session
->
channel
,
CF_EARLY_MEDIA
)
||
switch_channel_test_flag
(
session
->
channel
,
CF_SIGNAL_BRIDGE_TTL
))
&&
switch_channel_test_flag
(
session
->
channel
,
CF_PROXY_MODE
))
{
switch_channel_test_flag
(
session
->
channel
,
CF_SIGNAL_BRIDGE_TTL
))
&&
switch_channel_test_flag
(
session
->
channel
,
CF_PROXY_MODE
))
{
...
@@ -156,6 +159,8 @@ static void switch_core_standard_on_execute(switch_core_session_t *session)
...
@@ -156,6 +159,8 @@ static void switch_core_standard_on_execute(switch_core_session_t *session)
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"%s Standard EXECUTE
\n
"
,
switch_channel_get_name
(
session
->
channel
));
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_DEBUG
,
"%s Standard EXECUTE
\n
"
,
switch_channel_get_name
(
session
->
channel
));
switch_channel_set_variable
(
session
->
channel
,
"call_uuid"
,
switch_core_session_get_uuid
(
session
));
if
(
switch_channel_get_variable
(
session
->
channel
,
"recovered"
)
&&
!
switch_channel_test_flag
(
session
->
channel
,
CF_RECOVERED
))
{
if
(
switch_channel_get_variable
(
session
->
channel
,
"recovered"
)
&&
!
switch_channel_test_flag
(
session
->
channel
,
CF_RECOVERED
))
{
switch_channel_set_flag
(
session
->
channel
,
CF_RECOVERED
);
switch_channel_set_flag
(
session
->
channel
,
CF_RECOVERED
);
}
}
...
...
src/switch_ivr_bridge.c
浏览文件 @
b946ee94
...
@@ -968,6 +968,7 @@ static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session)
...
@@ -968,6 +968,7 @@ static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session)
switch_channel_set_variable
(
other_channel
,
SWITCH_SIGNAL_BRIDGE_VARIABLE
,
NULL
);
switch_channel_set_variable
(
other_channel
,
SWITCH_SIGNAL_BRIDGE_VARIABLE
,
NULL
);
switch_channel_set_variable
(
other_channel
,
SWITCH_BRIDGE_VARIABLE
,
NULL
);
switch_channel_set_variable
(
other_channel
,
SWITCH_BRIDGE_VARIABLE
,
NULL
);
switch_channel_set_variable
(
other_channel
,
"call_uuid"
,
switch_core_session_get_uuid
(
other_session
));
if
(
switch_channel_up
(
other_channel
))
{
if
(
switch_channel_up
(
other_channel
))
{
...
@@ -1044,6 +1045,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_signal_bridge(switch_core_session_t *
...
@@ -1044,6 +1045,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_signal_bridge(switch_core_session_t *
switch_channel_set_variable
(
caller_channel
,
SWITCH_SIGNAL_BRIDGE_VARIABLE
,
switch_core_session_get_uuid
(
peer_session
));
switch_channel_set_variable
(
caller_channel
,
SWITCH_SIGNAL_BRIDGE_VARIABLE
,
switch_core_session_get_uuid
(
peer_session
));
switch_channel_set_variable
(
peer_channel
,
SWITCH_SIGNAL_BRIDGE_VARIABLE
,
switch_core_session_get_uuid
(
session
));
switch_channel_set_variable
(
peer_channel
,
SWITCH_SIGNAL_BRIDGE_VARIABLE
,
switch_core_session_get_uuid
(
session
));
switch_channel_set_variable
(
peer_channel
,
"call_uuid"
,
switch_core_session_get_uuid
(
session
));
switch_channel_set_flag_recursive
(
caller_channel
,
CF_BRIDGE_ORIGINATOR
);
switch_channel_set_flag_recursive
(
caller_channel
,
CF_BRIDGE_ORIGINATOR
);
switch_channel_clear_flag
(
peer_channel
,
CF_BRIDGE_ORIGINATOR
);
switch_channel_clear_flag
(
peer_channel
,
CF_BRIDGE_ORIGINATOR
);
...
@@ -1152,6 +1154,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
...
@@ -1152,6 +1154,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
switch_channel_set_state
(
peer_channel
,
CS_CONSUME_MEDIA
);
switch_channel_set_state
(
peer_channel
,
CS_CONSUME_MEDIA
);
switch_channel_set_variable
(
peer_channel
,
"call_uuid"
,
switch_core_session_get_uuid
(
session
));
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_BRIDGE
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_BRIDGE
)
==
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-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_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Bridge-B-Unique-ID"
,
switch_core_session_get_uuid
(
peer_session
));
...
@@ -1303,6 +1307,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
...
@@ -1303,6 +1307,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
done
:
done
:
switch_channel_set_variable
(
peer_channel
,
"call_uuid"
,
switch_core_session_get_uuid
(
peer_session
));
if
(
br
&&
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_UNBRIDGE
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
br
&&
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_UNBRIDGE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_channel_event_set_data
(
caller_channel
,
event
);
switch_channel_event_set_data
(
caller_channel
,
event
);
switch_event_fire
(
&
event
);
switch_event_fire
(
&
event
);
...
...
src/switch_ivr_originate.c
浏览文件 @
b946ee94
...
@@ -1843,33 +1843,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
...
@@ -1843,33 +1843,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
}
}
}
}
if
(
var_event
)
{
switch_uuid_t
uuid
;
char
uuid_str
[
SWITCH_UUID_FORMATTED_LENGTH
+
1
];
char
*
use_uuid
;
if
(
caller_channel
)
{
use_uuid
=
switch_core_session_get_uuid
(
session
);
}
else
{
switch_uuid_get
(
&
uuid
);
switch_uuid_format
(
uuid_str
,
&
uuid
);
use_uuid
=
uuid_str
;
}
switch_event_del_header
(
var_event
,
"call_uuid"
);
switch_event_add_header_string
(
var_event
,
SWITCH_STACK_BOTTOM
,
"call_uuid"
,
use_uuid
);
if
(
caller_channel
)
{
switch_channel_set_variable
(
caller_channel
,
"call_uuid"
,
use_uuid
);
}
}
if
(
caller_channel
)
{
switch_channel_process_export
(
caller_channel
,
NULL
,
var_event
,
SWITCH_EXPORT_VARS_VARIABLE
);
}
/* strip leading spaces */
/* strip leading spaces */
while
(
data
&&
*
data
&&
*
data
==
' '
)
{
while
(
data
&&
*
data
&&
*
data
==
' '
)
{
data
++
;
data
++
;
...
@@ -2478,6 +2451,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
...
@@ -2478,6 +2451,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
originate_status
[
i
].
peer_session
=
new_session
;
originate_status
[
i
].
peer_session
=
new_session
;
switch_channel_set_flag
(
originate_status
[
i
].
peer_channel
,
CF_ORIGINATING
);
switch_channel_set_flag
(
originate_status
[
i
].
peer_channel
,
CF_ORIGINATING
);
if
(
caller_channel
)
{
switch_channel_set_variable
(
originate_status
[
i
].
peer_channel
,
"call_uuid"
,
switch_channel_get_variable
(
caller_channel
,
"call_uuid"
));
}
if
((
lc
=
switch_event_get_header
(
var_event
,
"local_var_clobber"
)))
{
if
((
lc
=
switch_event_get_header
(
var_event
,
"local_var_clobber"
)))
{
local_clobber
=
switch_true
(
lc
);
local_clobber
=
switch_true
(
lc
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论