mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 05:02:10 +00:00
FSRTP-14
This commit is contained in:
committed by
Brian West
parent
9a74958b22
commit
70d73cafb7
@@ -116,6 +116,7 @@
|
||||
#include "switch_utils.h"
|
||||
#include "switch_caller.h"
|
||||
#include "switch_frame.h"
|
||||
#include "switch_rtcp_frame.h"
|
||||
#include "switch_module_interfaces.h"
|
||||
#include "switch_channel.h"
|
||||
#include "switch_buffer.h"
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||
* Copyright (C) 2005-2009, Anthony Minessale II <anthm@freeswitch.org>
|
||||
*
|
||||
* 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
|
||||
* Anthony Minessale II <anthm@freeswitch.org>
|
||||
* Portions created by the Initial Developer are Copyright (C)
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Sherwin Sim
|
||||
*
|
||||
*
|
||||
* switch_rtcp_frame.h -- RTCP Frame Structure
|
||||
*
|
||||
*/
|
||||
/*! \file switch_rtcp_frame.h
|
||||
\brief RTCP Frame Structure
|
||||
*/
|
||||
|
||||
#ifndef SWITCH_RTCP_FRAME_H
|
||||
#define SWITCH_RTCP_FRAME_H
|
||||
|
||||
#include <switch.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
/*! \brief An abstraction of a rtcp frame */
|
||||
struct switch_rtcp_frame {
|
||||
|
||||
uint16_t report_count;
|
||||
|
||||
uint16_t packet_type;
|
||||
|
||||
uint32_t ssrc;
|
||||
|
||||
uint32_t ntp_msw;
|
||||
|
||||
uint32_t ntp_lsw;
|
||||
|
||||
uint32_t timestamp;
|
||||
|
||||
uint32_t packet_count;
|
||||
|
||||
uint32_t octect_count;
|
||||
|
||||
};
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
#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:
|
||||
*/
|
||||
@@ -41,6 +41,7 @@
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
#define SWITCH_RTP_MAX_BUF_LEN 16384
|
||||
#define SWITCH_RTCP_MAX_BUF_LEN 16384
|
||||
#define SWITCH_RTP_MAX_CRYPTO_LEN 64
|
||||
#define SWITCH_RTP_KEY_LEN 30
|
||||
#define SWITCH_RTP_CRYPTO_KEY_32 "AES_CM_128_HMAC_SHA1_32"
|
||||
@@ -213,6 +214,13 @@ SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp_t **rtp_session);
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_activate_ice(switch_rtp_t *rtp_session, char *login, char *rlogin);
|
||||
|
||||
/*!
|
||||
\brief Activate sending RTCP Sender Reports (SR's)
|
||||
\param send_rate interval in milliseconds to send at
|
||||
\return SWITCH_STATUS_SUCCESS
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_activate_rtcp(switch_rtp_t *rtp_session, int send_rate);
|
||||
|
||||
/*!
|
||||
\brief Acvite a jitter buffer on an RTP session
|
||||
\param rtp_session the rtp session
|
||||
@@ -347,6 +355,15 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read(switch_rtp_t *rtp_sessi
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp_session, switch_frame_t *frame, switch_io_flag_t io_flags);
|
||||
|
||||
|
||||
/*!
|
||||
\brief Read RTCP data from a given RTP session without copying
|
||||
\param rtp_session the RTP session to read from
|
||||
\param frame an RTCP frame to populate with information
|
||||
\return the number of bytes read
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtcp_zerocopy_read_frame(switch_rtp_t *rtp_session, switch_rtcp_frame_t *frame);
|
||||
|
||||
SWITCH_DECLARE(void) rtp_flush_read_buffer(switch_rtp_t *rtp_session, switch_rtp_flush_t flush);
|
||||
|
||||
/*!
|
||||
|
||||
@@ -534,7 +534,8 @@ typedef enum {
|
||||
SWITCH_ZRTP_FLAG_SECURE_MITM_RECV = (1 << 26),
|
||||
SWITCH_RTP_FLAG_DEBUG_RTP_READ = (1 << 27),
|
||||
SWITCH_RTP_FLAG_DEBUG_RTP_WRITE = (1 << 28),
|
||||
SWITCH_RTP_FLAG_VIDEO = (1 << 29)
|
||||
SWITCH_RTP_FLAG_VIDEO = (1 << 29),
|
||||
SWITCH_RTP_FLAG_ENABLE_RTCP = (1 << 30)
|
||||
} switch_rtp_flag_enum_t;
|
||||
typedef uint32_t switch_rtp_flag_t;
|
||||
|
||||
@@ -607,6 +608,35 @@ typedef struct {
|
||||
#pragma pack(pop, r1)
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(push, r1, 1)
|
||||
#endif
|
||||
|
||||
#if SWITCH_BYTE_ORDER == __BIG_ENDIAN
|
||||
typedef struct {
|
||||
unsigned version:2; /* protocol version */
|
||||
unsigned p:1; /* padding flag */
|
||||
unsigned count:5; /* number of reception report blocks */
|
||||
unsigned type:8; /* packet type */
|
||||
unsigned length:16; /* length in 32-bit words - 1 */
|
||||
} switch_rtcp_hdr_t;
|
||||
|
||||
#else /* BIG_ENDIAN */
|
||||
|
||||
typedef struct {
|
||||
unsigned count:5; /* number of reception report blocks */
|
||||
unsigned p:1; /* padding flag */
|
||||
unsigned version:2; /* protocol version */
|
||||
unsigned type:8; /* packet type */
|
||||
unsigned length:16; /* length in 32-bit words - 1 */
|
||||
} switch_rtcp_hdr_t;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(pop, r1)
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\enum switch_priority_t
|
||||
\brief Priority Indication
|
||||
@@ -1352,6 +1382,7 @@ typedef enum {
|
||||
SWITCH_EVENT_SERVER_DISCONNECTED,
|
||||
SWITCH_EVENT_SEND_INFO,
|
||||
SWITCH_EVENT_RECV_INFO,
|
||||
SWITCH_EVENT_RECV_RTCP_MESSAGE,
|
||||
SWITCH_EVENT_CALL_SECURE,
|
||||
SWITCH_EVENT_NAT,
|
||||
SWITCH_EVENT_RECORD_START,
|
||||
@@ -1472,6 +1503,7 @@ typedef uint16_t switch_port_t;
|
||||
typedef uint8_t switch_payload_t;
|
||||
typedef struct switch_app_log switch_app_log_t;
|
||||
typedef struct switch_rtp switch_rtp_t;
|
||||
typedef struct switch_rtcp switch_rtcp_t;
|
||||
typedef struct switch_core_session_message switch_core_session_message_t;
|
||||
typedef struct switch_event_header switch_event_header_t;
|
||||
typedef struct switch_event switch_event_t;
|
||||
@@ -1479,6 +1511,7 @@ typedef struct switch_event_subclass switch_event_subclass_t;
|
||||
typedef struct switch_event_node switch_event_node_t;
|
||||
typedef struct switch_loadable_module switch_loadable_module_t;
|
||||
typedef struct switch_frame switch_frame_t;
|
||||
typedef struct switch_rtcp_frame switch_rtcp_frame_t;
|
||||
typedef struct switch_channel switch_channel_t;
|
||||
typedef struct switch_file_handle switch_file_handle_t;
|
||||
typedef struct switch_core_session switch_core_session_t;
|
||||
|
||||
Reference in New Issue
Block a user