try out new builtin RTP using srtp lib

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1012 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2006-04-03 21:00:13 +00:00
parent e0fee29284
commit 828e03715f
15 changed files with 589 additions and 72 deletions
+3 -1
View File
@@ -43,7 +43,7 @@ extern "C" {
#include <switch_platform.h>
#ifndef WIN32
#include <config.h>
#include <switch_am_config.h>
#endif
#include <assert.h>
@@ -65,6 +65,8 @@ extern "C" {
#include <switch_event.h>
#include <switch_resample.h>
#include <switch_ivr.h>
#include <switch_rtp.h>
#include <switch_stun.h>
#ifdef __cplusplus
}
#endif
@@ -1,4 +1,6 @@
/* src/include/config.h.in. Generated from configure.in by autoheader. */
#ifndef SWITCH_AM_CONFIG_H
#define SWITCH_AM_CONFIG_H
/* src/include/switch_am_config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
@@ -114,3 +116,4 @@
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
#endif
+6
View File
@@ -38,6 +38,12 @@
extern "C" {
#endif
#ifdef WIN32
typedef SOCKET switch_raw_socket_t;
#else
typedef int switch_raw_socket_t;
#endif
#ifdef __ICC
#pragma warning (disable:810 869 981 279 1469 188)
#endif
+88
View File
@@ -0,0 +1,88 @@
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005/2006, Anthony Minessale II <anthmct@yahoo.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
* Anthony Minessale II <anthmct@yahoo.com>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Anthony Minessale II <anthmct@yahoo.com>
*
*
* switch_channel.h -- Media Channel Interface
*
*/
/**
* @file switch_rtp.h
* @brief RTP
*
*/
#ifndef SWITCH_RTP_H
#define SWITCH_RTP_H
#ifdef __cplusplus
extern "C" {
#ifdef _FORMATBUG
}
#endif
#endif
typedef void (*switch_rtp_invalid_handler)(switch_rtp *rtp_session,
switch_raw_socket_t sock,
void *data,
unsigned int datalen,
uint32_t fromip,
uint16_t fromport);
switch_rtp *switch_rtp_new(char *rx_ip,
int rx_port,
char *tx_ip,
int tx_port,
int payload,
switch_rtp_flag_t flags,
const char **err,
switch_memory_pool *pool);
void switch_rtp_destroy(switch_rtp **rtp_session);
switch_raw_socket_t switch_rtp_get_rtp_socket(switch_rtp *rtp_session);
void switch_rtp_set_invald_handler(switch_rtp *rtp_session, switch_rtp_invalid_handler on_invalid);
int switch_rtp_read(switch_rtp *rtp_session, void *data, uint32_t datalen, int *payload_type);
int switch_rtp_zerocopy_read(switch_rtp *rtp_session, void **data, int *payload_type);
int switch_rtp_write(switch_rtp *rtp_session, void *data, int datalen, uint32_t ts);
int switch_rtp_write_payload(switch_rtp *rtp_session, void *data, int datalen, int payload, uint32_t ts, uint32_t mseq);
uint32_t switch_rtp_start(switch_rtp *rtp_session);
uint32_t switch_rtp_get_ssrc(switch_rtp *rtp_session);
void switch_rtp_killread(switch_rtp *rtp_session);
void switch_rtp_set_private(switch_rtp *rtp_session, void *private_data);
void *switch_rtp_get_private(switch_rtp *rtp_session);
#include <switch.h>
#ifdef __cplusplus
}
#endif
#endif
+14
View File
@@ -94,6 +94,18 @@ SWITCH_DECLARE_DATA extern switch_directories SWITCH_GLOBAL_dirs;
#define SWITCH_TRUE 1
#define SWITCH_FALSE 0
/*!
\enum switch_rtp_flag_t
\brief RTP Related Flags
<pre>
SWITCH_RTP_NOBLOCK - Do not block
SWITCH_RTP_FLAG_IO - IO is ready
</pre>
*/
typedef enum {
SWITCH_RTP_NOBLOCK = ( 1 << 0),
SWITCH_RTP_FLAG_IO = (1 << 1)
} switch_rtp_flag_t;
/*!
\enum switch_priority_t
@@ -429,6 +441,8 @@ typedef enum {
SWITCH_EVENT_ALL
} switch_event_t;
typedef struct switch_rtp switch_rtp;
typedef struct switch_core_session_message switch_core_session_message;
typedef struct switch_audio_resampler switch_audio_resampler;
typedef struct switch_event_header switch_event_header;