Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
5bdf8bcc
提交
5bdf8bcc
authored
5月 20, 2010
作者:
Mathieu Parent
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Skinny: More channel variables
上级
c93e392d
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
77 行增加
和
11 行删除
+77
-11
skinny_protocol.c
src/mod/endpoints/mod_skinny/skinny_protocol.c
+0
-8
skinny_protocol.h
src/mod/endpoints/mod_skinny/skinny_protocol.h
+0
-1
skinny_server.c
src/mod/endpoints/mod_skinny/skinny_server.c
+76
-2
skinny_server.h
src/mod/endpoints/mod_skinny/skinny_server.h
+1
-0
没有找到文件。
src/mod/endpoints/mod_skinny/skinny_protocol.c
浏览文件 @
5bdf8bcc
...
...
@@ -242,14 +242,6 @@ switch_status_t skinny_device_event(listener_t *listener, switch_event_t **ev, s
return
SWITCH_STATUS_SUCCESS
;
}
switch_status_t
skinny_set_channel_variables
(
switch_channel_t
*
channel
,
listener_t
*
listener
,
uint32_t
line_instance
)
{
switch_channel_set_variable
(
channel
,
"skinny_profile_name"
,
listener
->
profile
->
name
);
switch_channel_set_variable
(
channel
,
"skinny_device_name"
,
listener
->
device_name
);
switch_channel_set_variable_printf
(
channel
,
"skinny_device_instance"
,
"%d"
,
listener
->
device_instance
);
switch_channel_set_variable_printf
(
channel
,
"skinny_line_instance"
,
"%d"
,
line_instance
);
return
SWITCH_STATUS_SUCCESS
;
}
/*****************************************************************************/
/*****************************************************************************/
...
...
src/mod/endpoints/mod_skinny/skinny_protocol.h
浏览文件 @
5bdf8bcc
...
...
@@ -640,7 +640,6 @@ char* skinny_codec2string(enum skinny_codecs skinnycodec);
switch_status_t
skinny_read_packet
(
listener_t
*
listener
,
skinny_message_t
**
req
);
switch_status_t
skinny_device_event
(
listener_t
*
listener
,
switch_event_t
**
ev
,
switch_event_types_t
event_id
,
const
char
*
subclass_name
);
switch_status_t
skinny_set_channel_variables
(
switch_channel_t
*
channel
,
listener_t
*
listener
,
uint32_t
line_instance
);
switch_status_t
skinny_session_walk_lines
(
skinny_profile_t
*
profile
,
char
*
channel_uuid
,
switch_core_db_callback_func_t
callback
,
void
*
data
);
...
...
src/mod/endpoints/mod_skinny/skinny_server.c
浏览文件 @
5bdf8bcc
...
...
@@ -117,7 +117,6 @@ switch_status_t skinny_create_incoming_session(listener_t *listener, uint32_t *l
snprintf
(
name
,
sizeof
(
name
),
"SKINNY/%s/%s:%d/%d"
,
listener
->
profile
->
name
,
listener
->
device_name
,
listener
->
device_instance
,
*
line_instance_p
);
switch_channel_set_name
(
channel
,
name
);
skinny_set_channel_variables
(
channel
,
listener
,
*
line_instance_p
);
if
(
switch_core_session_thread_launch
(
nsession
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
nsession
),
SWITCH_LOG_CRIT
,
...
...
@@ -155,6 +154,7 @@ switch_status_t skinny_create_incoming_session(listener_t *listener, uint32_t *l
skinny_execute_sql
(
listener
->
profile
,
sql
,
listener
->
profile
->
sql_mutex
);
switch_safe_free
(
sql
);
}
skinny_session_set_variables
(
nsession
,
listener
,
*
line_instance_p
);
send_set_ringer
(
listener
,
SKINNY_RING_OFF
,
SKINNY_RING_FOREVER
,
0
,
tech_pvt
->
call_id
);
send_set_speaker_mode
(
listener
,
SKINNY_SPEAKER_ON
);
...
...
@@ -411,11 +411,83 @@ switch_status_t skinny_session_send_call_info_all(switch_core_session_t *session
struct
skinny_session_send_call_info_all_helper
helper
=
{
0
};
private_t
*
tech_pvt
=
switch_core_session_get_private
(
session
);
helper
.
tech_pvt
=
switch_core_session_get_private
(
session
)
;
helper
.
tech_pvt
=
tech_pvt
;
return
skinny_session_walk_lines
(
tech_pvt
->
profile
,
switch_core_session_get_uuid
(
tech_pvt
->
session
),
skinny_session_send_call_info_all_callback
,
&
helper
);
}
struct
skinny_session_set_variables_helper
{
private_t
*
tech_pvt
;
switch_channel_t
*
channel
;
uint32_t
count
;
};
int
skinny_session_set_variables_callback
(
void
*
pArg
,
int
argc
,
char
**
argv
,
char
**
columnNames
)
{
char
*
device_name
=
argv
[
0
];
uint32_t
device_instance
=
atoi
(
argv
[
1
]);
uint32_t
position
=
atoi
(
argv
[
2
]);
uint32_t
line_instance
=
atoi
(
argv
[
3
]);
char
*
label
=
argv
[
4
];
char
*
value
=
argv
[
5
];
char
*
caller_name
=
argv
[
6
];
/* uint32_t ring_on_idle = atoi(argv[7]); */
/* uint32_t ring_on_active = atoi(argv[8]); */
/* uint32_t busy_trigger = atoi(argv[9]); */
/* char *forward_all = argv[10]; */
/* char *forward_busy = argv[11]; */
/* char *forward_noanswer = argv[12]; */
/* uint32_t noanswer_duration = atoi(argv[13]); */
/* char *channel_uuid = argv[14]; */
/* uint32_t call_id = atoi(argv[15]); */
/* uint32_t call_state = atoi(argv[16]); */
struct
skinny_session_set_variables_helper
*
helper
=
pArg
;
char
*
tmp
;
helper
->
count
++
;
switch_channel_set_variable_name_printf
(
helper
->
channel
,
device_name
,
"skinny_device_name_%d"
,
helper
->
count
);
if
((
tmp
=
switch_mprintf
(
"%d"
,
device_instance
)))
{
switch_channel_set_variable_name_printf
(
helper
->
channel
,
tmp
,
"skinny_device_instance_%d"
,
helper
->
count
);
switch_safe_free
(
tmp
);
}
if
((
tmp
=
switch_mprintf
(
"%d"
,
position
)))
{
switch_channel_set_variable_name_printf
(
helper
->
channel
,
tmp
,
"skinny_line_position_%d"
,
helper
->
count
);
switch_safe_free
(
tmp
);
}
if
((
tmp
=
switch_mprintf
(
"%d"
,
line_instance
)))
{
switch_channel_set_variable_name_printf
(
helper
->
channel
,
tmp
,
"skinny_line_instance_%d"
,
helper
->
count
);
switch_safe_free
(
tmp
);
}
switch_channel_set_variable_name_printf
(
helper
->
channel
,
label
,
"skinny_line_label_%d"
,
helper
->
count
);
switch_channel_set_variable_name_printf
(
helper
->
channel
,
value
,
"skinny_line_value_%d"
,
helper
->
count
);
switch_channel_set_variable_name_printf
(
helper
->
channel
,
caller_name
,
"skinny_line_caller_name_%d"
,
helper
->
count
);
return
0
;
}
switch_status_t
skinny_session_set_variables
(
switch_core_session_t
*
session
,
listener_t
*
listener
,
uint32_t
line_instance
)
{
switch_status_t
status
;
struct
skinny_session_set_variables_helper
helper
=
{
0
};
helper
.
tech_pvt
=
switch_core_session_get_private
(
session
);
helper
.
channel
=
switch_core_session_get_channel
(
session
);
helper
.
count
=
0
;
switch_channel_set_variable
(
helper
.
channel
,
"skinny_profile_name"
,
helper
.
tech_pvt
->
profile
->
name
);
if
(
listener
)
{
switch_channel_set_variable
(
helper
.
channel
,
"skinny_device_name"
,
listener
->
device_name
);
switch_channel_set_variable_printf
(
helper
.
channel
,
"skinny_device_instance"
,
"%d"
,
listener
->
device_instance
);
switch_channel_set_variable_printf
(
helper
.
channel
,
"skinny_line_instance"
,
"%d"
,
line_instance
);
}
status
=
skinny_session_walk_lines
(
helper
.
tech_pvt
->
profile
,
switch_core_session_get_uuid
(
helper
.
tech_pvt
->
session
),
skinny_session_set_variables_callback
,
&
helper
);
switch_channel_set_variable_printf
(
helper
.
channel
,
"skinny_lines_count"
,
"%d"
,
helper
.
count
);
return
status
;
}
struct
skinny_ring_lines_helper
{
private_t
*
tech_pvt
;
switch_core_session_t
*
remote_session
;
...
...
@@ -501,6 +573,8 @@ switch_call_cause_t skinny_ring_lines(private_t *tech_pvt, switch_core_session_t
status
=
skinny_session_walk_lines
(
tech_pvt
->
profile
,
switch_core_session_get_uuid
(
tech_pvt
->
session
),
skinny_ring_lines_callback
,
&
helper
);
skinny_session_set_variables
(
tech_pvt
->
session
,
NULL
,
0
);
if
(
status
!=
SWITCH_STATUS_SUCCESS
)
{
return
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
;
}
else
if
(
helper
.
lines_count
==
0
)
{
...
...
src/mod/endpoints/mod_skinny/skinny_server.h
浏览文件 @
5bdf8bcc
...
...
@@ -40,6 +40,7 @@ skinny_action_t skinny_session_dest_match_pattern(switch_core_session_t *session
switch_status_t
skinny_session_process_dest
(
switch_core_session_t
*
session
,
listener_t
*
listener
,
uint32_t
line_instance
,
char
*
dest
,
char
append_dest
,
uint32_t
backspace
);
switch_status_t
skinny_session_send_call_info
(
switch_core_session_t
*
session
,
listener_t
*
listener
,
uint32_t
line_instance
);
switch_status_t
skinny_session_send_call_info_all
(
switch_core_session_t
*
session
);
switch_status_t
skinny_session_set_variables
(
switch_core_session_t
*
session
,
listener_t
*
listener
,
uint32_t
line_instance
);
switch_call_cause_t
skinny_ring_lines
(
private_t
*
tech_pvt
,
switch_core_session_t
*
remote_session
);
switch_status_t
skinny_session_ring_out
(
switch_core_session_t
*
session
,
listener_t
*
listener
,
uint32_t
line_instance
);
switch_status_t
skinny_session_answer
(
switch_core_session_t
*
session
,
listener_t
*
listener
,
uint32_t
line_instance
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论