Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
555b2053
提交
555b2053
authored
4月 09, 2010
作者:
Mathieu Parent
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Skinny: handle backspace
上级
a1952b86
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
31 行增加
和
17 行删除
+31
-17
skinny_protocol.c
src/mod/endpoints/mod_skinny/skinny_protocol.c
+31
-17
没有找到文件。
src/mod/endpoints/mod_skinny/skinny_protocol.c
浏览文件 @
555b2053
...
...
@@ -602,24 +602,31 @@ switch_status_t skinny_session_process_dest(switch_core_session_t *session, list
channel
=
switch_core_session_get_channel
(
session
);
tech_pvt
=
switch_core_session_get_private
(
session
);
if
(
!
dest
)
{
if
(
append_dest
==
'\0'
)
{
/* no digit yet */
send_start_tone
(
listener
,
SKINNY_TONE_DIALTONE
,
0
,
line_instance
,
tech_pvt
->
call_id
);
}
else
{
if
(
strlen
(
tech_pvt
->
caller_profile
->
destination_number
)
==
0
)
{
/* first digit */
send_stop_tone
(
listener
,
line_instance
,
tech_pvt
->
call_id
);
send_select_soft_keys
(
listener
,
line_instance
,
tech_pvt
->
call_id
,
SKINNY_KEY_SET_DIGITS_AFTER_DIALING_FIRST_DIGIT
,
0xffff
);
}
if
(
!
dest
)
{
if
(
backspace
)
{
/* backspace */
*
tech_pvt
->
caller_profile
->
destination_number
++
=
'\0'
;
}
if
(
append_dest
!=
'\0'
&&
!
backspace
)
{
/* append digit */
tech_pvt
->
caller_profile
->
destination_number
=
switch_core_sprintf
(
tech_pvt
->
caller_profile
->
pool
,
"%s%c"
,
tech_pvt
->
caller_profile
->
destination_number
,
append_dest
);
}
if
(
strlen
(
tech_pvt
->
caller_profile
->
destination_number
)
==
0
)
{
/* no digit yet */
send_start_tone
(
listener
,
SKINNY_TONE_DIALTONE
,
0
,
line_instance
,
tech_pvt
->
call_id
);
if
(
backspace
)
{
send_select_soft_keys
(
listener
,
line_instance
,
tech_pvt
->
call_id
,
SKINNY_KEY_SET_OFF_HOOK
,
0xffff
);
/* TODO: How to clear the screen? */
}
}
else
if
(
strlen
(
tech_pvt
->
caller_profile
->
destination_number
)
==
1
)
{
/* first digit */
send_stop_tone
(
listener
,
line_instance
,
tech_pvt
->
call_id
);
send_select_soft_keys
(
listener
,
line_instance
,
tech_pvt
->
call_id
,
SKINNY_KEY_SET_DIGITS_AFTER_DIALING_FIRST_DIGIT
,
0xffff
);
}
}
else
{
tech_pvt
->
caller_profile
->
destination_number
=
switch_core_strdup
(
tech_pvt
->
caller_profile
->
pool
,
dest
);
}
/* TODO Number is complete -> check against dialplan */
if
((
strlen
(
tech_pvt
->
caller_profile
->
destination_number
)
>=
4
)
||
dest
)
{
if
((
strlen
(
tech_pvt
->
caller_profile
->
destination_number
)
>=
4
)
||
dest
)
{
struct
skinny_session_process_dest_helper
helper
=
{
0
};
send_dialed_number
(
listener
,
tech_pvt
->
caller_profile
->
destination_number
,
line_instance
,
tech_pvt
->
call_id
);
skinny_line_set_state
(
listener
,
line_instance
,
tech_pvt
->
call_id
,
SKINNY_PROCEED
);
...
...
@@ -1892,17 +1899,18 @@ switch_status_t skinny_handle_soft_key_set_request(listener_t *listener, skinny_
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_ON_HOOK
].
soft_key_template_index
[
0
]
=
SOFTKEY_NEWCALL
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_ON_HOOK
].
soft_key_template_index
[
1
]
=
SOFTKEY_REDIAL
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_OFF_HOOK
].
soft_key_template_index
[
0
]
=
SOFTKEY_BACKSPACE
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_OFF_HOOK
].
soft_key_template_index
[
1
]
=
SOFTKEY_REDIAL
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_DIGITS_AFTER_DIALING_FIRST_DIGIT
].
soft_key_template_index
[
0
]
=
SOFTKEY_BACKSPACE
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_CONNECTED
].
soft_key_template_index
[
0
]
=
SOFTKEY_ENDCALL
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_CONNECTED
].
soft_key_template_index
[
1
]
=
SOFTKEY_HOLD
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_RING_IN
].
soft_key_template_index
[
0
]
=
SOFTKEY_
ENDCALL
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_RING_IN
].
soft_key_template_index
[
1
]
=
SOFTKEY_
ANSWER
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_RING_IN
].
soft_key_template_index
[
0
]
=
SOFTKEY_
ANSWER
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_RING_IN
].
soft_key_template_index
[
1
]
=
SOFTKEY_
ENDCALL
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_ON_HOLD
].
soft_key_template_index
[
0
]
=
SOFTKEY_
RESUME
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_ON_HOLD
].
soft_key_template_index
[
1
]
=
SOFTKEY_
NEWCALL
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_ON_HOLD
].
soft_key_template_index
[
0
]
=
SOFTKEY_
NEWCALL
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_ON_HOLD
].
soft_key_template_index
[
1
]
=
SOFTKEY_
RESUME
;
message
->
data
.
soft_key_set
.
soft_key_set
[
SKINNY_KEY_SET_ON_HOLD
].
soft_key_template_index
[
2
]
=
SOFTKEY_ENDCALL
;
skinny_send_reply
(
listener
,
message
);
...
...
@@ -2042,7 +2050,6 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn
case
SOFTKEY_NEWCALL
:
status
=
skinny_create_ingoing_session
(
listener
,
&
line_instance
,
&
session
);
tech_pvt
=
switch_core_session_get_private
(
session
);
assert
(
tech_pvt
!=
NULL
);
skinny_session_process_dest
(
session
,
listener
,
line_instance
,
NULL
,
'\0'
,
0
);
break
;
...
...
@@ -2053,6 +2060,13 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn
status
=
skinny_session_hold_line
(
session
,
listener
,
line_instance
);
}
break
;
case
SOFTKEY_BACKSPACE
:
session
=
skinny_profile_find_session
(
listener
->
profile
,
listener
,
&
line_instance
,
request
->
data
.
soft_key_event
.
call_id
);
if
(
session
)
{
skinny_session_process_dest
(
session
,
listener
,
line_instance
,
NULL
,
'\0'
,
1
);
}
break
;
case
SOFTKEY_ENDCALL
:
session
=
skinny_profile_find_session
(
listener
->
profile
,
listener
,
&
line_instance
,
request
->
data
.
soft_key_event
.
call_id
);
...
...
@@ -2078,7 +2092,7 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn
break
;
default:
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Unknown SoftKeyEvent type
while busy
: %d.
\n
"
,
request
->
data
.
soft_key_event
.
event
);
"Unknown SoftKeyEvent type: %d.
\n
"
,
request
->
data
.
soft_key_event
.
event
);
}
if
(
session
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论