Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
cca9c367
提交
cca9c367
authored
5月 03, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FSCORE-601
上级
e5cc0539
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
36 行增加
和
21 行删除
+36
-21
switch_ivr_originate.c
src/switch_ivr_originate.c
+36
-21
没有找到文件。
src/switch_ivr_originate.c
浏览文件 @
cca9c367
...
...
@@ -121,6 +121,8 @@ typedef struct {
int
sending_ringback
;
int
bridge_early_media
;
switch_thread_t
*
ethread
;
switch_caller_profile_t
*
caller_profile_override
;
switch_memory_pool_t
*
pool
;
}
originate_global_t
;
...
...
@@ -1449,8 +1451,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess
}
if
(
session
)
{
switch_caller_profile_t
*
cpp
=
NULL
;
channel
=
switch_core_session_get_channel
(
session
);
cp
=
switch_channel_get_caller_profile
(
channel
);
if
((
cpp
=
switch_channel_get_caller_profile
(
channel
)))
{
cp
=
switch_caller_profile_dup
(
pool
,
cpp
);
}
}
switch_threadattr_create
(
&
thd_attr
,
pool
);
...
...
@@ -1724,7 +1729,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
ringback_t
ringback
=
{
0
};
time_t
start
;
switch_frame_t
*
read_frame
=
NULL
;
switch_memory_pool_t
*
pool
=
NULL
;
int
r
=
0
,
i
,
and_argc
=
0
,
or_argc
=
0
;
int32_t
sleep_ms
=
1000
,
try
=
0
,
retries
=
1
;
switch_codec_t
write_codec
=
{
0
};
...
...
@@ -1760,6 +1764,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
oglobals
.
ringback_ok
=
1
;
oglobals
.
bridge_early_media
=
-
1
;
switch_core_new_memory_pool
(
&
oglobals
.
pool
);
if
(
caller_profile_override
)
{
oglobals
.
caller_profile_override
=
switch_caller_profile_dup
(
oglobals
.
pool
,
caller_profile_override
);
}
else
if
(
session
)
{
switch_caller_profile_t
*
cp
=
switch_channel_get_caller_profile
(
switch_core_session_get_channel
(
session
));
if
(
cp
)
{
oglobals
.
caller_profile_override
=
switch_caller_profile_dup
(
oglobals
.
pool
,
cp
);
}
}
if
(
session
)
{
const
char
*
to_var
,
*
bypass_media
=
NULL
,
*
proxy_media
=
NULL
;
...
...
@@ -2235,7 +2250,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
peer_channel
=
NULL
;
start
=
0
;
read_frame
=
NULL
;
pool
=
NULL
;
oglobals
.
ringback_ok
=
1
;
var
=
NULL
;
to
=
0
;
...
...
@@ -2313,9 +2327,16 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
status
=
SWITCH_STATUS_FALSE
;
goto
done
;
}
if
((
caller_caller_profile
=
oglobals
.
caller_profile_override
))
{
new_profile
=
switch_caller_profile_dup
(
oglobals
.
pool
,
caller_caller_profile
);
}
else
{
new_profile
=
switch_caller_profile_new
(
oglobals
.
pool
,
NULL
,
NULL
,
cid_name_override
,
cid_num_override
,
NULL
,
NULL
,
NULL
,
NULL
,
__FILE__
,
NULL
,
chan_data
);
}
caller_caller_profile
=
caller_profile_override
?
caller_profile_override
:
switch_channel_get_caller_profile
(
caller_channel
);
new_profile
=
switch_caller_profile_clone
(
oglobals
.
session
,
caller_caller_profile
);
new_profile
->
uuid
=
SWITCH_BLANK_STRING
;
new_profile
->
chan_name
=
SWITCH_BLANK_STRING
;
new_profile
->
destination_number
=
switch_core_strdup
(
new_profile
->
pool
,
chan_data
);
...
...
@@ -2344,13 +2365,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
if
(
cid_num_override
)
{
new_profile
->
caller_id_number
=
switch_core_strdup
(
new_profile
->
pool
,
cid_num_override
);
}
pool
=
NULL
;
}
else
{
switch_core_new_memory_pool
(
&
pool
);
if
(
caller_profile_override
)
{
new_profile
=
switch_caller_profile_dup
(
pool
,
caller_profile_override
);
if
(
oglobals
.
caller_profile_override
)
{
new_profile
=
switch_caller_profile_dup
(
oglobals
.
pool
,
caller_profile_override
);
new_profile
->
destination_number
=
switch_core_strdup
(
new_profile
->
pool
,
switch_str_nil
(
chan_data
));
new_profile
->
uuid
=
SWITCH_BLANK_STRING
;
new_profile
->
chan_name
=
SWITCH_BLANK_STRING
;
...
...
@@ -2362,7 +2379,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
cid_num_override
=
"0000000000"
;
}
new_profile
=
switch_caller_profile_new
(
pool
,
new_profile
=
switch_caller_profile_new
(
oglobals
.
pool
,
NULL
,
NULL
,
cid_name_override
,
cid_num_override
,
NULL
,
NULL
,
NULL
,
NULL
,
__FILE__
,
NULL
,
chan_data
);
...
...
@@ -2471,18 +2488,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
switch_set_flag
(
new_profile
,
SWITCH_CPF_HIDE_NUMBER
);
}
}
current_variable
=
NULL
;
switch_event_add_header_string
(
var_event
,
SWITCH_STACK_BOTTOM
,
"originate_early_media"
,
oglobals
.
early_ok
?
"true"
:
"false"
);
if
((
reason
=
switch_core_session_outgoing_channel
(
oglobals
.
session
,
var_event
,
chan_type
,
new_profile
,
&
new_session
,
&
pool
,
myflags
,
cancel_cause
))
!=
SWITCH_CAUSE_SUCCESS
)
{
new_profile
,
&
new_session
,
NULL
,
myflags
,
cancel_cause
))
!=
SWITCH_CAUSE_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Cannot create outgoing channel of type [%s] cause: [%s]
\n
"
,
chan_type
,
switch_channel_cause2str
(
reason
));
if
(
pool
)
{
switch_core_destroy_memory_pool
(
&
pool
);
}
continue
;
}
...
...
@@ -2490,11 +2503,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
status
=
SWITCH_STATUS_FALSE
;
goto
done
;
}
pool
=
NULL
;
originate_status
[
i
].
caller_profile
=
new_profile
;
originate_status
[
i
].
peer_session
=
new_session
;
originate_status
[
i
].
peer_channel
=
switch_core_session_get_channel
(
new_session
);
originate_status
[
i
].
caller_profile
=
switch_channel_get_caller_profile
(
originate_status
[
i
].
peer_channel
);
originate_status
[
i
].
peer_session
=
new_session
;
switch_channel_set_flag
(
originate_status
[
i
].
peer_channel
,
CF_ORIGINATING
);
if
((
lc
=
switch_event_get_header
(
var_event
,
"local_var_clobber"
)))
{
...
...
@@ -3434,6 +3447,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
*
cause
=
force_reason
;
}
switch_core_destroy_memory_pool
(
&
oglobals
.
pool
);
return
status
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论