Merged revisions 323370 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r323370 | twilson | 2011-06-14 09:33:55 -0700 (Tue, 14 Jun 2011) | 10 lines
  
  Add rtpkeepalives back to 1.8
  
  The RTP-engine conversion left out support for handling rtpkeepalives.
  This patch adds them back.
  
  (closes issue ASTERISK-17304)
  Reported by: lmadsen
  
  Review: https://reviewboard.asterisk.org/r/1226/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@323374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Terry Wilson
2011-06-14 17:03:37 +00:00
parent 00181729b4
commit abd7ef817e
4 changed files with 131 additions and 1 deletions

View File

@@ -377,6 +377,8 @@ struct ast_rtp_engine {
void (*stun_request)(struct ast_rtp_instance *instance, struct ast_sockaddr *suggestion, const char *username);
/*! Callback to get the transcodeable formats supported. result returned in ast_format_cap *result */
void (*available_formats)(struct ast_rtp_instance *instance, struct ast_format_cap *to_endpoint, struct ast_format_cap *to_asterisk, struct ast_format_cap *result);
/*! Callback to send CNG */
int (*sendcng)(struct ast_rtp_instance *instance, int level);
/*! Linked list information */
AST_RWLIST_ENTRY(ast_rtp_engine) entry;
};
@@ -1712,6 +1714,24 @@ void ast_rtp_instance_set_timeout(struct ast_rtp_instance *instance, int timeout
*/
void ast_rtp_instance_set_hold_timeout(struct ast_rtp_instance *instance, int timeout);
/*!
* \brief Set the RTP keepalive interval
*
* \param instance The RTP instance
* \param period Value to set the keepalive interval to
*
* Example usage:
*
* \code
* ast_rtp_instance_set_keepalive(instance, 5000);
* \endcode
*
* This sets the RTP keepalive interval on 'instance' to be 5000.
*
* \since 1.8
*/
void ast_rtp_instance_set_keepalive(struct ast_rtp_instance *instance, int timeout);
/*!
* \brief Get the RTP timeout value
*
@@ -1750,6 +1770,25 @@ int ast_rtp_instance_get_timeout(struct ast_rtp_instance *instance);
*/
int ast_rtp_instance_get_hold_timeout(struct ast_rtp_instance *instance);
/*!
* \brief Get the RTP keepalive interval
*
* \param instance The RTP instance
*
* \retval period Keepalive interval value
*
* Example usage:
*
* \code
* int interval = ast_rtp_instance_get_keepalive(instance);
* \endcode
*
* This gets the RTP keepalive interval value for the RTP instance pointed to by 'instance'.
*
* \since 1.8
*/
int ast_rtp_instance_get_keepalive(struct ast_rtp_instance *instance);
/*!
* \brief Get the RTP engine in use on an RTP instance
*
@@ -1809,6 +1848,17 @@ struct ast_rtp_glue *ast_rtp_instance_get_active_glue(struct ast_rtp_instance *i
*/
struct ast_channel *ast_rtp_instance_get_chan(struct ast_rtp_instance *instance);
/*!
* \brief Send a comfort noise packet to the RTP instance
*
* \param instance The RTP instance
* \param level Magnitude of the noise level
*
* \retval 0 Success
* \retval non-zero Failure
*/
int ast_rtp_instance_sendcng(struct ast_rtp_instance *instance, int level);
int ast_rtp_instance_add_srtp_policy(struct ast_rtp_instance *instance, struct ast_srtp_policy *policy);
struct ast_srtp *ast_rtp_instance_get_srtp(struct ast_rtp_instance *instance);