Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
5f763d0d
提交
5f763d0d
authored
8月 17, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix caller id fields in show channels show calls etc
上级
1413a9d5
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
70 行增加
和
25 行删除
+70
-25
switch_caller.h
src/include/switch_caller.h
+1
-0
switch_utils.h
src/include/switch_utils.h
+1
-1
switch_caller.c
src/switch_caller.c
+5
-0
switch_channel.c
src/switch_channel.c
+7
-0
switch_core_sqldb.c
src/switch_core_sqldb.c
+56
-24
没有找到文件。
src/include/switch_caller.h
浏览文件 @
5f763d0d
...
@@ -108,6 +108,7 @@ SWITCH_BEGIN_EXTERN_C
...
@@ -108,6 +108,7 @@ SWITCH_BEGIN_EXTERN_C
struct
switch_caller_extension
*
caller_extension
;
struct
switch_caller_extension
*
caller_extension
;
switch_memory_pool_t
*
pool
;
switch_memory_pool_t
*
pool
;
struct
switch_caller_profile
*
next
;
struct
switch_caller_profile
*
next
;
switch_call_direction_t
direction
;
};
};
/*! \brief An Abstract Representation of a dialplan Application */
/*! \brief An Abstract Representation of a dialplan Application */
...
...
src/include/switch_utils.h
浏览文件 @
5f763d0d
...
@@ -708,7 +708,7 @@ SWITCH_DECLARE(int) switch_split_user_domain(char *in, char **user, char **domai
...
@@ -708,7 +708,7 @@ SWITCH_DECLARE(int) switch_split_user_domain(char *in, char **user, char **domai
#endif
#endif
#endif
#endif
#define DUMP_EVENT(_e) {char *event_str;switch_event_serialize(_e, &event_str, SWITCH_FALSE);
printf(
"DUMP\n%s\n", event_str);free(event_str);}
#define DUMP_EVENT(_e) {char *event_str;switch_event_serialize(_e, &event_str, SWITCH_FALSE);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT,
"DUMP\n%s\n", event_str);free(event_str);}
#ifndef _MSC_VER
#ifndef _MSC_VER
#define switch_inet_ntop inet_ntop
#define switch_inet_ntop inet_ntop
...
...
src/switch_caller.c
浏览文件 @
5f763d0d
...
@@ -126,6 +126,7 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_dup(switch_memor
...
@@ -126,6 +126,7 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_dup(switch_memor
profile
->
destination_number_numplan
=
tocopy
->
destination_number_numplan
;
profile
->
destination_number_numplan
=
tocopy
->
destination_number_numplan
;
profile
->
flags
=
tocopy
->
flags
;
profile
->
flags
=
tocopy
->
flags
;
profile
->
pool
=
pool
;
profile
->
pool
=
pool
;
profile
->
direction
=
tocopy
->
direction
;
return
profile
;
return
profile
;
}
}
...
@@ -255,6 +256,10 @@ SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile_
...
@@ -255,6 +256,10 @@ SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile_
{
{
char
header_name
[
1024
];
char
header_name
[
1024
];
switch_snprintf
(
header_name
,
sizeof
(
header_name
),
"%s-Direction"
,
prefix
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
header_name
,
caller_profile
->
direction
==
SWITCH_CALL_DIRECTION_INBOUND
?
"inbound"
:
"outbound"
);
if
(
!
zstr
(
caller_profile
->
username
))
{
if
(
!
zstr
(
caller_profile
->
username
))
{
switch_snprintf
(
header_name
,
sizeof
(
header_name
),
"%s-Username"
,
prefix
);
switch_snprintf
(
header_name
,
sizeof
(
header_name
),
"%s-Username"
,
prefix
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
header_name
,
caller_profile
->
username
);
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
header_name
,
caller_profile
->
username
);
...
...
src/switch_channel.c
浏览文件 @
5f763d0d
...
@@ -1847,8 +1847,10 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann
...
@@ -1847,8 +1847,10 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann
}
else
{
}
else
{
/* Index Originator's Profile */
/* Index Originator's Profile */
if
(
originator_caller_profile
)
{
if
(
originator_caller_profile
)
{
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Other-Type"
,
"originator"
);
switch_caller_profile_event_set_data
(
originator_caller_profile
,
"Other-Leg"
,
event
);
switch_caller_profile_event_set_data
(
originator_caller_profile
,
"Other-Leg"
,
event
);
}
else
if
(
originatee_caller_profile
)
{
/* Index Originatee's Profile */
}
else
if
(
originatee_caller_profile
)
{
/* Index Originatee's Profile */
switch_event_add_header_string
(
event
,
SWITCH_STACK_BOTTOM
,
"Other-Type"
,
"originatee"
);
switch_caller_profile_event_set_data
(
originatee_caller_profile
,
"Other-Leg"
,
event
);
switch_caller_profile_event_set_data
(
originatee_caller_profile
,
"Other-Leg"
,
event
);
}
}
}
}
...
@@ -1932,6 +1934,7 @@ SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel
...
@@ -1932,6 +1934,7 @@ SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel
switch_mutex_lock
(
channel
->
profile_mutex
);
switch_mutex_lock
(
channel
->
profile_mutex
);
switch_assert
(
caller_profile
!=
NULL
);
switch_assert
(
caller_profile
!=
NULL
);
caller_profile
->
direction
=
channel
->
direction
;
uuid
=
switch_core_session_get_uuid
(
channel
->
session
);
uuid
=
switch_core_session_get_uuid
(
channel
->
session
);
if
(
!
caller_profile
->
uuid
||
strcasecmp
(
caller_profile
->
uuid
,
uuid
))
{
if
(
!
caller_profile
->
uuid
||
strcasecmp
(
caller_profile
->
uuid
,
uuid
))
{
...
@@ -1974,6 +1977,7 @@ SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel
...
@@ -1974,6 +1977,7 @@ SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel
caller_profile
->
times
->
created
=
switch_micro_time_now
();
caller_profile
->
times
->
created
=
switch_micro_time_now
();
}
}
caller_profile
->
next
=
channel
->
caller_profile
;
caller_profile
->
next
=
channel
->
caller_profile
;
channel
->
caller_profile
=
caller_profile
;
channel
->
caller_profile
=
caller_profile
;
caller_profile
->
profile_index
=
switch_core_sprintf
(
caller_profile
->
pool
,
"%d"
,
++
channel
->
profile_index
);
caller_profile
->
profile_index
=
switch_core_sprintf
(
caller_profile
->
pool
,
"%d"
,
++
channel
->
profile_index
);
...
@@ -2017,6 +2021,7 @@ SWITCH_DECLARE(void) switch_channel_set_hunt_caller_profile(switch_channel_t *ch
...
@@ -2017,6 +2021,7 @@ SWITCH_DECLARE(void) switch_channel_set_hunt_caller_profile(switch_channel_t *ch
switch_assert
(
channel
->
caller_profile
!=
NULL
);
switch_assert
(
channel
->
caller_profile
!=
NULL
);
switch_mutex_lock
(
channel
->
profile_mutex
);
switch_mutex_lock
(
channel
->
profile_mutex
);
caller_profile
->
direction
=
channel
->
direction
;
channel
->
caller_profile
->
hunt_caller_profile
=
NULL
;
channel
->
caller_profile
->
hunt_caller_profile
=
NULL
;
if
(
channel
->
caller_profile
&&
caller_profile
)
{
if
(
channel
->
caller_profile
&&
caller_profile
)
{
channel
->
caller_profile
->
hunt_caller_profile
=
caller_profile
;
channel
->
caller_profile
->
hunt_caller_profile
=
caller_profile
;
...
@@ -2030,6 +2035,7 @@ SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel
...
@@ -2030,6 +2035,7 @@ SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel
switch_assert
(
channel
->
caller_profile
!=
NULL
);
switch_assert
(
channel
->
caller_profile
!=
NULL
);
switch_mutex_lock
(
channel
->
profile_mutex
);
switch_mutex_lock
(
channel
->
profile_mutex
);
if
(
channel
->
caller_profile
)
{
if
(
channel
->
caller_profile
)
{
caller_profile
->
next
=
channel
->
caller_profile
->
originatee_caller_profile
;
caller_profile
->
next
=
channel
->
caller_profile
->
originatee_caller_profile
;
channel
->
caller_profile
->
originatee_caller_profile
=
caller_profile
;
channel
->
caller_profile
->
originatee_caller_profile
=
caller_profile
;
...
@@ -2044,6 +2050,7 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originator_caller_p
...
@@ -2044,6 +2050,7 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originator_caller_p
switch_assert
(
channel
!=
NULL
);
switch_assert
(
channel
!=
NULL
);
switch_mutex_lock
(
channel
->
profile_mutex
);
switch_mutex_lock
(
channel
->
profile_mutex
);
if
(
channel
->
caller_profile
)
{
if
(
channel
->
caller_profile
)
{
profile
=
channel
->
caller_profile
->
originator_caller_profile
;
profile
=
channel
->
caller_profile
->
originator_caller_profile
;
}
}
...
...
src/switch_core_sqldb.c
浏览文件 @
5f763d0d
...
@@ -1135,8 +1135,16 @@ static void core_event_handler(switch_event_t *event)
...
@@ -1135,8 +1135,16 @@ static void core_event_handler(switch_event_t *event)
break
;
break
;
case
SWITCH_EVENT_CALL_UPDATE
:
case
SWITCH_EVENT_CALL_UPDATE
:
{
{
const
char
*
name
=
switch_event_get_header
(
event
,
"callee-name"
);
const
char
*
name
=
NULL
,
*
number
=
NULL
,
*
direction
;
const
char
*
number
=
switch_event_get_header
(
event
,
"callee-number"
);
int
recv
=
0
;
direction
=
switch_event_get_header
(
event
,
"direction"
);
if
(
direction
&&
strcasecmp
(
direction
,
"send"
))
{
recv
=
1
;
name
=
switch_event_get_header
(
event
,
"callee-name"
);
number
=
switch_event_get_header
(
event
,
"callee-number"
);
}
if
(
!
name
)
{
if
(
!
name
)
{
name
=
switch_event_get_header
(
event
,
"caller-callee-id-name"
);
name
=
switch_event_get_header
(
event
,
"caller-callee-id-name"
);
...
@@ -1155,6 +1163,15 @@ static void core_event_handler(switch_event_t *event)
...
@@ -1155,6 +1163,15 @@ static void core_event_handler(switch_event_t *event)
switch_str_nil
(
number
),
switch_str_nil
(
number
),
switch_event_get_header_nil
(
event
,
"direction"
),
switch_event_get_header_nil
(
event
,
"direction"
),
switch_event_get_header_nil
(
event
,
"unique-id"
),
switch_core_get_variable
(
"hostname"
));
switch_event_get_header_nil
(
event
,
"unique-id"
),
switch_core_get_variable
(
"hostname"
));
name
=
switch_event_get_header
(
event
,
"callee-name"
);
number
=
switch_event_get_header
(
event
,
"callee-number"
);
if
(
name
&&
number
&&
recv
)
{
new_sql
()
=
switch_mprintf
(
"update calls set callee_cid_name='%q',callee_cid_num='%q' where caller_uuid='%q'"
,
name
,
number
,
switch_event_get_header_nil
(
event
,
"unique-id"
));
}
}
}
}
}
break
;
break
;
...
@@ -1224,6 +1241,20 @@ static void core_event_handler(switch_event_t *event)
...
@@ -1224,6 +1241,20 @@ static void core_event_handler(switch_event_t *event)
}
}
case
SWITCH_EVENT_CHANNEL_BRIDGE
:
case
SWITCH_EVENT_CHANNEL_BRIDGE
:
{
const
char
*
callee_cid_name
,
*
callee_cid_num
,
*
direction
;
direction
=
switch_event_get_header
(
event
,
"other-leg-direction"
);
if
(
direction
&&
!
strcasecmp
(
direction
,
"outbound"
))
{
callee_cid_name
=
switch_event_get_header_nil
(
event
,
"Other-Leg-callee-id-name"
);
callee_cid_num
=
switch_event_get_header_nil
(
event
,
"Other-Leg-callee-id-number"
);
}
else
{
callee_cid_name
=
switch_event_get_header_nil
(
event
,
"Other-Leg-caller-id-name"
);
callee_cid_num
=
switch_event_get_header_nil
(
event
,
"Other-Leg-caller-id-number"
);
}
new_sql
()
=
switch_mprintf
(
"update channels set call_uuid='%q' where uuid='%s' and hostname='%q'"
,
new_sql
()
=
switch_mprintf
(
"update channels set call_uuid='%q' where uuid='%s' and hostname='%q'"
,
switch_event_get_header_nil
(
event
,
"channel-call-uuid"
),
switch_event_get_header_nil
(
event
,
"channel-call-uuid"
),
switch_event_get_header_nil
(
event
,
"unique-id"
),
switch_core_get_variable
(
"hostname"
));
switch_event_get_header_nil
(
event
,
"unique-id"
),
switch_core_get_variable
(
"hostname"
));
...
@@ -1240,12 +1271,13 @@ static void core_event_handler(switch_event_t *event)
...
@@ -1240,12 +1271,13 @@ static void core_event_handler(switch_event_t *event)
switch_event_get_header_nil
(
event
,
"caller-destination-number"
),
switch_event_get_header_nil
(
event
,
"caller-destination-number"
),
switch_event_get_header_nil
(
event
,
"caller-channel-name"
),
switch_event_get_header_nil
(
event
,
"caller-channel-name"
),
switch_event_get_header_nil
(
event
,
"caller-unique-id"
),
switch_event_get_header_nil
(
event
,
"caller-unique-id"
),
switch_event_get_header_nil
(
event
,
"Other-Leg-caller-id-name"
)
,
callee_cid_name
,
switch_event_get_header_nil
(
event
,
"Other-Leg-caller-id-number"
)
,
callee_cid_num
,
switch_event_get_header_nil
(
event
,
"Other-Leg-destination-number"
),
switch_event_get_header_nil
(
event
,
"Other-Leg-destination-number"
),
switch_event_get_header_nil
(
event
,
"Other-Leg-channel-name"
),
switch_event_get_header_nil
(
event
,
"Other-Leg-channel-name"
),
switch_event_get_header_nil
(
event
,
"Other-Leg-unique-id"
),
switch_core_get_variable
(
"hostname"
)
switch_event_get_header_nil
(
event
,
"Other-Leg-unique-id"
),
switch_core_get_variable
(
"hostname"
)
);
);
}
break
;
break
;
case
SWITCH_EVENT_CHANNEL_UNBRIDGE
:
case
SWITCH_EVENT_CHANNEL_UNBRIDGE
:
new_sql
()
=
switch_mprintf
(
"delete from calls where caller_uuid='%s' and hostname='%q'"
,
new_sql
()
=
switch_mprintf
(
"delete from calls where caller_uuid='%s' and hostname='%q'"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论