2002-06-16 16:06:38 +00:00
|
|
|
/*
|
2005-08-30 18:32:10 +00:00
|
|
|
* Asterisk -- An open source telephony toolkit.
|
2002-06-16 16:06:38 +00:00
|
|
|
*
|
2006-01-03 22:16:23 +00:00
|
|
|
* Copyright (C) 1999 - 2006, Digium, Inc.
|
2002-06-16 16:06:38 +00:00
|
|
|
*
|
2004-12-28 16:35:31 +00:00
|
|
|
* Mark Spencer <markster@digium.com>
|
2002-06-16 16:06:38 +00:00
|
|
|
*
|
2005-08-30 18:32:10 +00:00
|
|
|
* See http://www.asterisk.org for more information about
|
|
|
|
|
* the Asterisk project. Please do not directly contact
|
|
|
|
|
* any of the maintainers of this project for assistance;
|
|
|
|
|
* the project provides a web site, mailing lists and IRC
|
|
|
|
|
* channels for your use.
|
|
|
|
|
*
|
2002-06-16 16:06:38 +00:00
|
|
|
* This program is free software, distributed under the terms of
|
2005-08-30 18:32:10 +00:00
|
|
|
* the GNU General Public License Version 2. See the LICENSE file
|
|
|
|
|
* at the top of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2006-03-31 10:29:50 +00:00
|
|
|
/*!
|
2005-10-12 20:45:18 +00:00
|
|
|
* \file rtp.h
|
|
|
|
|
* \brief Supports RTP and RTCP with Symmetric RTP support for NAT traversal.
|
2006-03-31 10:29:50 +00:00
|
|
|
*
|
2005-10-24 20:12:06 +00:00
|
|
|
* RTP is defined in RFC 3550.
|
2002-06-16 16:06:38 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _ASTERISK_RTP_H
|
|
|
|
|
#define _ASTERISK_RTP_H
|
|
|
|
|
|
2007-11-17 14:11:53 +00:00
|
|
|
#include "asterisk/network.h"
|
2006-01-03 09:30:19 +00:00
|
|
|
|
2005-04-21 06:02:45 +00:00
|
|
|
#include "asterisk/frame.h"
|
|
|
|
|
#include "asterisk/io.h"
|
|
|
|
|
#include "asterisk/sched.h"
|
|
|
|
|
#include "asterisk/channel.h"
|
2006-01-03 09:30:19 +00:00
|
|
|
#include "asterisk/linkedlists.h"
|
2002-06-16 16:06:38 +00:00
|
|
|
|
|
|
|
|
#if defined(__cplusplus) || defined(c_plusplus)
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-03-12 06:00:18 +00:00
|
|
|
/* Codes for RTP-specific data - not defined by our AST_FORMAT codes */
|
|
|
|
|
/*! DTMF (RFC2833) */
|
2006-06-06 16:09:33 +00:00
|
|
|
#define AST_RTP_DTMF (1 << 0)
|
2003-03-12 06:00:18 +00:00
|
|
|
/*! 'Comfort Noise' (RFC3389) */
|
2006-06-06 16:09:33 +00:00
|
|
|
#define AST_RTP_CN (1 << 1)
|
2003-05-02 15:37:34 +00:00
|
|
|
/*! DTMF (Cisco Proprietary) */
|
2006-06-06 16:09:33 +00:00
|
|
|
#define AST_RTP_CISCO_DTMF (1 << 2)
|
2003-03-12 06:00:18 +00:00
|
|
|
/*! Maximum RTP-specific code */
|
2006-06-06 16:09:33 +00:00
|
|
|
#define AST_RTP_MAX AST_RTP_CISCO_DTMF
|
2003-03-12 06:00:18 +00:00
|
|
|
|
2006-12-05 20:39:13 +00:00
|
|
|
/*! Maxmum number of payload defintions for a RTP session */
|
2006-06-05 09:42:28 +00:00
|
|
|
#define MAX_RTP_PT 256
|
|
|
|
|
|
2008-05-14 13:37:07 +00:00
|
|
|
/*! T.140 Redundancy Maxium number of generations */
|
|
|
|
|
#define RED_MAX_GENERATION 5
|
|
|
|
|
|
2006-12-05 20:39:13 +00:00
|
|
|
#define FLAG_3389_WARNING (1 << 0)
|
|
|
|
|
|
2006-07-13 01:38:47 +00:00
|
|
|
enum ast_rtp_options {
|
|
|
|
|
AST_RTP_OPT_G726_NONSTANDARD = (1 << 0),
|
|
|
|
|
};
|
|
|
|
|
|
2006-08-28 17:37:56 +00:00
|
|
|
enum ast_rtp_get_result {
|
|
|
|
|
/*! Failed to find the RTP structure */
|
|
|
|
|
AST_RTP_GET_FAILED = 0,
|
|
|
|
|
/*! RTP structure exists but true native bridge can not occur so try partial */
|
|
|
|
|
AST_RTP_TRY_PARTIAL,
|
|
|
|
|
/*! RTP structure exists and native bridge can occur */
|
|
|
|
|
AST_RTP_TRY_NATIVE,
|
|
|
|
|
};
|
|
|
|
|
|
2008-07-05 19:27:42 +00:00
|
|
|
/*! \brief Variables used in ast_rtcp_get function */
|
|
|
|
|
enum ast_rtp_qos_vars {
|
|
|
|
|
AST_RTP_TXCOUNT,
|
|
|
|
|
AST_RTP_RXCOUNT,
|
|
|
|
|
AST_RTP_TXJITTER,
|
|
|
|
|
AST_RTP_RXJITTER,
|
|
|
|
|
AST_RTP_RXPLOSS,
|
|
|
|
|
AST_RTP_TXPLOSS,
|
|
|
|
|
AST_RTP_RTT
|
|
|
|
|
};
|
|
|
|
|
|
2006-08-28 17:37:56 +00:00
|
|
|
struct ast_rtp;
|
2008-05-14 13:37:07 +00:00
|
|
|
/*! T.140 Redundancy structure*/
|
|
|
|
|
struct rtp_red;
|
2006-08-28 17:37:56 +00:00
|
|
|
|
2006-12-05 20:39:13 +00:00
|
|
|
/*! \brief This is the structure that binds a channel (SIP/Jingle/H.323) to the RTP subsystem
|
|
|
|
|
*/
|
2003-02-16 06:00:12 +00:00
|
|
|
struct ast_rtp_protocol {
|
2006-01-03 09:30:19 +00:00
|
|
|
/*! Get RTP struct, or NULL if unwilling to transfer */
|
2006-08-28 17:37:56 +00:00
|
|
|
enum ast_rtp_get_result (* const get_rtp_info)(struct ast_channel *chan, struct ast_rtp **rtp);
|
2006-01-03 09:30:19 +00:00
|
|
|
/*! Get RTP struct, or NULL if unwilling to transfer */
|
2006-08-28 17:37:56 +00:00
|
|
|
enum ast_rtp_get_result (* const get_vrtp_info)(struct ast_channel *chan, struct ast_rtp **rtp);
|
2007-02-16 13:35:44 +00:00
|
|
|
/*! Get RTP struct, or NULL if unwilling to transfer */
|
|
|
|
|
enum ast_rtp_get_result (* const get_trtp_info)(struct ast_channel *chan, struct ast_rtp **rtp);
|
2006-01-03 09:30:19 +00:00
|
|
|
/*! Set RTP peer */
|
2007-02-16 13:35:44 +00:00
|
|
|
int (* const set_rtp_peer)(struct ast_channel *chan, struct ast_rtp *peer, struct ast_rtp *vpeer, struct ast_rtp *tpeer, int codecs, int nat_active);
|
2005-03-04 06:47:24 +00:00
|
|
|
int (* const get_codec)(struct ast_channel *chan);
|
|
|
|
|
const char * const type;
|
2006-01-03 09:30:19 +00:00
|
|
|
AST_LIST_ENTRY(ast_rtp_protocol) list;
|
2003-02-16 06:00:12 +00:00
|
|
|
};
|
|
|
|
|
|
This patch adds more detailed statistics for RTP channels, and provides an API call to access it, including maximums, minimums, standard deviatinos,
and normal deviations. Currently this is implemented for chan_sip, but could be added to the func_channel_read callbacks for the CHANNEL function
for any channel that uses RTP.
(closes issue #10590)
Reported by: gasparz
Patches:
chan_sip_c.diff uploaded by gasparz (license 219)
rtp_c.diff uploaded by gasparz (license 219)
rtp_h.diff uploaded by gasparz (license 219)
audioqos-trunk.diff uploaded by snuffy (license 35)
rtpqos-trunk-r119891.diff uploaded by sergee (license 138)
Tested by: jsmith, gasparz, snuffy, marsosa, chappell, sergee
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05 16:24:19 +00:00
|
|
|
enum ast_rtp_quality_type {
|
|
|
|
|
RTPQOS_SUMMARY = 0,
|
|
|
|
|
RTPQOS_JITTER,
|
|
|
|
|
RTPQOS_LOSS,
|
|
|
|
|
RTPQOS_RTT
|
|
|
|
|
};
|
|
|
|
|
|
2007-04-16 15:40:32 +00:00
|
|
|
/*! \brief RTCP quality report storage */
|
2007-03-26 17:51:27 +00:00
|
|
|
struct ast_rtp_quality {
|
2007-04-16 15:40:32 +00:00
|
|
|
unsigned int local_ssrc; /*!< Our SSRC */
|
|
|
|
|
unsigned int local_lostpackets; /*!< Our lost packets */
|
|
|
|
|
double local_jitter; /*!< Our calculated jitter */
|
|
|
|
|
unsigned int local_count; /*!< Number of received packets */
|
|
|
|
|
unsigned int remote_ssrc; /*!< Their SSRC */
|
|
|
|
|
unsigned int remote_lostpackets; /*!< Their lost packets */
|
|
|
|
|
double remote_jitter; /*!< Their reported jitter */
|
|
|
|
|
unsigned int remote_count; /*!< Number of transmitted packets */
|
|
|
|
|
double rtt; /*!< Round trip time */
|
2007-03-26 17:51:27 +00:00
|
|
|
};
|
2006-06-06 16:09:33 +00:00
|
|
|
|
2006-12-05 20:39:13 +00:00
|
|
|
/*! RTP callback structure */
|
2006-06-05 09:42:28 +00:00
|
|
|
typedef int (*ast_rtp_callback)(struct ast_rtp *rtp, struct ast_frame *f, void *data);
|
|
|
|
|
|
2006-06-08 23:10:45 +00:00
|
|
|
/*!
|
|
|
|
|
* \brief Get the amount of space required to hold an RTP session
|
|
|
|
|
* \return number of bytes required
|
|
|
|
|
*/
|
|
|
|
|
size_t ast_rtp_alloc_size(void);
|
2002-06-16 16:06:38 +00:00
|
|
|
|
2005-10-12 20:45:18 +00:00
|
|
|
/*!
|
|
|
|
|
* \brief Initializate a RTP session.
|
2006-03-31 10:29:50 +00:00
|
|
|
*
|
2005-10-12 20:45:18 +00:00
|
|
|
* \param sched
|
|
|
|
|
* \param io
|
|
|
|
|
* \param rtcpenable
|
|
|
|
|
* \param callbackmode
|
|
|
|
|
* \returns A representation (structure) of an RTP session.
|
|
|
|
|
*/
|
2003-06-28 16:40:02 +00:00
|
|
|
struct ast_rtp *ast_rtp_new(struct sched_context *sched, struct io_context *io, int rtcpenable, int callbackmode);
|
2002-06-16 16:06:38 +00:00
|
|
|
|
2005-10-12 20:45:18 +00:00
|
|
|
/*!
|
|
|
|
|
* \brief Initializate a RTP session using an in_addr structure.
|
2006-03-31 10:29:50 +00:00
|
|
|
*
|
2005-10-12 20:45:18 +00:00
|
|
|
* This fuction gets called by ast_rtp_new().
|
2006-03-31 10:29:50 +00:00
|
|
|
*
|
2005-10-12 20:45:18 +00:00
|
|
|
* \param sched
|
|
|
|
|
* \param io
|
|
|
|
|
* \param rtcpenable
|
|
|
|
|
* \param callbackmode
|
|
|
|
|
* \param in
|
|
|
|
|
* \returns A representation (structure) of an RTP session.
|
|
|
|
|
*/
|
2004-07-08 11:46:15 +00:00
|
|
|
struct ast_rtp *ast_rtp_new_with_bindaddr(struct sched_context *sched, struct io_context *io, int rtcpenable, int callbackmode, struct in_addr in);
|
|
|
|
|
|
2002-06-16 16:06:38 +00:00
|
|
|
void ast_rtp_set_peer(struct ast_rtp *rtp, struct sockaddr_in *them);
|
|
|
|
|
|
2006-05-09 11:44:50 +00:00
|
|
|
/* Copies from rtp to them and returns 1 if there was a change or 0 if it was already the same */
|
|
|
|
|
int ast_rtp_get_peer(struct ast_rtp *rtp, struct sockaddr_in *them);
|
2003-01-17 19:50:12 +00:00
|
|
|
|
2002-06-16 16:06:38 +00:00
|
|
|
void ast_rtp_get_us(struct ast_rtp *rtp, struct sockaddr_in *us);
|
|
|
|
|
|
2006-08-30 03:16:03 +00:00
|
|
|
struct ast_rtp *ast_rtp_get_bridged(struct ast_rtp *rtp);
|
|
|
|
|
|
2006-12-05 20:39:13 +00:00
|
|
|
/*! Destroy RTP session */
|
2002-06-16 16:06:38 +00:00
|
|
|
void ast_rtp_destroy(struct ast_rtp *rtp);
|
|
|
|
|
|
2004-12-28 16:35:31 +00:00
|
|
|
void ast_rtp_reset(struct ast_rtp *rtp);
|
|
|
|
|
|
2006-12-05 20:39:13 +00:00
|
|
|
/*! Stop RTP session, do not destroy structure */
|
|
|
|
|
void ast_rtp_stop(struct ast_rtp *rtp);
|
2006-05-11 14:56:52 +00:00
|
|
|
|
2002-06-16 16:06:38 +00:00
|
|
|
void ast_rtp_set_callback(struct ast_rtp *rtp, ast_rtp_callback callback);
|
|
|
|
|
|
|
|
|
|
void ast_rtp_set_data(struct ast_rtp *rtp, void *data);
|
|
|
|
|
|
|
|
|
|
int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *f);
|
|
|
|
|
|
2003-02-12 13:59:15 +00:00
|
|
|
struct ast_frame *ast_rtp_read(struct ast_rtp *rtp);
|
|
|
|
|
|
2003-06-28 16:40:02 +00:00
|
|
|
struct ast_frame *ast_rtcp_read(struct ast_rtp *rtp);
|
|
|
|
|
|
2003-02-12 13:59:15 +00:00
|
|
|
int ast_rtp_fd(struct ast_rtp *rtp);
|
|
|
|
|
|
2003-06-28 16:40:02 +00:00
|
|
|
int ast_rtcp_fd(struct ast_rtp *rtp);
|
|
|
|
|
|
2006-08-31 01:59:02 +00:00
|
|
|
int ast_rtp_senddigit_begin(struct ast_rtp *rtp, char digit);
|
|
|
|
|
|
|
|
|
|
int ast_rtp_senddigit_end(struct ast_rtp *rtp, char digit);
|
2003-01-17 19:50:12 +00:00
|
|
|
|
2005-01-07 07:11:40 +00:00
|
|
|
int ast_rtp_sendcng(struct ast_rtp *rtp, int level);
|
|
|
|
|
|
2007-12-16 10:51:53 +00:00
|
|
|
int ast_rtp_setqos(struct ast_rtp *rtp, int tos, int cos, char *desc);
|
2003-01-17 19:50:12 +00:00
|
|
|
|
2008-03-04 18:08:42 +00:00
|
|
|
void ast_rtp_new_source(struct ast_rtp *rtp);
|
|
|
|
|
|
2006-01-03 09:30:19 +00:00
|
|
|
/*! \brief Setting RTP payload types from lines in a SDP description: */
|
2003-03-13 06:00:20 +00:00
|
|
|
void ast_rtp_pt_clear(struct ast_rtp* rtp);
|
2006-01-03 09:30:19 +00:00
|
|
|
/*! \brief Set payload types to defaults */
|
2003-03-13 06:00:20 +00:00
|
|
|
void ast_rtp_pt_default(struct ast_rtp* rtp);
|
2006-06-08 23:10:45 +00:00
|
|
|
|
|
|
|
|
/*! \brief Copy payload types between RTP structures */
|
2006-12-14 17:39:16 +00:00
|
|
|
void ast_rtp_pt_copy(struct ast_rtp *dest, struct ast_rtp *src);
|
2006-06-08 23:10:45 +00:00
|
|
|
|
2007-11-27 19:24:17 +00:00
|
|
|
/*! \brief Activate payload type */
|
2003-03-13 06:00:20 +00:00
|
|
|
void ast_rtp_set_m_type(struct ast_rtp* rtp, int pt);
|
2007-11-27 19:24:17 +00:00
|
|
|
|
|
|
|
|
/*! \brief clear payload type */
|
|
|
|
|
void ast_rtp_unset_m_type(struct ast_rtp* rtp, int pt);
|
|
|
|
|
|
|
|
|
|
/*! \brief Initiate payload type to a known MIME media type for a codec */
|
|
|
|
|
int ast_rtp_set_rtpmap_type(struct ast_rtp* rtp, int pt,
|
2006-07-13 01:38:47 +00:00
|
|
|
char *mimeType, char *mimeSubtype,
|
|
|
|
|
enum ast_rtp_options options);
|
2003-03-07 06:00:13 +00:00
|
|
|
|
2006-01-03 09:30:19 +00:00
|
|
|
/*! \brief Mapping between RTP payload format codes and Asterisk codes: */
|
2003-03-13 06:00:20 +00:00
|
|
|
struct rtpPayloadType ast_rtp_lookup_pt(struct ast_rtp* rtp, int pt);
|
|
|
|
|
int ast_rtp_lookup_code(struct ast_rtp* rtp, int isAstFormat, int code);
|
2002-06-16 16:06:38 +00:00
|
|
|
|
2003-03-13 06:00:20 +00:00
|
|
|
void ast_rtp_get_current_formats(struct ast_rtp* rtp,
|
2003-03-12 06:00:18 +00:00
|
|
|
int* astFormats, int* nonAstFormats);
|
2002-06-16 16:06:38 +00:00
|
|
|
|
2006-01-03 09:30:19 +00:00
|
|
|
/*! \brief Mapping an Asterisk code into a MIME subtype (string): */
|
2006-07-13 01:38:47 +00:00
|
|
|
const char *ast_rtp_lookup_mime_subtype(int isAstFormat, int code,
|
|
|
|
|
enum ast_rtp_options options);
|
2003-03-12 06:00:18 +00:00
|
|
|
|
2006-01-03 09:30:19 +00:00
|
|
|
/*! \brief Build a string of MIME subtype names from a capability list */
|
2006-07-13 01:38:47 +00:00
|
|
|
char *ast_rtp_lookup_mime_multiple(char *buf, size_t size, const int capability,
|
|
|
|
|
const int isAstFormat, enum ast_rtp_options options);
|
2005-04-05 23:34:56 +00:00
|
|
|
|
2003-03-12 06:00:18 +00:00
|
|
|
void ast_rtp_setnat(struct ast_rtp *rtp, int nat);
|
2002-06-16 16:06:38 +00:00
|
|
|
|
2007-01-11 05:21:03 +00:00
|
|
|
int ast_rtp_getnat(struct ast_rtp *rtp);
|
|
|
|
|
|
2006-05-16 22:11:02 +00:00
|
|
|
/*! \brief Indicate whether this RTP session is carrying DTMF or not */
|
|
|
|
|
void ast_rtp_setdtmf(struct ast_rtp *rtp, int dtmf);
|
|
|
|
|
|
2006-08-31 01:59:02 +00:00
|
|
|
/*! \brief Compensate for devices that send RFC2833 packets all at once */
|
|
|
|
|
void ast_rtp_setdtmfcompensate(struct ast_rtp *rtp, int compensate);
|
|
|
|
|
|
2006-11-30 21:22:01 +00:00
|
|
|
/*! \brief Enable STUN capability */
|
|
|
|
|
void ast_rtp_setstun(struct ast_rtp *rtp, int stun_enable);
|
|
|
|
|
|
Small improvement to the STUN support so it can be used by
sockets other than RTP ones.
The main change is a new API function in main/rtp.c (see there
for a description)
int ast_stun_request(int s, struct sockaddr_in *dst,
const char *username, struct sockaddr_in *answer)
which can be used to send an STUN request on a socket, and
optionally wait for a reply and store the STUN_MAPPED_ADDRESS
into the 'answer' argument (obviously, the version that
waits for a reply is blocking, but this is no different
from DNS resolutions).
Internally there are minor modifications to let stun_handle_packet()
be somewhat configurable on how to parse the body of responses.
At the moment i am not committing any change to the clients,
but adding STUN client support is extremely simple, e.g. chan_sip.c
could do something like this:
+ add a variable to store the stun server address;
static struct sockaddr_in stunaddr = { 0, }; /*!< stun server address */
+ add code to parse a config file of the form "stunaddr=my.stun.server.org:3478"
(not shown for brevity);
+ right after binding the main sip socket, talk to the stun server to
determine the externally visible address
if (stunaddr.sin_addr.s_addr != 0)
ast_stun_request(sipsock, &stunaddr, NULL, &externip);
so now 'externip' is set with the externally visible address.
so it is really trivial.
Similarly ast_stun_request could be called when creating the RTP
socket (possibly adding a struct sockaddr_in field in the struct
ast_rtp to store the externalip).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75034 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-13 16:22:09 +00:00
|
|
|
/*! \brief Generic STUN request
|
|
|
|
|
* send a generic stun request to the server specified.
|
|
|
|
|
* \param s the socket used to send the request
|
|
|
|
|
* \param dst the address of the STUN server
|
|
|
|
|
* \param username if non null, add the username in the request
|
|
|
|
|
* \param answer if non null, the function waits for a response and
|
|
|
|
|
* puts here the externally visible address.
|
|
|
|
|
* \return 0 on success, other values on error.
|
|
|
|
|
* The interface it may change in the future.
|
|
|
|
|
*/
|
|
|
|
|
int ast_stun_request(int s, struct sockaddr_in *dst,
|
|
|
|
|
const char *username, struct sockaddr_in *answer);
|
|
|
|
|
|
|
|
|
|
/*! \brief Send STUN request for an RTP socket
|
|
|
|
|
* Deprecated, this is just a wrapper for ast_rtp_stun_request()
|
|
|
|
|
*/
|
2006-12-05 20:39:13 +00:00
|
|
|
void ast_rtp_stun_request(struct ast_rtp *rtp, struct sockaddr_in *suggestion, const char *username);
|
|
|
|
|
|
|
|
|
|
/*! \brief The RTP bridge.
|
|
|
|
|
\arg \ref AstRTPbridge
|
|
|
|
|
*/
|
2005-10-13 18:27:54 +00:00
|
|
|
int ast_rtp_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms);
|
2003-02-16 06:00:12 +00:00
|
|
|
|
2006-12-05 20:39:13 +00:00
|
|
|
/*! \brief Register an RTP channel client */
|
2003-02-16 06:00:12 +00:00
|
|
|
int ast_rtp_proto_register(struct ast_rtp_protocol *proto);
|
|
|
|
|
|
2006-12-05 20:39:13 +00:00
|
|
|
/*! \brief Unregister an RTP channel client */
|
2003-02-16 06:00:12 +00:00
|
|
|
void ast_rtp_proto_unregister(struct ast_rtp_protocol *proto);
|
|
|
|
|
|
2006-05-09 11:44:50 +00:00
|
|
|
int ast_rtp_make_compatible(struct ast_channel *dest, struct ast_channel *src, int media);
|
|
|
|
|
|
2006-06-09 09:47:44 +00:00
|
|
|
/*! \brief If possible, create an early bridge directly between the devices without
|
|
|
|
|
having to send a re-invite later */
|
2006-09-21 19:27:26 +00:00
|
|
|
int ast_rtp_early_bridge(struct ast_channel *c0, struct ast_channel *c1);
|
2005-12-20 17:52:31 +00:00
|
|
|
|
This patch adds more detailed statistics for RTP channels, and provides an API call to access it, including maximums, minimums, standard deviatinos,
and normal deviations. Currently this is implemented for chan_sip, but could be added to the func_channel_read callbacks for the CHANNEL function
for any channel that uses RTP.
(closes issue #10590)
Reported by: gasparz
Patches:
chan_sip_c.diff uploaded by gasparz (license 219)
rtp_c.diff uploaded by gasparz (license 219)
rtp_h.diff uploaded by gasparz (license 219)
audioqos-trunk.diff uploaded by snuffy (license 35)
rtpqos-trunk-r119891.diff uploaded by sergee (license 138)
Tested by: jsmith, gasparz, snuffy, marsosa, chappell, sergee
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05 16:24:19 +00:00
|
|
|
/*! \brief Get QOS stats on a RTP channel */
|
|
|
|
|
int ast_rtp_get_qos(struct ast_rtp *rtp, const char *qos, char *buf, unsigned int buflen);
|
2008-07-05 19:27:42 +00:00
|
|
|
|
|
|
|
|
/*! \brief Return RTP and RTCP QoS values */
|
|
|
|
|
unsigned int ast_rtp_get_qosvalue(struct ast_rtp *rtp, enum ast_rtp_qos_vars value);
|
|
|
|
|
|
This patch adds more detailed statistics for RTP channels, and provides an API call to access it, including maximums, minimums, standard deviatinos,
and normal deviations. Currently this is implemented for chan_sip, but could be added to the func_channel_read callbacks for the CHANNEL function
for any channel that uses RTP.
(closes issue #10590)
Reported by: gasparz
Patches:
chan_sip_c.diff uploaded by gasparz (license 219)
rtp_c.diff uploaded by gasparz (license 219)
rtp_h.diff uploaded by gasparz (license 219)
audioqos-trunk.diff uploaded by snuffy (license 35)
rtpqos-trunk-r119891.diff uploaded by sergee (license 138)
Tested by: jsmith, gasparz, snuffy, marsosa, chappell, sergee
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05 16:24:19 +00:00
|
|
|
/*! \brief Set RTPAUDIOQOS(...) variables on a channel when it is being hung up */
|
|
|
|
|
void ast_rtp_set_vars(struct ast_channel *chan, struct ast_rtp *rtp);
|
2006-06-05 08:39:42 +00:00
|
|
|
|
This patch adds more detailed statistics for RTP channels, and provides an API call to access it, including maximums, minimums, standard deviatinos,
and normal deviations. Currently this is implemented for chan_sip, but could be added to the func_channel_read callbacks for the CHANNEL function
for any channel that uses RTP.
(closes issue #10590)
Reported by: gasparz
Patches:
chan_sip_c.diff uploaded by gasparz (license 219)
rtp_c.diff uploaded by gasparz (license 219)
rtp_h.diff uploaded by gasparz (license 219)
audioqos-trunk.diff uploaded by snuffy (license 35)
rtpqos-trunk-r119891.diff uploaded by sergee (license 138)
Tested by: jsmith, gasparz, snuffy, marsosa, chappell, sergee
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05 16:24:19 +00:00
|
|
|
/*! \brief Return RTCP quality string
|
|
|
|
|
*
|
|
|
|
|
* \param rtp An rtp structure to get qos information about.
|
|
|
|
|
*
|
|
|
|
|
* \param qual An (optional) rtp quality structure that will be
|
|
|
|
|
* filled with the quality information described in
|
|
|
|
|
* the ast_rtp_quality structure. This structure is
|
|
|
|
|
* not dependent on any qtype, so a call for any
|
|
|
|
|
* type of information would yield the same results
|
|
|
|
|
* because ast_rtp_quality is not a data type
|
|
|
|
|
* specific to any qos type.
|
|
|
|
|
*
|
|
|
|
|
* \param qtype The quality type you'd like, default should be
|
|
|
|
|
* RTPQOS_SUMMARY which returns basic information
|
|
|
|
|
* about the call. The return from RTPQOS_SUMMARY
|
|
|
|
|
* is basically ast_rtp_quality in a string. The
|
|
|
|
|
* other types are RTPQOS_JITTER, RTPQOS_LOSS and
|
|
|
|
|
* RTPQOS_RTT which will return more specific
|
|
|
|
|
* statistics.
|
|
|
|
|
*/
|
|
|
|
|
char *ast_rtp_get_quality(struct ast_rtp *rtp, struct ast_rtp_quality *qual, enum ast_rtp_quality_type qtype);
|
2006-06-05 08:39:42 +00:00
|
|
|
/*! \brief Send an H.261 fast update request. Some devices need this rather than the XML message in SIP */
|
|
|
|
|
int ast_rtcp_send_h261fur(void *data);
|
|
|
|
|
|
2006-12-05 20:39:13 +00:00
|
|
|
void ast_rtp_init(void); /*! Initialize RTP subsystem */
|
|
|
|
|
int ast_rtp_reload(void); /*! reload rtp configuration */
|
2006-12-26 04:34:07 +00:00
|
|
|
void ast_rtp_new_init(struct ast_rtp *rtp);
|
2003-05-16 02:50:46 +00:00
|
|
|
|
2008-01-30 16:39:14 +00:00
|
|
|
/*! \brief Set codec preference */
|
|
|
|
|
void ast_rtp_codec_setpref(struct ast_rtp *rtp, struct ast_codec_pref *prefs);
|
2006-09-18 23:32:57 +00:00
|
|
|
|
2008-01-30 16:39:14 +00:00
|
|
|
/*! \brief Get codec preference */
|
2006-09-18 23:32:57 +00:00
|
|
|
struct ast_codec_pref *ast_rtp_codec_getpref(struct ast_rtp *rtp);
|
|
|
|
|
|
2008-01-30 16:39:14 +00:00
|
|
|
/*! \brief get format from predefined dynamic payload format */
|
2006-09-18 23:32:57 +00:00
|
|
|
int ast_rtp_codec_getformat(int pt);
|
|
|
|
|
|
2006-12-02 12:05:40 +00:00
|
|
|
/*! \brief Set rtp timeout */
|
|
|
|
|
void ast_rtp_set_rtptimeout(struct ast_rtp *rtp, int timeout);
|
|
|
|
|
/*! \brief Set rtp hold timeout */
|
|
|
|
|
void ast_rtp_set_rtpholdtimeout(struct ast_rtp *rtp, int timeout);
|
|
|
|
|
/*! \brief set RTP keepalive interval */
|
|
|
|
|
void ast_rtp_set_rtpkeepalive(struct ast_rtp *rtp, int period);
|
|
|
|
|
/*! \brief Get RTP keepalive interval */
|
|
|
|
|
int ast_rtp_get_rtpkeepalive(struct ast_rtp *rtp);
|
|
|
|
|
/*! \brief Get rtp hold timeout */
|
|
|
|
|
int ast_rtp_get_rtpholdtimeout(struct ast_rtp *rtp);
|
|
|
|
|
/*! \brief Get rtp timeout */
|
|
|
|
|
int ast_rtp_get_rtptimeout(struct ast_rtp *rtp);
|
|
|
|
|
/* \brief Put RTP timeout timers on hold during another transaction, like T.38 */
|
|
|
|
|
void ast_rtp_set_rtptimers_onhold(struct ast_rtp *rtp);
|
|
|
|
|
|
2008-05-14 13:37:07 +00:00
|
|
|
/*! \brief Initalize t.140 redudancy
|
|
|
|
|
* \param ti time between each t140red frame is sent
|
|
|
|
|
* \param red_pt payloadtype for RTP packet
|
|
|
|
|
* \param pt payloadtype numbers for each generation including primary data
|
|
|
|
|
* \param num_gen number of redundant generations, primary data excluded
|
|
|
|
|
*/
|
|
|
|
|
int rtp_red_init(struct ast_rtp *rtp, int ti, int *pt, int num_gen);
|
|
|
|
|
|
|
|
|
|
void red_init(struct rtp_red *red, const struct ast_frame *f);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief Buffer t.140 data */
|
|
|
|
|
void red_buffer_t140(struct ast_rtp *rtp, struct ast_frame *f);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-06-16 16:06:38 +00:00
|
|
|
#if defined(__cplusplus) || defined(c_plusplus)
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-08-30 18:32:10 +00:00
|
|
|
#endif /* _ASTERISK_RTP_H */
|