Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
655325ab
提交
655325ab
authored
7月 12, 2013
作者:
Nathan Neulinger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixup and merge in FS-4027 enhancements for additional device support
上级
802aa379
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
306 行增加
和
46 行删除
+306
-46
skinny_protocol.c
src/mod/endpoints/mod_skinny/skinny_protocol.c
+20
-0
skinny_protocol.h
src/mod/endpoints/mod_skinny/skinny_protocol.h
+208
-45
skinny_server.c
src/mod/endpoints/mod_skinny/skinny_server.c
+78
-1
没有找到文件。
src/mod/endpoints/mod_skinny/skinny_protocol.c
浏览文件 @
655325ab
...
...
@@ -623,6 +623,26 @@ switch_status_t perform_send_set_speaker_mode(listener_t *listener,
return
skinny_send_reply_quiet
(
listener
,
message
);
}
switch_status_t
perform_send_srvreq_response
(
listener_t
*
listener
,
const
char
*
file
,
const
char
*
func
,
int
line
,
char
*
ip
,
uint32_t
port
)
{
skinny_message_t
*
message
;
message
=
switch_core_alloc
(
listener
->
pool
,
12
+
sizeof
(
message
->
data
.
serv_res_mess
));
message
->
type
=
SERVER_RESPONSE_MESSAGE
;
message
->
length
=
4
+
sizeof
(
message
->
data
.
serv_res_mess
);
message
->
data
.
serv_res_mess
.
serverListenPort
[
0
]
=
port
;
switch_inet_pton
(
AF_INET
,
ip
,
&
message
->
data
.
serv_res_mess
.
serverIpAddr
[
0
]);
switch_copy_string
(
message
->
data
.
serv_res_mess
.
server
[
0
].
serverName
,
ip
,
sizeof
(
message
->
data
.
serv_res_mess
.
server
[
0
].
serverName
));
skinny_log_l_ffl
(
listener
,
file
,
func
,
line
,
SWITCH_LOG_DEBUG
,
"Sending Server Request Response with IP (%s) and Port (%d)
\n
"
,
ip
,
port
);
return
skinny_send_reply
(
listener
,
message
);
}
switch_status_t
perform_send_start_media_transmission
(
listener_t
*
listener
,
const
char
*
file
,
const
char
*
func
,
int
line
,
uint32_t
conference_id
,
...
...
src/mod/endpoints/mod_skinny/skinny_protocol.h
浏览文件 @
655325ab
差异被折叠。
点击展开。
src/mod/endpoints/mod_skinny/skinny_server.c
浏览文件 @
655325ab
...
...
@@ -2184,6 +2184,79 @@ switch_status_t skinny_handle_accessory_status_message(listener_t *listener, ski
return
SWITCH_STATUS_SUCCESS
;
}
switch_status_t
skinny_handle_updatecapabilities
(
listener_t
*
listener
,
skinny_message_t
*
request
)
{
char
*
sql
;
skinny_profile_t
*
profile
;
uint32_t
i
=
0
;
uint32_t
n
=
0
;
char
*
codec_order
[
SWITCH_MAX_CODECS
];
char
*
codec_string
;
size_t
string_len
,
string_pos
,
pos
;
switch_assert
(
listener
->
profile
);
switch_assert
(
listener
->
device_name
);
profile
=
listener
->
profile
;
skinny_check_data_length
(
request
,
sizeof
(
request
->
data
.
upd_cap
.
lel_audioCapCount
));
n
=
request
->
data
.
upd_cap
.
lel_audioCapCount
;
if
(
n
>
SWITCH_MAX_CODECS
)
{
n
=
SWITCH_MAX_CODECS
;
}
string_len
=
-
1
;
skinny_check_data_length
(
request
,
sizeof
(
request
->
data
.
upd_cap
.
lel_audioCapCount
)
+
n
*
sizeof
(
request
->
data
.
upd_cap
.
audioCaps
[
0
]));
for
(
i
=
0
;
i
<
n
;
i
++
)
{
char
*
codec
=
skinny_codec2string
(
request
->
data
.
upd_cap
.
audioCaps
[
i
].
lel_payloadCapability
);
codec_order
[
i
]
=
codec
;
string_len
+=
strlen
(
codec
)
+
1
;
}
i
=
0
;
pos
=
0
;
codec_string
=
switch_core_alloc
(
listener
->
pool
,
string_len
+
1
);
for
(
string_pos
=
0
;
string_pos
<
string_len
;
string_pos
++
)
{
char
*
codec
=
codec_order
[
i
];
switch_assert
(
i
<
n
);
if
(
pos
==
strlen
(
codec
))
{
codec_string
[
string_pos
]
=
','
;
i
++
;
pos
=
0
;
}
else
{
codec_string
[
string_pos
]
=
codec
[
pos
++
];
}
}
codec_string
[
string_len
]
=
'\0'
;
if
((
sql
=
switch_mprintf
(
"UPDATE skinny_devices SET codec_string='%s' WHERE name='%s'"
,
codec_string
,
listener
->
device_name
)))
{
skinny_execute_sql
(
profile
,
sql
,
profile
->
sql_mutex
);
switch_safe_free
(
sql
);
}
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Codecs %s supported.
\n
"
,
codec_string
);
return
SWITCH_STATUS_SUCCESS
;
}
switch_status_t
skinny_handle_server_req_message
(
listener_t
*
listener
,
skinny_message_t
*
request
)
{
skinny_profile_t
*
profile
;
profile
=
listener
->
profile
;
skinny_log_l
(
listener
,
SWITCH_LOG_INFO
,
"Received Server Request Message (length=%d).
\n
"
,
request
->
length
);
send_srvreq_response
(
listener
,
profile
->
ip
,
profile
->
port
);
return
SWITCH_STATUS_SUCCESS
;
}
switch_status_t
skinny_handle_xml_alarm
(
listener_t
*
listener
,
skinny_message_t
*
request
)
{
switch_event_t
*
event
=
NULL
;
...
...
@@ -2209,7 +2282,7 @@ switch_status_t skinny_handle_request(listener_t *listener, skinny_message_t *re
skinny_log_l
(
listener
,
SWITCH_LOG_DEBUG
,
"Received %s (type=%x,length=%d).
\n
"
,
skinny_message_type2str
(
request
->
type
),
request
->
type
,
request
->
length
);
}
if
(
zstr
(
listener
->
device_name
)
&&
request
->
type
!=
REGISTER_MESSAGE
&&
request
->
type
!=
ALARM_MESSAGE
&&
request
->
type
!=
XML_ALARM_MESSAGE
)
{
if
(
zstr
(
listener
->
device_name
)
&&
request
->
type
!=
REGISTER_MESSAGE
&&
request
->
type
!=
ALARM_MESSAGE
&&
request
->
type
!=
XML_ALARM_MESSAGE
&&
request
->
type
!=
KEEP_ALIVE_MESSAGE
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Device should send a register message first. Received %s (type=%x,length=%d).
\n
"
,
skinny_message_type2str
(
request
->
type
),
request
->
type
,
request
->
length
);
return
SWITCH_STATUS_FALSE
;
...
...
@@ -2281,6 +2354,10 @@ switch_status_t skinny_handle_request(listener_t *listener, skinny_message_t *re
return
skinny_handle_accessory_status_message
(
listener
,
request
);
case
XML_ALARM_MESSAGE
:
return
skinny_handle_xml_alarm
(
listener
,
request
);
case
DEVICE_UPDATECAPABILITIES
:
return
skinny_handle_updatecapabilities
(
listener
,
request
);
case
SERVER_REQ_MESSAGE
:
return
skinny_handle_server_req_message
(
listener
,
request
);
default:
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Unhandled %s (type=%x,length=%d).
\n
"
,
skinny_message_type2str
(
request
->
type
),
request
->
type
,
request
->
length
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论