Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
7dd872e9
提交
7dd872e9
authored
7月 18, 2016
作者:
Seven Du
提交者:
Anthony Minessale
9月 27, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-9575 #resolve [Add MRCP]
上级
c409499c
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
1988 行增加
和
16 行删除
+1988
-16
Makefile.am
Makefile.am
+2
-0
msrp.conf.xml
conf/vanilla/autoload_configs/msrp.conf.xml
+10
-0
switch_core_media.h
src/include/switch_core_media.h
+4
-1
switch_msrp.h
src/include/switch_msrp.h
+146
-0
switch_types.h
src/include/switch_types.h
+2
-0
mod_commands.c
src/mod/applications/mod_commands/mod_commands.c
+2
-0
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+17
-0
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+1
-0
switch_core.c
src/switch_core.c
+4
-0
switch_core_media.c
src/switch_core_media.c
+231
-15
switch_msrp.c
src/switch_msrp.c
+1569
-0
没有找到文件。
Makefile.am
浏览文件 @
7dd872e9
...
...
@@ -296,6 +296,7 @@ library_include_HEADERS = \
src/include/switch_curl.h
\
src/include/switch_json.h
\
src/include/switch_utf8.h
\
src/include/switch_msrp.h
\
src/include/switch_vpx.h
\
libs/libteletone/src/libteletone_detect.h
\
libs/libteletone/src/libteletone_generate.h
\
...
...
@@ -376,6 +377,7 @@ libfreeswitch_la_SOURCES = \
src/switch_curl.c
\
src/switch_hashtable.c
\
src/switch_utf8.c
\
src/switch_msrp.c
\
src/switch_vpx.c
\
libs/libtpl-1.5/src/tpl.c
\
libs/libteletone/src/libteletone_detect.c
\
...
...
conf/vanilla/autoload_configs/msrp.conf.xml
0 → 100644
浏览文件 @
7dd872e9
<configuration
name=
"msrp.conf"
description=
"MSRP"
>
<settings>
<param
name=
"listen-ip"
value=
"$${local_ip_v4}"
/>
<param
name=
"listen-port"
value=
"2855"
/>
<param
name=
"listen-ssl-port"
value=
"2856"
/>
<!-- <param name="message-buffer-size" value="50"/> -->
<!-- <param name="debug" value="true"/> -->
</settings>
</configuration>
src/include/switch_core_media.h
浏览文件 @
7dd872e9
...
...
@@ -35,6 +35,7 @@
#include <switch.h>
#include <switch_msrp.h>
SWITCH_BEGIN_EXTERN_C
...
...
@@ -371,7 +372,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_text_factory_destroy(switch_rtp_text_
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_print
(
switch_core_session_t
*
session
,
const
char
*
data
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_session_printf
(
switch_core_session_t
*
session
,
const
char
*
fmt
,
...);
SWITCH_DECLARE
(
switch_msrp_session_t
*
)
switch_core_media_get_msrp_session
(
switch_core_session_t
*
session
);
SWITCH_END_EXTERN_C
#endif
/* For Emacs:
...
...
src/include/switch_msrp.h
0 → 100644
浏览文件 @
7dd872e9
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2011-2016, Seven Du <dujinfang@gmail.com>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Seven Du <dujinfang@gmail.com>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
*
* msrp.h -- MSRP lib
*
*/
#ifndef _MSRP_H
#define _MSRP_H
#include <switch.h>
#include <openssl/ssl.h>
#define MSRP_LISTEN_PORT 2855
#define MSRP_SSL_LISTEN_PORT 2856
enum
{
MSRP_ST_WAIT_HEADER
,
MSRP_ST_PARSE_HEADER
,
MSRP_ST_WAIT_BODY
,
MSRP_ST_DONE
,
MSRP_ST_ERROR
,
MSRP_METHOD_REPLY
,
MSRP_METHOD_SEND
,
MSRP_METHOD_AUTH
,
MSRP_METHOD_REPORT
,
};
enum
{
MSRP_H_FROM_PATH
,
MSRP_H_TO_PATH
,
MSRP_H_MESSAGE_ID
,
MSRP_H_CONTENT_TYPE
,
MSRP_H_SUCCESS_REPORT
,
MSRP_H_FAILURE_REPORT
,
MSRP_H_STATUS
,
MSRP_H_KEEPALIVE
,
MSRP_H_UNKNOWN
};
typedef
struct
msrp_msg_s
{
int
state
;
int
method
;
char
*
headers
[
12
];
int
last_header
;
char
*
transaction_id
;
char
*
delimiter
;
int
code_number
;
char
*
code_description
;
switch_size_t
byte_start
;
switch_size_t
byte_end
;
switch_size_t
bytes
;
switch_size_t
payload_bytes
;
int
range_star
;
/* range-end is '*' */
char
*
last_p
;
char
*
payload
;
struct
msrp_msg_s
*
next
;
}
msrp_msg_t
;
typedef
struct
msrp_msg_s
switch_msrp_msg_t
;
typedef
struct
msrp_socket_s
{
switch_port_t
port
;
switch_socket_t
*
sock
;
switch_thread_t
*
thread
;
int
secure
;
}
msrp_socket_t
;
typedef
struct
msrp_client_socket_s
{
switch_socket_t
*
sock
;
int
secure
;
}
msrp_client_socket_t
;
typedef
struct
{
switch_memory_pool_t
*
pool
;
int
secure
;
char
*
remote_path
;
char
*
remote_accept_types
;
char
*
remote_accept_wrapped_types
;
char
*
remote_setup
;
char
*
remote_file_selector
;
char
*
local_path
;
char
*
local_accept_types
;
char
*
local_accept_wrapped_types
;
char
*
local_setup
;
char
*
local_file_selector
;
int
local_port
;
char
*
call_id
;
msrp_msg_t
*
msrp_msg
;
msrp_msg_t
*
last_msg
;
switch_mutex_t
*
mutex
;
switch_size_t
msrp_msg_buffer_size
;
switch_size_t
msrp_msg_count
;
msrp_socket_t
*
msock
;
msrp_client_socket_t
*
csock
;
switch_frame_t
frame
;
uint8_t
frame_data
[
SWITCH_RTP_MAX_BUF_LEN
];
}
switch_msrp_session_t
;
SWITCH_DECLARE
(
switch_status_t
)
switch_msrp_init
();
SWITCH_DECLARE
(
switch_status_t
)
switch_msrp_destroy
();
SWITCH_DECLARE
(
switch_msrp_session_t
*
)
switch_msrp_session_new
(
switch_memory_pool_t
*
pool
,
switch_bool_t
secure
);
SWITCH_DECLARE
(
switch_status_t
)
switch_msrp_session_destroy
(
switch_msrp_session_t
**
ms
);
// switch_status_t switch_msrp_session_push_msg(switch_msrp_session_t *ms, msrp_msg_t *msg);
SWITCH_DECLARE
(
switch_msrp_msg_t
*
)
switch_msrp_session_pop_msg
(
switch_msrp_session_t
*
ms
);
SWITCH_DECLARE
(
switch_status_t
)
switch_msrp_send
(
switch_msrp_session_t
*
ms
,
msrp_msg_t
*
msg
);
SWITCH_DECLARE
(
void
)
switch_msrp_load_apis_and_applications
(
switch_loadable_module_interface_t
**
moudle_interface
);
#endif
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
*/
src/include/switch_types.h
浏览文件 @
7dd872e9
...
...
@@ -1376,6 +1376,7 @@ typedef enum {
CC_QUEUEABLE_DTMF_DELAY
,
CC_IO_OVERRIDE
,
CC_RTP_RTT
,
CC_MSRP
,
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
CC_FLAG_MAX
}
switch_channel_cap_t
;
...
...
@@ -1528,6 +1529,7 @@ typedef enum {
CF_TEXT_ECHO
,
CF_TEXT_ACTIVE
,
CF_TEXT_IDLE
,
CF_MSRP
,
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
/* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
CF_FLAG_MAX
...
...
src/mod/applications/mod_commands/mod_commands.c
浏览文件 @
7dd872e9
...
...
@@ -7498,6 +7498,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
switch_console_set_complete
(
"add file_exists"
);
switch_console_set_complete
(
"add getcputime"
);
switch_msrp_load_apis_and_applications
(
module_interface
);
/* indicate that the module should continue to be loaded */
return
SWITCH_STATUS_NOUNLOAD
;
}
...
...
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
7dd872e9
...
...
@@ -927,6 +927,23 @@ static switch_status_t sofia_read_text_frame(switch_core_session_t *session, swi
static
switch_status_t
sofia_write_text_frame
(
switch_core_session_t
*
session
,
switch_frame_t
*
frame
,
switch_io_flag_t
flags
,
int
stream_id
)
{
if
(
switch_channel_test_flag
(
switch_core_session_get_channel
(
session
),
CF_MSRP
))
{
switch_msrp_session_t
*
msrp_session
=
switch_core_media_get_msrp_session
(
session
);
if
(
frame
&&
msrp_session
)
{
switch_msrp_msg_t
msrp_msg
=
{
0
};
msrp_msg
.
headers
[
MSRP_H_CONTENT_TYPE
]
=
"message/cpim"
;
// msrp_msg.headers[MSRP_H_CONTENT_TYPE] = "text/plain";
msrp_msg
.
payload
=
frame
->
data
;
msrp_msg
.
payload_bytes
=
frame
->
datalen
;
return
switch_msrp_send
(
msrp_session
,
&
msrp_msg
);
}
return
SWITCH_STATUS_FALSE
;
}
return
switch_core_media_write_frame
(
session
,
frame
,
flags
,
stream_id
,
SWITCH_MEDIA_TYPE_TEXT
);
}
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
7dd872e9
...
...
@@ -160,6 +160,7 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
switch_channel_set_cap
(
tech_pvt
->
channel
,
CC_JITTERBUFFER
);
switch_channel_set_cap
(
tech_pvt
->
channel
,
CC_FS_RTP
);
switch_channel_set_cap
(
tech_pvt
->
channel
,
CC_RTP_RTT
);
switch_channel_set_cap
(
tech_pvt
->
channel
,
CC_MSRP
);
switch_channel_set_cap
(
tech_pvt
->
channel
,
CC_QUEUEABLE_DTMF_DELAY
);
...
...
src/switch_core.c
浏览文件 @
7dd872e9
...
...
@@ -42,6 +42,7 @@
#include <switch_nat.h>
#include "private/switch_core_pvt.h"
#include <switch_curl.h>
#include <switch_msrp.h>
#ifndef WIN32
#include <switch_private.h>
#ifdef HAVE_SETRLIMIT
...
...
@@ -2391,6 +2392,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
switch_core_set_signal_handlers
();
switch_load_network_lists
(
SWITCH_FALSE
);
switch_msrp_init
();
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"Bringing up environment.
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"Loading Modules.
\n
"
);
if
(
switch_loadable_module_init
(
SWITCH_TRUE
)
!=
SWITCH_STATUS_SUCCESS
)
{
...
...
@@ -2905,6 +2908,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
switch_scheduler_task_thread_stop
();
switch_rtp_shutdown
();
switch_msrp_destroy
();
if
(
switch_test_flag
((
&
runtime
),
SCF_USE_AUTO_NAT
))
{
switch_nat_shutdown
();
...
...
src/switch_core_media.c
浏览文件 @
7dd872e9
差异被折叠。
点击展开。
src/switch_msrp.c
0 → 100644
浏览文件 @
7dd872e9
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论