Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
dcb4beb1
提交
dcb4beb1
authored
3月 30, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update caller_id not callee_id when getting a display update from an inbound leg
上级
f8d26368
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
42 行增加
和
15 行删除
+42
-15
sofia.c
src/mod/endpoints/mod_sofia/sofia.c
+42
-15
没有找到文件。
src/mod/endpoints/mod_sofia/sofia.c
浏览文件 @
dcb4beb1
...
...
@@ -833,13 +833,26 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro
switch_event_t
*
event
;
const
char
*
val
;
int
fs
=
0
,
lazy
=
0
,
att
=
0
;
const
char
*
name_var
=
"callee_id_name"
;
const
char
*
num_var
=
"callee_id_number"
;
const
char
*
ename_var
=
"effective_callee_id_name"
;
const
char
*
enum_var
=
"effective_callee_id_number"
;
if
(
switch_true
(
switch_channel_get_variable
(
channel
,
SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE
)))
{
return
;
}
number
=
(
char
*
)
switch_channel_get_variable
(
channel
,
"callee_id_number"
);
name
=
(
char
*
)
switch_channel_get_variable
(
channel
,
"callee_id_name"
);
if
(
switch_channel_direction
(
channel
)
==
SWITCH_CALL_DIRECTION_INBOUND
)
{
name_var
=
"caller_id_name"
;
num_var
=
"caller_id_number"
;
ename_var
=
"effective_caller_id_name"
;
enum_var
=
"effective_caller_id_number"
;
}
number
=
(
char
*
)
switch_channel_get_variable
(
channel
,
num_var
);
name
=
(
char
*
)
switch_channel_get_variable
(
channel
,
name_var
);
if
(
zstr
(
number
)
&&
sip
->
sip_to
)
{
...
...
@@ -886,18 +899,18 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro
}
}
if
(((
tmp
=
switch_channel_get_variable
(
channel
,
"effective_callee_id_name"
))
||
if
(((
tmp
=
switch_channel_get_variable
(
channel
,
ename_var
))
||
(
tmp
=
switch_channel_get_variable
(
channel
,
"sip_callee_id_name"
)))
&&
!
zstr
(
tmp
))
{
name
=
(
char
*
)
tmp
;
}
if
(((
tmp
=
switch_channel_get_variable
(
channel
,
"effective_callee_id_number"
))
||
if
(((
tmp
=
switch_channel_get_variable
(
channel
,
enum_var
))
||
(
tmp
=
switch_channel_get_variable
(
channel
,
"sip_callee_id_number"
)))
&&
!
zstr
(
tmp
))
{
number
=
tmp
;
}
if
(
zstr
(
number
))
{
if
((
tmp
=
switch_channel_get_variable
(
channel
,
"callee_id_number"
))
&&
!
zstr
(
tmp
))
{
if
((
tmp
=
switch_channel_get_variable
(
channel
,
num_var
))
&&
!
zstr
(
tmp
))
{
number
=
(
char
*
)
tmp
;
}
...
...
@@ -907,7 +920,7 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro
}
if
(
zstr
(
name
))
{
if
((
tmp
=
switch_channel_get_variable
(
channel
,
"callee_id_name"
))
&&
!
zstr
(
tmp
))
{
if
((
tmp
=
switch_channel_get_variable
(
channel
,
name_var
))
&&
!
zstr
(
tmp
))
{
name
=
(
char
*
)
tmp
;
}
}
...
...
@@ -922,16 +935,30 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro
caller_profile
=
switch_channel_get_caller_profile
(
channel
);
if
(
!
strcmp
(
caller_profile
->
callee_id_name
,
name
)
&&
!
strcmp
(
caller_profile
->
callee_id_number
,
number
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG1
,
"%s Same Callee ID
\"
%s
\"
<%s>
\n
"
,
switch_channel_get_name
(
channel
),
name
,
number
);
send
=
0
;
}
else
{
caller_profile
->
callee_id_name
=
switch_sanitize_number
(
switch_core_strdup
(
caller_profile
->
pool
,
name
));
caller_profile
->
callee_id_number
=
switch_sanitize_number
(
switch_core_strdup
(
caller_profile
->
pool
,
number
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"%s Update Callee ID to
\"
%s
\"
<%s>
\n
"
,
switch_channel_get_name
(
channel
),
name
,
number
);
if
(
switch_channel_direction
(
channel
)
==
SWITCH_CALL_DIRECTION_INBOUND
)
{
if
(
lazy
||
(
att
&&
!
switch_channel_get_partner_uuid
(
channel
)))
{
switch_channel_flip_cid
(
channel
);
if
(
!
strcmp
(
caller_profile
->
caller_id_name
,
name
)
&&
!
strcmp
(
caller_profile
->
caller_id_number
,
number
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG1
,
"%s Same Caller ID
\"
%s
\"
<%s>
\n
"
,
switch_channel_get_name
(
channel
),
name
,
number
);
send
=
0
;
}
else
{
caller_profile
->
caller_id_name
=
switch_sanitize_number
(
switch_core_strdup
(
caller_profile
->
pool
,
name
));
caller_profile
->
caller_id_number
=
switch_sanitize_number
(
switch_core_strdup
(
caller_profile
->
pool
,
number
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"%s Update Caller ID to
\"
%s
\"
<%s>
\n
"
,
switch_channel_get_name
(
channel
),
name
,
number
);
}
}
else
{
if
(
!
strcmp
(
caller_profile
->
callee_id_name
,
name
)
&&
!
strcmp
(
caller_profile
->
callee_id_number
,
number
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG1
,
"%s Same Callee ID
\"
%s
\"
<%s>
\n
"
,
switch_channel_get_name
(
channel
),
name
,
number
);
send
=
0
;
}
else
{
caller_profile
->
callee_id_name
=
switch_sanitize_number
(
switch_core_strdup
(
caller_profile
->
pool
,
name
));
caller_profile
->
callee_id_number
=
switch_sanitize_number
(
switch_core_strdup
(
caller_profile
->
pool
,
number
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"%s Update Callee ID to
\"
%s
\"
<%s>
\n
"
,
switch_channel_get_name
(
channel
),
name
,
number
);
if
(
lazy
||
(
att
&&
!
switch_channel_get_partner_uuid
(
channel
)))
{
switch_channel_flip_cid
(
channel
);
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论