Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b1a3a106
提交
b1a3a106
authored
10月 17, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-5852 --resolve
上级
9246309a
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
71 行增加
和
11 行删除
+71
-11
switch_types.h
src/include/switch_types.h
+5
-3
switch_caller.c
src/switch_caller.c
+5
-0
switch_core_session.c
src/switch_core_session.c
+16
-1
switch_ivr_originate.c
src/switch_ivr_originate.c
+45
-7
没有找到文件。
src/include/switch_types.h
浏览文件 @
b1a3a106
...
@@ -299,9 +299,11 @@ typedef enum {
...
@@ -299,9 +299,11 @@ typedef enum {
SOF_NONE
=
0
,
SOF_NONE
=
0
,
SOF_NOBLOCK
=
(
1
<<
0
),
SOF_NOBLOCK
=
(
1
<<
0
),
SOF_FORKED_DIAL
=
(
1
<<
1
),
SOF_FORKED_DIAL
=
(
1
<<
1
),
SOF_NO_EFFECTIVE_CID_NUM
=
(
1
<<
2
),
SOF_NO_EFFECTIVE_ANI
=
(
1
<<
2
),
SOF_NO_EFFECTIVE_CID_NAME
=
(
1
<<
3
),
SOF_NO_EFFECTIVE_ANIII
=
(
1
<<
3
),
SOF_NO_LIMITS
=
(
1
<<
4
)
SOF_NO_EFFECTIVE_CID_NUM
=
(
1
<<
4
),
SOF_NO_EFFECTIVE_CID_NAME
=
(
1
<<
5
),
SOF_NO_LIMITS
=
(
1
<<
6
)
}
switch_originate_flag_enum_t
;
}
switch_originate_flag_enum_t
;
typedef
uint32_t
switch_originate_flag_t
;
typedef
uint32_t
switch_originate_flag_t
;
...
...
src/switch_caller.c
浏览文件 @
b1a3a106
...
@@ -66,6 +66,11 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memor
...
@@ -66,6 +66,11 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memor
caller_id_number
=
SWITCH_DEFAULT_CLID_NUMBER
;
caller_id_number
=
SWITCH_DEFAULT_CLID_NUMBER
;
}
}
/* ANI defaults to Caller ID Number when not specified */
if
(
zstr
(
ani
))
{
ani
=
caller_id_number
;
}
profile_dup_clean
(
username
,
profile
->
username
,
pool
);
profile_dup_clean
(
username
,
profile
->
username
,
pool
);
profile_dup_clean
(
dialplan
,
profile
->
dialplan
,
pool
);
profile_dup_clean
(
dialplan
,
profile
->
dialplan
,
pool
);
profile_dup_clean
(
caller_id_name
,
profile
->
caller_id_name
,
pool
);
profile_dup_clean
(
caller_id_name
,
profile
->
caller_id_name
,
pool
);
...
...
src/switch_core_session.c
浏览文件 @
b1a3a106
...
@@ -525,8 +525,17 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
...
@@ -525,8 +525,17 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
}
}
if
(
caller_profile
)
{
if
(
caller_profile
)
{
const
char
*
eani
=
NULL
,
*
eaniii
=
NULL
;
const
char
*
ecaller_id_name
=
NULL
,
*
ecaller_id_number
=
NULL
;
const
char
*
ecaller_id_name
=
NULL
,
*
ecaller_id_number
=
NULL
;
if
(
!
(
flags
&
SOF_NO_EFFECTIVE_ANI
))
{
eani
=
switch_channel_get_variable
(
channel
,
"effective_ani"
);
}
if
(
!
(
flags
&
SOF_NO_EFFECTIVE_ANIII
))
{
eaniii
=
switch_channel_get_variable
(
channel
,
"effective_aniii"
);
}
if
(
!
(
flags
&
SOF_NO_EFFECTIVE_CID_NAME
))
{
if
(
!
(
flags
&
SOF_NO_EFFECTIVE_CID_NAME
))
{
ecaller_id_name
=
switch_channel_get_variable
(
channel
,
"effective_caller_id_name"
);
ecaller_id_name
=
switch_channel_get_variable
(
channel
,
"effective_caller_id_name"
);
}
}
...
@@ -535,9 +544,15 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
...
@@ -535,9 +544,15 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
ecaller_id_number
=
switch_channel_get_variable
(
channel
,
"effective_caller_id_number"
);
ecaller_id_number
=
switch_channel_get_variable
(
channel
,
"effective_caller_id_number"
);
}
}
if
(
ecaller_id_name
||
ecaller_id_number
)
{
if
(
e
ani
||
eaniii
||
e
caller_id_name
||
ecaller_id_number
)
{
outgoing_profile
=
switch_caller_profile_clone
(
session
,
caller_profile
);
outgoing_profile
=
switch_caller_profile_clone
(
session
,
caller_profile
);
if
(
eani
)
{
outgoing_profile
->
ani
=
eani
;
}
if
(
eaniii
)
{
outgoing_profile
->
aniii
=
eaniii
;
}
if
(
ecaller_id_name
)
{
if
(
ecaller_id_name
)
{
outgoing_profile
->
caller_id_name
=
ecaller_id_name
;
outgoing_profile
->
caller_id_name
=
ecaller_id_name
;
}
}
...
...
src/switch_ivr_originate.c
浏览文件 @
b1a3a106
...
@@ -1487,16 +1487,24 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess
...
@@ -1487,16 +1487,24 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess
}
}
if
(
channel
)
{
if
(
channel
)
{
const
char
*
cid
;
const
char
*
tmp_var
=
NULL
;
switch_channel_process_export
(
channel
,
NULL
,
var_event
,
SWITCH_EXPORT_VARS_VARIABLE
);
switch_channel_process_export
(
channel
,
NULL
,
var_event
,
SWITCH_EXPORT_VARS_VARIABLE
);
if
((
cid
=
switch_channel_get_variable
(
channel
,
"effective_caller_id_name
"
)))
{
if
((
tmp_var
=
switch_channel_get_variable
(
channel
,
"effective_ani
"
)))
{
switch_event_add_header_string
(
var_event
,
SWITCH_STACK_BOTTOM
,
"origination_
caller_id_name"
,
cid
);
switch_event_add_header_string
(
var_event
,
SWITCH_STACK_BOTTOM
,
"origination_
ani"
,
tmp_var
);
}
}
if
((
cid
=
switch_channel_get_variable
(
channel
,
"effective_caller_id_number"
)))
{
if
((
tmp_var
=
switch_channel_get_variable
(
channel
,
"effective_aniii"
)))
{
switch_event_add_header_string
(
var_event
,
SWITCH_STACK_BOTTOM
,
"origination_caller_id_number"
,
cid
);
switch_event_add_header_string
(
var_event
,
SWITCH_STACK_BOTTOM
,
"origination_aniii"
,
tmp_var
);
}
if
((
tmp_var
=
switch_channel_get_variable
(
channel
,
"effective_caller_id_name"
)))
{
switch_event_add_header_string
(
var_event
,
SWITCH_STACK_BOTTOM
,
"origination_caller_id_name"
,
tmp_var
);
}
if
((
tmp_var
=
switch_channel_get_variable
(
channel
,
"effective_caller_id_number"
)))
{
switch_event_add_header_string
(
var_event
,
SWITCH_STACK_BOTTOM
,
"origination_caller_id_number"
,
tmp_var
);
}
}
}
}
...
@@ -1891,6 +1899,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
...
@@ -1891,6 +1899,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
int
read_packet
=
0
;
int
read_packet
=
0
;
int
check_reject
=
1
;
int
check_reject
=
1
;
switch_codec_implementation_t
read_impl
=
{
0
};
switch_codec_implementation_t
read_impl
=
{
0
};
const
char
*
ani_override
=
NULL
;
const
char
*
aniii_override
=
NULL
;
if
(
session
)
{
if
(
session
)
{
switch_channel_set_variable
(
switch_core_session_get_channel
(
session
),
"originated_legs"
,
NULL
);
switch_channel_set_variable
(
switch_core_session_get_channel
(
session
),
"originated_legs"
,
NULL
);
...
@@ -2342,6 +2352,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
...
@@ -2342,6 +2352,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
}
}
}
}
/* variable to force ANI / ANIII */
ani_override
=
switch_event_get_header
(
var_event
,
"origination_ani"
);
aniii_override
=
switch_event_get_header
(
var_event
,
"origination_aniii"
);
if
((
cid_tmp
=
switch_event_get_header
(
var_event
,
"origination_caller_id_name"
)))
{
if
((
cid_tmp
=
switch_event_get_header
(
var_event
,
"origination_caller_id_name"
)))
{
cid_name_override
=
cid_tmp
;
cid_name_override
=
cid_tmp
;
}
}
...
@@ -2370,6 +2384,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
...
@@ -2370,6 +2384,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
dftflags
|=
SOF_NO_LIMITS
;
dftflags
|=
SOF_NO_LIMITS
;
}
}
if
(
ani_override
)
{
dftflags
|=
SOF_NO_EFFECTIVE_ANI
;
}
if
(
aniii_override
)
{
dftflags
|=
SOF_NO_EFFECTIVE_ANIII
;
}
if
(
cid_num_override
)
{
if
(
cid_num_override
)
{
dftflags
|=
SOF_NO_EFFECTIVE_CID_NUM
;
dftflags
|=
SOF_NO_EFFECTIVE_CID_NUM
;
}
}
...
@@ -2542,13 +2564,19 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
...
@@ -2542,13 +2564,19 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
new_profile
=
switch_caller_profile_new
(
oglobals
.
pool
,
new_profile
=
switch_caller_profile_new
(
oglobals
.
pool
,
NULL
,
NULL
,
NULL
,
NULL
,
cid_name_override
,
cid_num_override
,
NULL
,
NULL
,
NULL
,
NULL
,
__FILE__
,
NULL
,
chan_data
);
cid_name_override
,
cid_num_override
,
NULL
,
ani_override
,
aniii_override
,
NULL
,
__FILE__
,
NULL
,
chan_data
);
}
}
new_profile
->
uuid
=
SWITCH_BLANK_STRING
;
new_profile
->
uuid
=
SWITCH_BLANK_STRING
;
new_profile
->
chan_name
=
SWITCH_BLANK_STRING
;
new_profile
->
chan_name
=
SWITCH_BLANK_STRING
;
new_profile
->
destination_number
=
switch_core_strdup
(
new_profile
->
pool
,
chan_data
);
new_profile
->
destination_number
=
switch_core_strdup
(
new_profile
->
pool
,
chan_data
);
if
(
ani_override
)
{
new_profile
->
ani
=
switch_core_strdup
(
new_profile
->
pool
,
ani_override
);
}
if
(
aniii_override
)
{
new_profile
->
aniii
=
switch_core_strdup
(
new_profile
->
pool
,
aniii_override
);
}
if
(
cid_name_override
)
{
if
(
cid_name_override
)
{
new_profile
->
caller_id_name
=
switch_core_strdup
(
new_profile
->
pool
,
cid_name_override
);
new_profile
->
caller_id_name
=
switch_core_strdup
(
new_profile
->
pool
,
cid_name_override
);
}
}
...
@@ -2572,7 +2600,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
...
@@ -2572,7 +2600,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
new_profile
=
switch_caller_profile_new
(
oglobals
.
pool
,
new_profile
=
switch_caller_profile_new
(
oglobals
.
pool
,
NULL
,
NULL
,
NULL
,
NULL
,
cid_name_override
,
cid_num_override
,
NULL
,
NULL
,
NULL
,
NULL
,
__FILE__
,
NULL
,
chan_data
);
cid_name_override
,
cid_num_override
,
NULL
,
ani_override
,
aniii_override
,
NULL
,
__FILE__
,
NULL
,
chan_data
);
}
}
}
}
...
@@ -2615,6 +2643,16 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
...
@@ -2615,6 +2643,16 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
switch_event_merge
(
originate_var_event
,
local_var_event
);
switch_event_merge
(
originate_var_event
,
local_var_event
);
}
}
if
((
current_variable
=
switch_event_get_header
(
originate_var_event
,
"origination_ani"
)))
{
new_profile
->
ani
=
switch_core_strdup
(
new_profile
->
pool
,
current_variable
);
myflags
|=
SOF_NO_EFFECTIVE_ANI
;
}
if
((
current_variable
=
switch_event_get_header
(
originate_var_event
,
"origination_aniii"
)))
{
new_profile
->
aniii
=
switch_core_strdup
(
new_profile
->
pool
,
current_variable
);
myflags
|=
SOF_NO_EFFECTIVE_ANIII
;
}
if
((
current_variable
=
switch_event_get_header
(
originate_var_event
,
"origination_caller_id_number"
)))
{
if
((
current_variable
=
switch_event_get_header
(
originate_var_event
,
"origination_caller_id_number"
)))
{
new_profile
->
caller_id_number
=
switch_core_strdup
(
new_profile
->
pool
,
current_variable
);
new_profile
->
caller_id_number
=
switch_core_strdup
(
new_profile
->
pool
,
current_variable
);
myflags
|=
SOF_NO_EFFECTIVE_CID_NUM
;
myflags
|=
SOF_NO_EFFECTIVE_CID_NUM
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论