00001 /* 00002 * Asterisk -- An open source telephony toolkit. 00003 * 00004 * Copyright (C) 1999 - 2009, Digium, Inc. 00005 * 00006 * Mark Spencer <markster@digium.com> 00007 * Joshua Colp <jcolp@digium.com> 00008 * 00009 * See http://www.asterisk.org for more information about 00010 * the Asterisk project. Please do not directly contact 00011 * any of the maintainers of this project for assistance; 00012 * the project provides a web site, mailing lists and IRC 00013 * channels for your use. 00014 * 00015 * This program is free software, distributed under the terms of 00016 * the GNU General Public License Version 2. See the LICENSE file 00017 * at the top of the source tree. 00018 */ 00019 00020 /*! \file 00021 * \brief Pluggable RTP Architecture 00022 * \author Joshua Colp <jcolp@digium.com> 00023 * \ref AstRTPEngine 00024 */ 00025 00026 /*! 00027 * \page AstRTPEngine Asterisk RTP Engine API 00028 * 00029 * The purpose of this API is to provide a way for multiple RTP stacks to be 00030 * used inside of Asterisk without any module that uses RTP knowing any 00031 * different. To the module each RTP stack behaves the same. 00032 * 00033 * An RTP session is called an instance and is made up of a combination of codec 00034 * information, RTP engine, RTP properties, and address information. An engine 00035 * name may be passed in to explicitly choose an RTP stack to be used but a 00036 * default one will be used if none is provided. An address to use for RTP may 00037 * also be provided but the underlying RTP engine may choose a different address 00038 * depending on it's configuration. 00039 * 00040 * An RTP engine is the layer between the RTP engine core and the RTP stack 00041 * itself. The RTP engine core provides a set of callbacks to do various things 00042 * (such as write audio out) that the RTP engine has to have implemented. 00043 * 00044 * Glue is what binds an RTP instance to a channel. It is used to retrieve RTP 00045 * instance information when performing remote or local bridging and is used to 00046 * have the channel driver tell the remote side to change destination of the RTP 00047 * stream. 00048 * 00049 * Statistics from an RTP instance can be retrieved using the 00050 * ast_rtp_instance_get_stats API call. This essentially asks the RTP engine in 00051 * use to fill in a structure with the requested values. It is not required for 00052 * an RTP engine to support all statistic values. 00053 * 00054 * Properties allow behavior of the RTP engine and RTP engine core to be 00055 * changed. For example, there is a property named AST_RTP_PROPERTY_NAT which is 00056 * used to tell the RTP engine to enable symmetric RTP if it supports it. It is 00057 * not required for an RTP engine to support all properties. 00058 * 00059 * Codec information is stored using a separate data structure which has it's 00060 * own set of API calls to add/remove/retrieve information. They are used by the 00061 * module after an RTP instance is created so that payload information is 00062 * available for the RTP engine. 00063 */ 00064 00065 #ifndef _ASTERISK_RTP_ENGINE_H 00066 #define _ASTERISK_RTP_ENGINE_H 00067 00068 #if defined(__cplusplus) || defined(c_plusplus) 00069 extern "C" { 00070 #endif 00071 00072 #include "asterisk/astobj2.h" 00073 #include "asterisk/frame.h" 00074 #include "asterisk/netsock2.h" 00075 #include "asterisk/sched.h" 00076 #include "asterisk/res_srtp.h" 00077 00078 /* Maximum number of payloads supported */ 00079 #define AST_RTP_MAX_PT 256 00080 00081 /* Maximum number of generations */ 00082 #define AST_RED_MAX_GENERATION 5 00083 00084 struct ast_rtp_instance; 00085 struct ast_rtp_glue; 00086 00087 /*! RTP Properties that can be set on an RTP instance */ 00088 enum ast_rtp_property { 00089 /*! Enable symmetric RTP support */ 00090 AST_RTP_PROPERTY_NAT = 0, 00091 /*! RTP instance will be carrying DTMF (using RFC2833) */ 00092 AST_RTP_PROPERTY_DTMF, 00093 /*! Expect unreliable DTMF from remote party */ 00094 AST_RTP_PROPERTY_DTMF_COMPENSATE, 00095 /*! Enable STUN support */ 00096 AST_RTP_PROPERTY_STUN, 00097 /*! Enable RTCP support */ 00098 AST_RTP_PROPERTY_RTCP, 00099 00100 /*! 00101 * \brief Maximum number of RTP properties supported 00102 * 00103 * \note THIS MUST BE THE LAST ENTRY IN THIS ENUM. 00104 */ 00105 AST_RTP_PROPERTY_MAX, 00106 }; 00107 00108 /*! Additional RTP options */ 00109 enum ast_rtp_options { 00110 /*! Remote side is using non-standard G.726 */ 00111 AST_RTP_OPT_G726_NONSTANDARD = (1 << 0), 00112 }; 00113 00114 /*! RTP DTMF Modes */ 00115 enum ast_rtp_dtmf_mode { 00116 /*! No DTMF is being carried over the RTP stream */ 00117 AST_RTP_DTMF_MODE_NONE = 0, 00118 /*! DTMF is being carried out of band using RFC2833 */ 00119 AST_RTP_DTMF_MODE_RFC2833, 00120 /*! DTMF is being carried inband over the RTP stream */ 00121 AST_RTP_DTMF_MODE_INBAND, 00122 }; 00123 00124 /*! Result codes when RTP glue is queried for information */ 00125 enum ast_rtp_glue_result { 00126 /*! No remote or local bridging is permitted */ 00127 AST_RTP_GLUE_RESULT_FORBID = 0, 00128 /*! Move RTP stream to be remote between devices directly */ 00129 AST_RTP_GLUE_RESULT_REMOTE, 00130 /*! Perform RTP engine level bridging if possible */ 00131 AST_RTP_GLUE_RESULT_LOCAL, 00132 }; 00133 00134 /*! Field statistics that can be retrieved from an RTP instance */ 00135 enum ast_rtp_instance_stat_field { 00136 /*! Retrieve quality information */ 00137 AST_RTP_INSTANCE_STAT_FIELD_QUALITY = 0, 00138 /*! Retrieve quality information about jitter */ 00139 AST_RTP_INSTANCE_STAT_FIELD_QUALITY_JITTER, 00140 /*! Retrieve quality information about packet loss */ 00141 AST_RTP_INSTANCE_STAT_FIELD_QUALITY_LOSS, 00142 /*! Retrieve quality information about round trip time */ 00143 AST_RTP_INSTANCE_STAT_FIELD_QUALITY_RTT, 00144 }; 00145 00146 /*! Statistics that can be retrieved from an RTP instance */ 00147 enum ast_rtp_instance_stat { 00148 /*! Retrieve all statistics */ 00149 AST_RTP_INSTANCE_STAT_ALL = 0, 00150 /*! Retrieve number of packets transmitted */ 00151 AST_RTP_INSTANCE_STAT_TXCOUNT, 00152 /*! Retrieve number of packets received */ 00153 AST_RTP_INSTANCE_STAT_RXCOUNT, 00154 /*! Retrieve ALL statistics relating to packet loss */ 00155 AST_RTP_INSTANCE_STAT_COMBINED_LOSS, 00156 /*! Retrieve number of packets lost for transmitting */ 00157 AST_RTP_INSTANCE_STAT_TXPLOSS, 00158 /*! Retrieve number of packets lost for receiving */ 00159 AST_RTP_INSTANCE_STAT_RXPLOSS, 00160 /*! Retrieve maximum number of packets lost on remote side */ 00161 AST_RTP_INSTANCE_STAT_REMOTE_MAXRXPLOSS, 00162 /*! Retrieve minimum number of packets lost on remote side */ 00163 AST_RTP_INSTANCE_STAT_REMOTE_MINRXPLOSS, 00164 /*! Retrieve average number of packets lost on remote side */ 00165 AST_RTP_INSTANCE_STAT_REMOTE_NORMDEVRXPLOSS, 00166 /*! Retrieve standard deviation of packets lost on remote side */ 00167 AST_RTP_INSTANCE_STAT_REMOTE_STDEVRXPLOSS, 00168 /*! Retrieve maximum number of packets lost on local side */ 00169 AST_RTP_INSTANCE_STAT_LOCAL_MAXRXPLOSS, 00170 /*! Retrieve minimum number of packets lost on local side */ 00171 AST_RTP_INSTANCE_STAT_LOCAL_MINRXPLOSS, 00172 /*! Retrieve average number of packets lost on local side */ 00173 AST_RTP_INSTANCE_STAT_LOCAL_NORMDEVRXPLOSS, 00174 /*! Retrieve standard deviation of packets lost on local side */ 00175 AST_RTP_INSTANCE_STAT_LOCAL_STDEVRXPLOSS, 00176 /*! Retrieve ALL statistics relating to jitter */ 00177 AST_RTP_INSTANCE_STAT_COMBINED_JITTER, 00178 /*! Retrieve jitter on transmitted packets */ 00179 AST_RTP_INSTANCE_STAT_TXJITTER, 00180 /*! Retrieve jitter on received packets */ 00181 AST_RTP_INSTANCE_STAT_RXJITTER, 00182 /*! Retrieve maximum jitter on remote side */ 00183 AST_RTP_INSTANCE_STAT_REMOTE_MAXJITTER, 00184 /*! Retrieve minimum jitter on remote side */ 00185 AST_RTP_INSTANCE_STAT_REMOTE_MINJITTER, 00186 /*! Retrieve average jitter on remote side */ 00187 AST_RTP_INSTANCE_STAT_REMOTE_NORMDEVJITTER, 00188 /*! Retrieve standard deviation jitter on remote side */ 00189 AST_RTP_INSTANCE_STAT_REMOTE_STDEVJITTER, 00190 /*! Retrieve maximum jitter on local side */ 00191 AST_RTP_INSTANCE_STAT_LOCAL_MAXJITTER, 00192 /*! Retrieve minimum jitter on local side */ 00193 AST_RTP_INSTANCE_STAT_LOCAL_MINJITTER, 00194 /*! Retrieve average jitter on local side */ 00195 AST_RTP_INSTANCE_STAT_LOCAL_NORMDEVJITTER, 00196 /*! Retrieve standard deviation jitter on local side */ 00197 AST_RTP_INSTANCE_STAT_LOCAL_STDEVJITTER, 00198 /*! Retrieve ALL statistics relating to round trip time */ 00199 AST_RTP_INSTANCE_STAT_COMBINED_RTT, 00200 /*! Retrieve round trip time */ 00201 AST_RTP_INSTANCE_STAT_RTT, 00202 /*! Retrieve maximum round trip time */ 00203 AST_RTP_INSTANCE_STAT_MAX_RTT, 00204 /*! Retrieve minimum round trip time */ 00205 AST_RTP_INSTANCE_STAT_MIN_RTT, 00206 /*! Retrieve average round trip time */ 00207 AST_RTP_INSTANCE_STAT_NORMDEVRTT, 00208 /*! Retrieve standard deviation round trip time */ 00209 AST_RTP_INSTANCE_STAT_STDEVRTT, 00210 /*! Retrieve local SSRC */ 00211 AST_RTP_INSTANCE_STAT_LOCAL_SSRC, 00212 /*! Retrieve remote SSRC */ 00213 AST_RTP_INSTANCE_STAT_REMOTE_SSRC, 00214 }; 00215 00216 /* Codes for RTP-specific data - not defined by our AST_FORMAT codes */ 00217 /*! DTMF (RFC2833) */ 00218 #define AST_RTP_DTMF (1 << 0) 00219 /*! 'Comfort Noise' (RFC3389) */ 00220 #define AST_RTP_CN (1 << 1) 00221 /*! DTMF (Cisco Proprietary) */ 00222 #define AST_RTP_CISCO_DTMF (1 << 2) 00223 /*! Maximum RTP-specific code */ 00224 #define AST_RTP_MAX AST_RTP_CISCO_DTMF 00225 00226 /*! Structure that represents a payload */ 00227 struct ast_rtp_payload_type { 00228 /*! Is this an Asterisk value */ 00229 int asterisk_format; 00230 /*! If asterisk_format is set, this is the internal 00231 * asterisk format represented by the payload */ 00232 struct ast_format format; 00233 /*! Actual internal RTP specific value of the payload */ 00234 int rtp_code; 00235 00236 }; 00237 00238 /*! Structure that represents statistics from an RTP instance */ 00239 struct ast_rtp_instance_stats { 00240 /*! Number of packets transmitted */ 00241 unsigned int txcount; 00242 /*! Number of packets received */ 00243 unsigned int rxcount; 00244 /*! Jitter on transmitted packets */ 00245 double txjitter; 00246 /*! Jitter on received packets */ 00247 double rxjitter; 00248 /*! Maximum jitter on remote side */ 00249 double remote_maxjitter; 00250 /*! Minimum jitter on remote side */ 00251 double remote_minjitter; 00252 /*! Average jitter on remote side */ 00253 double remote_normdevjitter; 00254 /*! Standard deviation jitter on remote side */ 00255 double remote_stdevjitter; 00256 /*! Maximum jitter on local side */ 00257 double local_maxjitter; 00258 /*! Minimum jitter on local side */ 00259 double local_minjitter; 00260 /*! Average jitter on local side */ 00261 double local_normdevjitter; 00262 /*! Standard deviation jitter on local side */ 00263 double local_stdevjitter; 00264 /*! Number of transmitted packets lost */ 00265 unsigned int txploss; 00266 /*! Number of received packets lost */ 00267 unsigned int rxploss; 00268 /*! Maximum number of packets lost on remote side */ 00269 double remote_maxrxploss; 00270 /*! Minimum number of packets lost on remote side */ 00271 double remote_minrxploss; 00272 /*! Average number of packets lost on remote side */ 00273 double remote_normdevrxploss; 00274 /*! Standard deviation packets lost on remote side */ 00275 double remote_stdevrxploss; 00276 /*! Maximum number of packets lost on local side */ 00277 double local_maxrxploss; 00278 /*! Minimum number of packets lost on local side */ 00279 double local_minrxploss; 00280 /*! Average number of packets lost on local side */ 00281 double local_normdevrxploss; 00282 /*! Standard deviation packets lost on local side */ 00283 double local_stdevrxploss; 00284 /*! Total round trip time */ 00285 double rtt; 00286 /*! Maximum round trip time */ 00287 double maxrtt; 00288 /*! Minimum round trip time */ 00289 double minrtt; 00290 /*! Average round trip time */ 00291 double normdevrtt; 00292 /*! Standard deviation round trip time */ 00293 double stdevrtt; 00294 /*! Our SSRC */ 00295 unsigned int local_ssrc; 00296 /*! Their SSRC */ 00297 unsigned int remote_ssrc; 00298 }; 00299 00300 #define AST_RTP_STAT_SET(current_stat, combined, placement, value) \ 00301 if (stat == current_stat || stat == AST_RTP_INSTANCE_STAT_ALL || (combined >= 0 && combined == current_stat)) { \ 00302 placement = value; \ 00303 if (stat == current_stat) { \ 00304 return 0; \ 00305 } \ 00306 } 00307 00308 #define AST_RTP_STAT_TERMINATOR(combined) \ 00309 if (stat == combined) { \ 00310 return 0; \ 00311 } 00312 00313 /*! Structure that represents an RTP stack (engine) */ 00314 struct ast_rtp_engine { 00315 /*! Name of the RTP engine, used when explicitly requested */ 00316 const char *name; 00317 /*! Module this RTP engine came from, used for reference counting */ 00318 struct ast_module *mod; 00319 /*! Callback for setting up a new RTP instance */ 00320 int (*new)(struct ast_rtp_instance *instance, struct ast_sched_context *sched, struct ast_sockaddr *sa, void *data); 00321 /*! Callback for destroying an RTP instance */ 00322 int (*destroy)(struct ast_rtp_instance *instance); 00323 /*! Callback for writing out a frame */ 00324 int (*write)(struct ast_rtp_instance *instance, struct ast_frame *frame); 00325 /*! Callback for stopping the RTP instance */ 00326 void (*stop)(struct ast_rtp_instance *instance); 00327 /*! Callback for starting RFC2833 DTMF transmission */ 00328 int (*dtmf_begin)(struct ast_rtp_instance *instance, char digit); 00329 /*! Callback for stopping RFC2833 DTMF transmission */ 00330 int (*dtmf_end)(struct ast_rtp_instance *instance, char digit); 00331 int (*dtmf_end_with_duration)(struct ast_rtp_instance *instance, char digit, unsigned int duration); 00332 /*! Callback to indicate that we should update the marker bit */ 00333 void (*update_source)(struct ast_rtp_instance *instance); 00334 /*! Callback to indicate that we should update the marker bit and ssrc */ 00335 void (*change_source)(struct ast_rtp_instance *instance); 00336 /*! Callback for setting an extended RTP property */ 00337 int (*extended_prop_set)(struct ast_rtp_instance *instance, int property, void *value); 00338 /*! Callback for getting an extended RTP property */ 00339 void *(*extended_prop_get)(struct ast_rtp_instance *instance, int property); 00340 /*! Callback for setting an RTP property */ 00341 void (*prop_set)(struct ast_rtp_instance *instance, enum ast_rtp_property property, int value); 00342 /*! Callback for setting a payload. If asterisk is to be used, asterisk_format will be set, otherwise value in code is used. */ 00343 void (*payload_set)(struct ast_rtp_instance *instance, int payload, int asterisk_format, struct ast_format *format, int code); 00344 /*! Callback for setting packetization preferences */ 00345 void (*packetization_set)(struct ast_rtp_instance *instance, struct ast_codec_pref *pref); 00346 /*! Callback for setting the remote address that RTP is to be sent to */ 00347 void (*remote_address_set)(struct ast_rtp_instance *instance, struct ast_sockaddr *sa); 00348 /*! Callback for setting an alternate remote address */ 00349 void (*alt_remote_address_set)(struct ast_rtp_instance *instance, struct ast_sockaddr *sa); 00350 /*! Callback for changing DTMF mode */ 00351 int (*dtmf_mode_set)(struct ast_rtp_instance *instance, enum ast_rtp_dtmf_mode dtmf_mode); 00352 /*! Callback for getting DTMF mode */ 00353 enum ast_rtp_dtmf_mode (*dtmf_mode_get)(struct ast_rtp_instance *instance); 00354 /*! Callback for retrieving statistics */ 00355 int (*get_stat)(struct ast_rtp_instance *instance, struct ast_rtp_instance_stats *stats, enum ast_rtp_instance_stat stat); 00356 /*! Callback for setting QoS values */ 00357 int (*qos)(struct ast_rtp_instance *instance, int tos, int cos, const char *desc); 00358 /*! Callback for retrieving a file descriptor to poll on, not always required */ 00359 int (*fd)(struct ast_rtp_instance *instance, int rtcp); 00360 /*! Callback for initializing RED support */ 00361 int (*red_init)(struct ast_rtp_instance *instance, int buffer_time, int *payloads, int generations); 00362 /*! Callback for buffering a frame using RED */ 00363 int (*red_buffer)(struct ast_rtp_instance *instance, struct ast_frame *frame); 00364 /*! Callback for reading a frame from the RTP engine */ 00365 struct ast_frame *(*read)(struct ast_rtp_instance *instance, int rtcp); 00366 /*! Callback to locally bridge two RTP instances */ 00367 int (*local_bridge)(struct ast_rtp_instance *instance0, struct ast_rtp_instance *instance1); 00368 /*! Callback to set the read format */ 00369 int (*set_read_format)(struct ast_rtp_instance *instance, struct ast_format *format); 00370 /*! Callback to set the write format */ 00371 int (*set_write_format)(struct ast_rtp_instance *instance, struct ast_format *format); 00372 /*! Callback to make two instances compatible */ 00373 int (*make_compatible)(struct ast_channel *chan0, struct ast_rtp_instance *instance0, struct ast_channel *chan1, struct ast_rtp_instance *instance1); 00374 /*! Callback to see if two instances are compatible with DTMF */ 00375 int (*dtmf_compatible)(struct ast_channel *chan0, struct ast_rtp_instance *instance0, struct ast_channel *chan1, struct ast_rtp_instance *instance1); 00376 /*! Callback to indicate that packets will now flow */ 00377 int (*activate)(struct ast_rtp_instance *instance); 00378 /*! Callback to request that the RTP engine send a STUN BIND request */ 00379 void (*stun_request)(struct ast_rtp_instance *instance, struct ast_sockaddr *suggestion, const char *username); 00380 /*! Callback to get the transcodeable formats supported. result returned in ast_format_cap *result */ 00381 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); 00382 /*! Callback to send CNG */ 00383 int (*sendcng)(struct ast_rtp_instance *instance, int level); 00384 /*! Linked list information */ 00385 AST_RWLIST_ENTRY(ast_rtp_engine) entry; 00386 }; 00387 00388 /*! Structure that represents codec and packetization information */ 00389 struct ast_rtp_codecs { 00390 /*! Codec packetization preferences */ 00391 struct ast_codec_pref pref; 00392 /*! Payloads present */ 00393 struct ast_rtp_payload_type payloads[AST_RTP_MAX_PT]; 00394 }; 00395 00396 /*! Structure that represents the glue that binds an RTP instance to a channel */ 00397 struct ast_rtp_glue { 00398 /*! Name of the channel driver that this glue is responsible for */ 00399 const char *type; 00400 /*! Module that the RTP glue came from */ 00401 struct ast_module *mod; 00402 /*! 00403 * \brief Callback for retrieving the RTP instance carrying audio 00404 * \note This function increases the reference count on the returned RTP instance. 00405 */ 00406 enum ast_rtp_glue_result (*get_rtp_info)(struct ast_channel *chan, struct ast_rtp_instance **instance); 00407 /*! 00408 * \brief Callback for retrieving the RTP instance carrying video 00409 * \note This function increases the reference count on the returned RTP instance. 00410 */ 00411 enum ast_rtp_glue_result (*get_vrtp_info)(struct ast_channel *chan, struct ast_rtp_instance **instance); 00412 /*! 00413 * \brief Callback for retrieving the RTP instance carrying text 00414 * \note This function increases the reference count on the returned RTP instance. 00415 */ 00416 enum ast_rtp_glue_result (*get_trtp_info)(struct ast_channel *chan, struct ast_rtp_instance **instance); 00417 /*! Callback for updating the destination that the remote side should send RTP to */ 00418 int (*update_peer)(struct ast_channel *chan, struct ast_rtp_instance *instance, struct ast_rtp_instance *vinstance, struct ast_rtp_instance *tinstance, const struct ast_format_cap *cap, int nat_active); 00419 /*! Callback for retrieving codecs that the channel can do. Result returned in result_cap*/ 00420 void (*get_codec)(struct ast_channel *chan, struct ast_format_cap *result_cap); 00421 /*! Linked list information */ 00422 AST_RWLIST_ENTRY(ast_rtp_glue) entry; 00423 }; 00424 00425 #define ast_rtp_engine_register(engine) ast_rtp_engine_register2(engine, ast_module_info->self) 00426 00427 /*! 00428 * \brief Register an RTP engine 00429 * 00430 * \param engine Structure of the RTP engine to register 00431 * \param module Module that the RTP engine is part of 00432 * 00433 * \retval 0 success 00434 * \retval -1 failure 00435 * 00436 * Example usage: 00437 * 00438 * \code 00439 * ast_rtp_engine_register2(&example_rtp_engine, NULL); 00440 * \endcode 00441 * 00442 * This registers the RTP engine declared as example_rtp_engine with the RTP engine core, but does not 00443 * associate a module with it. 00444 * 00445 * \note It is recommended that you use the ast_rtp_engine_register macro so that the module is 00446 * associated with the RTP engine and use counting is performed. 00447 * 00448 * \since 1.8 00449 */ 00450 int ast_rtp_engine_register2(struct ast_rtp_engine *engine, struct ast_module *module); 00451 00452 /*! 00453 * \brief Unregister an RTP engine 00454 * 00455 * \param engine Structure of the RTP engine to unregister 00456 * 00457 * \retval 0 success 00458 * \retval -1 failure 00459 * 00460 * Example usage: 00461 * 00462 * \code 00463 * ast_rtp_engine_unregister(&example_rtp_engine); 00464 * \endcode 00465 * 00466 * This unregisters the RTP engine declared as example_rtp_engine from the RTP engine core. If a module 00467 * reference was provided when it was registered then this will only be called once the RTP engine is no longer in use. 00468 * 00469 * \since 1.8 00470 */ 00471 int ast_rtp_engine_unregister(struct ast_rtp_engine *engine); 00472 00473 int ast_rtp_engine_register_srtp(struct ast_srtp_res *srtp_res, struct ast_srtp_policy_res *policy_res); 00474 00475 void ast_rtp_engine_unregister_srtp(void); 00476 int ast_rtp_engine_srtp_is_registered(void); 00477 00478 #define ast_rtp_glue_register(glue) ast_rtp_glue_register2(glue, ast_module_info->self) 00479 00480 /*! 00481 * \brief Register RTP glue 00482 * 00483 * \param glue The glue to register 00484 * \param module Module that the RTP glue is part of 00485 * 00486 * \retval 0 success 00487 * \retval -1 failure 00488 * 00489 * Example usage: 00490 * 00491 * \code 00492 * ast_rtp_glue_register2(&example_rtp_glue, NULL); 00493 * \endcode 00494 * 00495 * This registers the RTP glue declared as example_rtp_glue with the RTP engine core, but does not 00496 * associate a module with it. 00497 * 00498 * \note It is recommended that you use the ast_rtp_glue_register macro so that the module is 00499 * associated with the RTP glue and use counting is performed. 00500 * 00501 * \since 1.8 00502 */ 00503 int ast_rtp_glue_register2(struct ast_rtp_glue *glue, struct ast_module *module); 00504 00505 /*! 00506 * \brief Unregister RTP glue 00507 * 00508 * \param glue The glue to unregister 00509 * 00510 * \retval 0 success 00511 * \retval -1 failure 00512 * 00513 * Example usage: 00514 * 00515 * \code 00516 * ast_rtp_glue_unregister(&example_rtp_glue); 00517 * \endcode 00518 * 00519 * This unregisters the RTP glue declared as example_rtp_gkue from the RTP engine core. If a module 00520 * reference was provided when it was registered then this will only be called once the RTP engine is no longer in use. 00521 * 00522 * \since 1.8 00523 */ 00524 int ast_rtp_glue_unregister(struct ast_rtp_glue *glue); 00525 00526 /*! 00527 * \brief Create a new RTP instance 00528 * 00529 * \param engine_name Name of the engine to use for the RTP instance 00530 * \param sched Scheduler context that the RTP engine may want to use 00531 * \param sa Address we want to bind to 00532 * \param data Unique data for the engine 00533 * 00534 * \retval non-NULL success 00535 * \retval NULL failure 00536 * 00537 * Example usage: 00538 * 00539 * \code 00540 * struct ast_rtp_instance *instance = NULL; 00541 * instance = ast_rtp_instance_new(NULL, sched, &sin, NULL); 00542 * \endcode 00543 * 00544 * This creates a new RTP instance using the default engine and asks the RTP engine to bind to the address given 00545 * in the address structure. 00546 * 00547 * \note The RTP engine does not have to use the address provided when creating an RTP instance. It may choose to use 00548 * another depending on it's own configuration. 00549 * 00550 * \since 1.8 00551 */ 00552 struct ast_rtp_instance *ast_rtp_instance_new(const char *engine_name, 00553 struct ast_sched_context *sched, const struct ast_sockaddr *sa, 00554 void *data); 00555 00556 /*! 00557 * \brief Destroy an RTP instance 00558 * 00559 * \param instance The RTP instance to destroy 00560 * 00561 * \retval 0 success 00562 * \retval -1 failure 00563 * 00564 * Example usage: 00565 * 00566 * \code 00567 * ast_rtp_instance_destroy(instance); 00568 * \endcode 00569 * 00570 * This destroys the RTP instance pointed to by instance. Once this function returns instance no longer points to valid 00571 * memory and may not be used again. 00572 * 00573 * \since 1.8 00574 */ 00575 int ast_rtp_instance_destroy(struct ast_rtp_instance *instance); 00576 00577 /*! 00578 * \brief Set the data portion of an RTP instance 00579 * 00580 * \param instance The RTP instance to manipulate 00581 * \param data Pointer to data 00582 * 00583 * Example usage: 00584 * 00585 * \code 00586 * ast_rtp_instance_set_data(instance, blob); 00587 * \endcode 00588 * 00589 * This sets the data pointer on the RTP instance pointed to by 'instance' to 00590 * blob. 00591 * 00592 * \since 1.8 00593 */ 00594 void ast_rtp_instance_set_data(struct ast_rtp_instance *instance, void *data); 00595 00596 /*! 00597 * \brief Get the data portion of an RTP instance 00598 * 00599 * \param instance The RTP instance we want the data portion from 00600 * 00601 * Example usage: 00602 * 00603 * \code 00604 * struct *blob = ast_rtp_instance_get_data(instance); 00605 ( \endcode 00606 * 00607 * This gets the data pointer on the RTP instance pointed to by 'instance'. 00608 * 00609 * \since 1.8 00610 */ 00611 void *ast_rtp_instance_get_data(struct ast_rtp_instance *instance); 00612 00613 /*! 00614 * \brief Send a frame out over RTP 00615 * 00616 * \param instance The RTP instance to send frame out on 00617 * \param frame the frame to send out 00618 * 00619 * \retval 0 success 00620 * \retval -1 failure 00621 * 00622 * Example usage: 00623 * 00624 * \code 00625 * ast_rtp_instance_write(instance, frame); 00626 * \endcode 00627 * 00628 * This gives the frame pointed to by frame to the RTP engine being used for the instance 00629 * and asks that it be transmitted to the current remote address set on the RTP instance. 00630 * 00631 * \since 1.8 00632 */ 00633 int ast_rtp_instance_write(struct ast_rtp_instance *instance, struct ast_frame *frame); 00634 00635 /*! 00636 * \brief Receive a frame over RTP 00637 * 00638 * \param instance The RTP instance to receive frame on 00639 * \param rtcp Whether to read in RTCP or not 00640 * 00641 * \retval non-NULL success 00642 * \retval NULL failure 00643 * 00644 * Example usage: 00645 * 00646 * \code 00647 * struct ast_frame *frame; 00648 * frame = ast_rtp_instance_read(instance, 0); 00649 * \endcode 00650 * 00651 * This asks the RTP engine to read in RTP from the instance and return it as an Asterisk frame. 00652 * 00653 * \since 1.8 00654 */ 00655 struct ast_frame *ast_rtp_instance_read(struct ast_rtp_instance *instance, int rtcp); 00656 00657 /*! 00658 * \brief Set the address of the remote endpoint that we are sending RTP to 00659 * 00660 * \param instance The RTP instance to change the address on 00661 * \param address Address to set it to 00662 * 00663 * \retval 0 success 00664 * \retval -1 failure 00665 * 00666 * Example usage: 00667 * 00668 * \code 00669 * ast_rtp_instance_set_remote_address(instance, &sin); 00670 * \endcode 00671 * 00672 * This changes the remote address that RTP will be sent to on instance to the address given in the sin 00673 * structure. 00674 * 00675 * \since 1.8 00676 */ 00677 int ast_rtp_instance_set_remote_address(struct ast_rtp_instance *instance, const struct ast_sockaddr *address); 00678 00679 00680 /*! 00681 * \brief Set the address of an an alternate RTP address to receive from 00682 * 00683 * \param instance The RTP instance to change the address on 00684 * \param address Address to set it to 00685 * 00686 * \retval 0 success 00687 * \retval -1 failure 00688 * 00689 * Example usage: 00690 * 00691 * \code 00692 * ast_rtp_instance_set_alt_remote_address(instance, &address); 00693 * \endcode 00694 * 00695 * This changes the alternate remote address that RTP will be sent to on instance to the address given in the sin 00696 * structure. 00697 * 00698 * \since 1.8 00699 */ 00700 int ast_rtp_instance_set_alt_remote_address(struct ast_rtp_instance *instance, const struct ast_sockaddr *address); 00701 00702 /*! 00703 * \brief Set the address that we are expecting to receive RTP on 00704 * 00705 * \param instance The RTP instance to change the address on 00706 * \param address Address to set it to 00707 * 00708 * \retval 0 success 00709 * \retval -1 failure 00710 * 00711 * Example usage: 00712 * 00713 * \code 00714 * ast_rtp_instance_set_local_address(instance, &sin); 00715 * \endcode 00716 * 00717 * This changes the local address that RTP is expected on to the address given in the sin 00718 * structure. 00719 * 00720 * \since 1.8 00721 */ 00722 int ast_rtp_instance_set_local_address(struct ast_rtp_instance *instance, 00723 const struct ast_sockaddr *address); 00724 00725 /*! 00726 * \brief Get the local address that we are expecting RTP on 00727 * 00728 * \param instance The RTP instance to get the address from 00729 * \param address The variable to store the address in 00730 * 00731 * Example usage: 00732 * 00733 * \code 00734 * struct ast_sockaddr address; 00735 * ast_rtp_instance_get_local_address(instance, &address); 00736 * \endcode 00737 * 00738 * This gets the local address that we are expecting RTP on and stores it in the 'address' structure. 00739 * 00740 * \since 1.8 00741 */ 00742 void ast_rtp_instance_get_local_address(struct ast_rtp_instance *instance, struct ast_sockaddr *address); 00743 00744 /*! 00745 * \brief Get the address of the local endpoint that we are sending RTP to, comparing its address to another 00746 * 00747 * \param instance The instance that we want to get the local address for 00748 * \param address An initialized address that may be overwritten if the local address is different 00749 * 00750 * \retval 0 address was not changed 00751 * \retval 1 address was changed 00752 * Example usage: 00753 * 00754 * \code 00755 * struct ast_sockaddr address; 00756 * int ret; 00757 * ret = ast_rtp_instance_get_and_cmp_local_address(instance, &address); 00758 * \endcode 00759 * 00760 * This retrieves the current local address set on the instance pointed to by instance and puts the value 00761 * into the address structure. 00762 * 00763 * \since 1.8 00764 */ 00765 int ast_rtp_instance_get_and_cmp_local_address(struct ast_rtp_instance *instance, struct ast_sockaddr *address); 00766 00767 /*! 00768 * \brief Get the address of the remote endpoint that we are sending RTP to 00769 * 00770 * \param instance The instance that we want to get the remote address for 00771 * \param address A structure to put the address into 00772 * 00773 * Example usage: 00774 * 00775 * \code 00776 * struct ast_sockaddr address; 00777 * ast_rtp_instance_get_remote_address(instance, &address); 00778 * \endcode 00779 * 00780 * This retrieves the current remote address set on the instance pointed to by instance and puts the value 00781 * into the address structure. 00782 * 00783 * \since 1.8 00784 */ 00785 void ast_rtp_instance_get_remote_address(struct ast_rtp_instance *instance, struct ast_sockaddr *address); 00786 00787 /*! 00788 * \brief Get the address of the remote endpoint that we are sending RTP to, comparing its address to another 00789 * 00790 * \param instance The instance that we want to get the remote address for 00791 * \param address An initialized address that may be overwritten if the remote address is different 00792 * 00793 * \retval 0 address was not changed 00794 * \retval 1 address was changed 00795 * Example usage: 00796 * 00797 * \code 00798 * struct ast_sockaddr address; 00799 * int ret; 00800 * ret = ast_rtp_instance_get_and_cmp_remote_address(instance, &address); 00801 * \endcode 00802 * 00803 * This retrieves the current remote address set on the instance pointed to by instance and puts the value 00804 * into the address structure. 00805 * 00806 * \since 1.8 00807 */ 00808 00809 int ast_rtp_instance_get_and_cmp_remote_address(struct ast_rtp_instance *instance, struct ast_sockaddr *address); 00810 00811 /*! 00812 * \brief Set the value of an RTP instance extended property 00813 * 00814 * \param instance The RTP instance to set the extended property on 00815 * \param property The extended property to set 00816 * \param value The value to set the extended property to 00817 * 00818 * \since 1.8 00819 */ 00820 void ast_rtp_instance_set_extended_prop(struct ast_rtp_instance *instance, int property, void *value); 00821 00822 /*! 00823 * \brief Get the value of an RTP instance extended property 00824 * 00825 * \param instance The RTP instance to get the extended property on 00826 * \param property The extended property to get 00827 * 00828 * \since 1.8 00829 */ 00830 void *ast_rtp_instance_get_extended_prop(struct ast_rtp_instance *instance, int property); 00831 00832 /*! 00833 * \brief Set the value of an RTP instance property 00834 * 00835 * \param instance The RTP instance to set the property on 00836 * \param property The property to modify 00837 * \param value The value to set the property to 00838 * 00839 * Example usage: 00840 * 00841 * \code 00842 * ast_rtp_instance_set_prop(instance, AST_RTP_PROPERTY_NAT, 1); 00843 * \endcode 00844 * 00845 * This enables the AST_RTP_PROPERTY_NAT property on the instance pointed to by instance. 00846 * 00847 * \since 1.8 00848 */ 00849 void ast_rtp_instance_set_prop(struct ast_rtp_instance *instance, enum ast_rtp_property property, int value); 00850 00851 /*! 00852 * \brief Get the value of an RTP instance property 00853 * 00854 * \param instance The RTP instance to get the property from 00855 * \param property The property to get 00856 * 00857 * \retval Current value of the property 00858 * 00859 * Example usage: 00860 * 00861 * \code 00862 * ast_rtp_instance_get_prop(instance, AST_RTP_PROPERTY_NAT); 00863 * \endcode 00864 * 00865 * This returns the current value of the NAT property on the instance pointed to by instance. 00866 * 00867 * \since 1.8 00868 */ 00869 int ast_rtp_instance_get_prop(struct ast_rtp_instance *instance, enum ast_rtp_property property); 00870 00871 /*! 00872 * \brief Get the codecs structure of an RTP instance 00873 * 00874 * \param instance The RTP instance to get the codecs structure from 00875 * 00876 * Example usage: 00877 * 00878 * \code 00879 * struct ast_rtp_codecs *codecs = ast_rtp_instance_get_codecs(instance); 00880 * \endcode 00881 * 00882 * This gets the codecs structure on the RTP instance pointed to by 'instance'. 00883 * 00884 * \since 1.8 00885 */ 00886 struct ast_rtp_codecs *ast_rtp_instance_get_codecs(struct ast_rtp_instance *instance); 00887 00888 /*! 00889 * \brief Clear payload information from an RTP instance 00890 * 00891 * \param codecs The codecs structure that payloads will be cleared from 00892 * \param instance Optionally the instance that the codecs structure belongs to 00893 * 00894 * Example usage: 00895 * 00896 * \code 00897 * struct ast_rtp_codecs codecs; 00898 * ast_rtp_codecs_payloads_clear(&codecs, NULL); 00899 * \endcode 00900 * 00901 * This clears the codecs structure and puts it into a pristine state. 00902 * 00903 * \since 1.8 00904 */ 00905 void ast_rtp_codecs_payloads_clear(struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance); 00906 00907 /*! 00908 * \brief Set payload information on an RTP instance to the default 00909 * 00910 * \param codecs The codecs structure to set defaults on 00911 * \param instance Optionally the instance that the codecs structure belongs to 00912 * 00913 * Example usage: 00914 * 00915 * \code 00916 * struct ast_rtp_codecs codecs; 00917 * ast_rtp_codecs_payloads_default(&codecs, NULL); 00918 * \endcode 00919 * 00920 * This sets the default payloads on the codecs structure. 00921 * 00922 * \since 1.8 00923 */ 00924 void ast_rtp_codecs_payloads_default(struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance); 00925 00926 /*! 00927 * \brief Copy payload information from one RTP instance to another 00928 * 00929 * \param src The source codecs structure 00930 * \param dest The destination codecs structure that the values from src will be copied to 00931 * \param instance Optionally the instance that the dst codecs structure belongs to 00932 * 00933 * Example usage: 00934 * 00935 * \code 00936 * ast_rtp_codecs_payloads_copy(&codecs0, &codecs1, NULL); 00937 * \endcode 00938 * 00939 * This copies the payloads from the codecs0 structure to the codecs1 structure, overwriting any current values. 00940 * 00941 * \since 1.8 00942 */ 00943 void ast_rtp_codecs_payloads_copy(struct ast_rtp_codecs *src, struct ast_rtp_codecs *dest, struct ast_rtp_instance *instance); 00944 00945 /*! 00946 * \brief Record payload information that was seen in an m= SDP line 00947 * 00948 * \param codecs The codecs structure to muck with 00949 * \param instance Optionally the instance that the codecs structure belongs to 00950 * \param payload Numerical payload that was seen in the m= SDP line 00951 * 00952 * Example usage: 00953 * 00954 * \code 00955 * ast_rtp_codecs_payloads_set_m_type(&codecs, NULL, 0); 00956 * \endcode 00957 * 00958 * This records that the numerical payload '0' was seen in the codecs structure. 00959 * 00960 * \since 1.8 00961 */ 00962 void ast_rtp_codecs_payloads_set_m_type(struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, int payload); 00963 00964 /*! 00965 * \brief Record payload information that was seen in an a=rtpmap: SDP line 00966 * 00967 * \param codecs The codecs structure to muck with 00968 * \param instance Optionally the instance that the codecs structure belongs to 00969 * \param payload Numerical payload that was seen in the a=rtpmap: SDP line 00970 * \param mimetype The string mime type that was seen 00971 * \param mimesubtype The strin mime sub type that was seen 00972 * \param options Optional options that may change the behavior of this specific payload 00973 * 00974 * \retval 0 success 00975 * \retval -1 failure, invalid payload numbe 00976 * \retval -2 failure, unknown mimetype 00977 * 00978 * Example usage: 00979 * 00980 * \code 00981 * ast_rtp_codecs_payloads_set_rtpmap_type(&codecs, NULL, 0, "audio", "PCMU", 0); 00982 * \endcode 00983 * 00984 * This records that the numerical payload '0' was seen with mime type 'audio' and sub mime type 'PCMU' in the codecs structure. 00985 * 00986 * \since 1.8 00987 */ 00988 int ast_rtp_codecs_payloads_set_rtpmap_type(struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, int payload, char *mimetype, char *mimesubtype, enum ast_rtp_options options); 00989 00990 /*! 00991 * \brief Set payload type to a known MIME media type for a codec with a specific sample rate 00992 * 00993 * \param codecs RTP structure to modify 00994 * \param instance Optionally the instance that the codecs structure belongs to 00995 * \param pt Payload type entry to modify 00996 * \param mimetype top-level MIME type of media stream (typically "audio", "video", "text", etc.) 00997 * \param mimesubtype MIME subtype of media stream (typically a codec name) 00998 * \param options Zero or more flags from the ast_rtp_options enum 00999 * \param sample_rate The sample rate of the media stream 01000 * 01001 * This function 'fills in' an entry in the list of possible formats for 01002 * a media stream associated with an RTP structure. 01003 * 01004 * \retval 0 on success 01005 * \retval -1 if the payload type is out of range 01006 * \retval -2 if the mimeType/mimeSubtype combination was not found 01007 * 01008 * \since 1.8 01009 */ 01010 int ast_rtp_codecs_payloads_set_rtpmap_type_rate(struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, int pt, 01011 char *mimetype, char *mimesubtype, 01012 enum ast_rtp_options options, 01013 unsigned int sample_rate); 01014 01015 /*! 01016 * \brief Remove payload information 01017 * 01018 * \param codecs The codecs structure to muck with 01019 * \param instance Optionally the instance that the codecs structure belongs to 01020 * \param payload Numerical payload to unset 01021 * 01022 * Example usage: 01023 * 01024 * \code 01025 * ast_rtp_codecs_payloads_unset(&codecs, NULL, 0); 01026 * \endcode 01027 * 01028 * This clears the payload '0' from the codecs structure. It will be as if it was never set. 01029 * 01030 * \since 1.8 01031 */ 01032 void ast_rtp_codecs_payloads_unset(struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, int payload); 01033 01034 /*! 01035 * \brief Retrieve payload information by payload 01036 * 01037 * \param codecs Codecs structure to look in 01038 * \param payload Numerical payload to look up 01039 * 01040 * \retval Payload information 01041 * 01042 * Example usage: 01043 * 01044 * \code 01045 * struct ast_rtp_payload_type payload_type; 01046 * payload_type = ast_rtp_codecs_payload_lookup(&codecs, 0); 01047 * \endcode 01048 * 01049 * This looks up the information for payload '0' from the codecs structure. 01050 * 01051 * \since 1.8 01052 */ 01053 struct ast_rtp_payload_type ast_rtp_codecs_payload_lookup(struct ast_rtp_codecs *codecs, int payload); 01054 01055 /*! 01056 * \brief Retrieve the actual ast_format stored on the codecs structure for a specific payload 01057 * 01058 * \param codecs Codecs structure to look in 01059 * \param payload Numerical payload to look up 01060 * 01061 * \retval pointer to format structure on success 01062 * \retval NULL on failure 01063 * 01064 * \since 10.0 01065 */ 01066 struct ast_format *ast_rtp_codecs_get_payload_format(struct ast_rtp_codecs *codecs, int payload); 01067 01068 /*! 01069 * \brief Get the sample rate associated with known RTP payload types 01070 * 01071 * \param asterisk_format True if the value in format is to be used. 01072 * \param An asterisk format 01073 * \param code from AST_RTP list 01074 * 01075 * \return the sample rate if the format was found, zero if it was not found 01076 * 01077 * \since 1.8 01078 */ 01079 unsigned int ast_rtp_lookup_sample_rate2(int asterisk_format, struct ast_format *format, int code); 01080 01081 /*! 01082 * \brief Retrieve all formats that were found 01083 * 01084 * \param codecs Codecs structure to look in 01085 * \param astformats A capabilities structure to put the Asterisk formats in. 01086 * \param nonastformats An integer to put the non-Asterisk formats in 01087 * 01088 * Example usage: 01089 * 01090 * \code 01091 * struct ast_format_cap *astformats = ast_format_cap_alloc_nolock() 01092 * int nonastformats; 01093 * ast_rtp_codecs_payload_formats(&codecs, &astformats, &nonastformats); 01094 * \endcode 01095 * 01096 * This retrieves all the formats known about in the codecs structure and puts the Asterisk ones in the integer 01097 * pointed to by astformats and the non-Asterisk ones in the integer pointed to by nonastformats. 01098 * 01099 * \since 1.8 01100 */ 01101 void ast_rtp_codecs_payload_formats(struct ast_rtp_codecs *codecs, struct ast_format_cap *astformats, int *nonastformats); 01102 01103 /*! 01104 * \brief Retrieve a payload based on whether it is an Asterisk format and the code 01105 * 01106 * \param codecs Codecs structure to look in 01107 * \param asterisk_format Non-zero if the given Asterisk format is present 01108 * \param format Asterisk format to look for 01109 * \param code The format to look for 01110 * 01111 * \retval Numerical payload 01112 * 01113 * Example usage: 01114 * 01115 * \code 01116 * int payload = ast_rtp_codecs_payload_code(&codecs, 1, ast_format_set(&tmp_fmt, AST_FORMAT_ULAW, 0), 0); 01117 * \endcode 01118 * 01119 * This looks for the numerical payload for ULAW in the codecs structure. 01120 * 01121 * \since 1.8 01122 */ 01123 int ast_rtp_codecs_payload_code(struct ast_rtp_codecs *codecs, int asterisk_format, const struct ast_format *format, int code); 01124 01125 /*! 01126 * \brief Retrieve mime subtype information on a payload 01127 * 01128 * \param asterisk_format Non-zero to look up using Asterisk format 01129 * \param format Asterisk format to look up 01130 * \param code RTP code to look up 01131 * \param options Additional options that may change the result 01132 * 01133 * \retval Mime subtype success 01134 * \retval NULL failure 01135 * 01136 * Example usage: 01137 * 01138 * \code 01139 * const char *subtype = ast_rtp_lookup_mime_subtype2(1, ast_format_set(&tmp_fmt, AST_FORMAT_ULAW, 0), 0, 0); 01140 * \endcode 01141 * 01142 * This looks up the mime subtype for the ULAW format. 01143 * 01144 * \since 1.8 01145 */ 01146 const char *ast_rtp_lookup_mime_subtype2(const int asterisk_format, struct ast_format *format, int code, enum ast_rtp_options options); 01147 01148 /*! 01149 * \brief Convert formats into a string and put them into a buffer 01150 * 01151 * \param buf Buffer to put the mime output into 01152 * \param ast_format_capability Asterisk Formats we are looking up. 01153 * \param rtp_capability RTP codes that we are looking up 01154 * \param asterisk_format Non-zero if the ast_format_capability structure is to be used, 0 if rtp_capability is to be used 01155 * \param options Additional options that may change the result 01156 * 01157 * \retval non-NULL success 01158 * \retval NULL failure 01159 * 01160 * Example usage: 01161 * 01162 * \code 01163 * char buf[256] = ""; 01164 * struct ast_format tmp_fmt; 01165 * struct ast_format_cap *cap = ast_format_cap_alloc_nolock(); 01166 * ast_format_cap_add(cap, ast_format_set(&tmp_fmt, AST_FORMAT_ULAW, 0)); 01167 * ast_format_cap_add(cap, ast_format_set(&tmp_fmt, AST_FORMAT_GSM, 0)); 01168 * char *mime = ast_rtp_lookup_mime_multiple2(&buf, sizeof(buf), cap, 0, 1, 0); 01169 * ast_format_cap_destroy(cap); 01170 * \endcode 01171 * 01172 * This returns the mime values for ULAW and ALAW in the buffer pointed to by buf. 01173 * 01174 * \since 1.8 01175 */ 01176 char *ast_rtp_lookup_mime_multiple2(struct ast_str *buf, struct ast_format_cap *ast_format_capability, int rtp_capability, const int asterisk_format, enum ast_rtp_options options); 01177 01178 /*! 01179 * \brief Set codec packetization preferences 01180 * 01181 * \param codecs Codecs structure to muck with 01182 * \param instance Optionally the instance that the codecs structure belongs to 01183 * \param prefs Codec packetization preferences 01184 * 01185 * Example usage: 01186 * 01187 * \code 01188 * ast_rtp_codecs_packetization_set(&codecs, NULL, &prefs); 01189 * \endcode 01190 * 01191 * This sets the packetization preferences pointed to by prefs on the codecs structure pointed to by codecs. 01192 * 01193 * \since 1.8 01194 */ 01195 void ast_rtp_codecs_packetization_set(struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, struct ast_codec_pref *prefs); 01196 01197 /*! 01198 * \brief Begin sending a DTMF digit 01199 * 01200 * \param instance The RTP instance to send the DTMF on 01201 * \param digit What DTMF digit to send 01202 * 01203 * \retval 0 success 01204 * \retval -1 failure 01205 * 01206 * Example usage: 01207 * 01208 * \code 01209 * ast_rtp_instance_dtmf_begin(instance, '1'); 01210 * \endcode 01211 * 01212 * This starts sending the DTMF '1' on the RTP instance pointed to by instance. It will 01213 * continue being sent until it is ended. 01214 * 01215 * \since 1.8 01216 */ 01217 int ast_rtp_instance_dtmf_begin(struct ast_rtp_instance *instance, char digit); 01218 01219 /*! 01220 * \brief Stop sending a DTMF digit 01221 * 01222 * \param instance The RTP instance to stop the DTMF on 01223 * \param digit What DTMF digit to stop 01224 * 01225 * \retval 0 success 01226 * \retval -1 failure 01227 * 01228 * Example usage: 01229 * 01230 * \code 01231 * ast_rtp_instance_dtmf_end(instance, '1'); 01232 * \endcode 01233 * 01234 * This stops sending the DTMF '1' on the RTP instance pointed to by instance. 01235 * 01236 * \since 1.8 01237 */ 01238 int ast_rtp_instance_dtmf_end(struct ast_rtp_instance *instance, char digit); 01239 int ast_rtp_instance_dtmf_end_with_duration(struct ast_rtp_instance *instance, char digit, unsigned int duration); 01240 01241 /*! 01242 * \brief Set the DTMF mode that should be used 01243 * 01244 * \param instance the RTP instance to set DTMF mode on 01245 * \param dtmf_mode The DTMF mode that is in use 01246 * 01247 * \retval 0 success 01248 * \retval -1 failure 01249 * 01250 * Example usage: 01251 * 01252 * \code 01253 * ast_rtp_instance_dtmf_mode_set(instance, AST_RTP_DTMF_MODE_RFC2833); 01254 * \endcode 01255 * 01256 * This sets the RTP instance to use RFC2833 for DTMF transmission and receiving. 01257 * 01258 * \since 1.8 01259 */ 01260 int ast_rtp_instance_dtmf_mode_set(struct ast_rtp_instance *instance, enum ast_rtp_dtmf_mode dtmf_mode); 01261 01262 /*! 01263 * \brief Get the DTMF mode of an RTP instance 01264 * 01265 * \param instance The RTP instance to get the DTMF mode of 01266 * 01267 * \retval DTMF mode 01268 * 01269 * Example usage: 01270 * 01271 * \code 01272 * enum ast_rtp_dtmf_mode dtmf_mode = ast_rtp_instance_dtmf_mode_get(instance); 01273 * \endcode 01274 * 01275 * This gets the DTMF mode set on the RTP instance pointed to by 'instance'. 01276 * 01277 * \since 1.8 01278 */ 01279 enum ast_rtp_dtmf_mode ast_rtp_instance_dtmf_mode_get(struct ast_rtp_instance *instance); 01280 01281 /*! 01282 * \brief Indicate that the RTP marker bit should be set on an RTP stream 01283 * 01284 * \param instance Instance that the new media source is feeding into 01285 * 01286 * Example usage: 01287 * 01288 * \code 01289 * ast_rtp_instance_update_source(instance); 01290 * \endcode 01291 * 01292 * This indicates that the source of media that is feeding the instance pointed to by 01293 * instance has been updated and that the marker bit should be set. 01294 * 01295 * \since 1.8 01296 */ 01297 void ast_rtp_instance_update_source(struct ast_rtp_instance *instance); 01298 01299 /*! 01300 * \brief Indicate a new source of audio has dropped in and the ssrc should change 01301 * 01302 * \param instance Instance that the new media source is feeding into 01303 * 01304 * Example usage: 01305 * 01306 * \code 01307 * ast_rtp_instance_change_source(instance); 01308 * \endcode 01309 * 01310 * This indicates that the source of media that is feeding the instance pointed to by 01311 * instance has changed and that the marker bit should be set and the SSRC updated. 01312 * 01313 * \since 1.8 01314 */ 01315 void ast_rtp_instance_change_source(struct ast_rtp_instance *instance); 01316 01317 /*! 01318 * \brief Set QoS parameters on an RTP session 01319 * 01320 * \param instance Instance to set the QoS parameters on 01321 * \param tos Terms of service value 01322 * \param cos Class of service value 01323 * \param desc What is setting the QoS values 01324 * 01325 * \retval 0 success 01326 * \retval -1 failure 01327 * 01328 * Example usage: 01329 * 01330 * \code 01331 * ast_rtp_instance_set_qos(instance, 0, 0, "Example"); 01332 * \endcode 01333 * 01334 * This sets the TOS and COS values to 0 on the instance pointed to by instance. 01335 * 01336 * \since 1.8 01337 */ 01338 int ast_rtp_instance_set_qos(struct ast_rtp_instance *instance, int tos, int cos, const char *desc); 01339 01340 /*! 01341 * \brief Stop an RTP instance 01342 * 01343 * \param instance Instance that media is no longer going to at this time 01344 * 01345 * Example usage: 01346 * 01347 * \code 01348 * ast_rtp_instance_stop(instance); 01349 * \endcode 01350 * 01351 * This tells the RTP engine being used for the instance pointed to by instance 01352 * that media is no longer going to it at this time, but may in the future. 01353 * 01354 * \since 1.8 01355 */ 01356 void ast_rtp_instance_stop(struct ast_rtp_instance *instance); 01357 01358 /*! 01359 * \brief Get the file descriptor for an RTP session (or RTCP) 01360 * 01361 * \param instance Instance to get the file descriptor for 01362 * \param rtcp Whether to retrieve the file descriptor for RTCP or not 01363 * 01364 * \retval fd success 01365 * \retval -1 failure 01366 * 01367 * Example usage: 01368 * 01369 * \code 01370 * int rtp_fd = ast_rtp_instance_fd(instance, 0); 01371 * \endcode 01372 * 01373 * This retrieves the file descriptor for the socket carrying media on the instance 01374 * pointed to by instance. 01375 * 01376 * \since 1.8 01377 */ 01378 int ast_rtp_instance_fd(struct ast_rtp_instance *instance, int rtcp); 01379 01380 /*! 01381 * \brief Get the RTP glue that binds a channel to the RTP engine 01382 * 01383 * \param type Name of the glue we want 01384 * 01385 * \retval non-NULL success 01386 * \retval NULL failure 01387 * 01388 * Example usage: 01389 * 01390 * \code 01391 * struct ast_rtp_glue *glue = ast_rtp_instance_get_glue("Example"); 01392 * \endcode 01393 * 01394 * This retrieves the RTP glue that has the name 'Example'. 01395 * 01396 * \since 1.8 01397 */ 01398 struct ast_rtp_glue *ast_rtp_instance_get_glue(const char *type); 01399 01400 /*! 01401 * \brief Bridge two channels that use RTP instances 01402 * 01403 * \param c0 First channel part of the bridge 01404 * \param c1 Second channel part of the bridge 01405 * \param flags Bridging flags 01406 * \param fo If a frame needs to be passed up it is stored here 01407 * \param rc Channel that passed the above frame up 01408 * \param timeoutms How long the channels should be bridged for 01409 * 01410 * \retval Bridge result 01411 * 01412 * \note This should only be used by channel drivers in their technology declaration. 01413 * 01414 * \since 1.8 01415 */ 01416 enum ast_bridge_result ast_rtp_instance_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms); 01417 01418 /*! 01419 * \brief Get the other RTP instance that an instance is bridged to 01420 * 01421 * \param instance The RTP instance that we want 01422 * 01423 * \retval non-NULL success 01424 * \retval NULL failure 01425 * 01426 * Example usage: 01427 * 01428 * \code 01429 * struct ast_rtp_instance *bridged = ast_rtp_instance_get_bridged(instance0); 01430 * \endcode 01431 * 01432 * This gets the RTP instance that instance0 is bridged to. 01433 * 01434 * \since 1.8 01435 */ 01436 struct ast_rtp_instance *ast_rtp_instance_get_bridged(struct ast_rtp_instance *instance); 01437 01438 /*! 01439 * \brief Make two channels compatible for early bridging 01440 * 01441 * \param c0 First channel part of the bridge 01442 * \param c1 Second channel part of the bridge 01443 * 01444 * \since 1.8 01445 */ 01446 void ast_rtp_instance_early_bridge_make_compatible(struct ast_channel *c0, struct ast_channel *c1); 01447 01448 /*! 01449 * \brief Early bridge two channels that use RTP instances 01450 * 01451 * \param c0 First channel part of the bridge 01452 * \param c1 Second channel part of the bridge 01453 * 01454 * \retval 0 success 01455 * \retval -1 failure 01456 * 01457 * \note This should only be used by channel drivers in their technology declaration. 01458 * 01459 * \since 1.8 01460 */ 01461 int ast_rtp_instance_early_bridge(struct ast_channel *c0, struct ast_channel *c1); 01462 01463 /*! 01464 * \brief Initialize RED support on an RTP instance 01465 * 01466 * \param instance The instance to initialize RED support on 01467 * \param buffer_time How long to buffer before sending 01468 * \param payloads Payload values 01469 * \param generations Number of generations 01470 * 01471 * \retval 0 success 01472 * \retval -1 failure 01473 * 01474 * \since 1.8 01475 */ 01476 int ast_rtp_red_init(struct ast_rtp_instance *instance, int buffer_time, int *payloads, int generations); 01477 01478 /*! 01479 * \brief Buffer a frame in an RTP instance for RED 01480 * 01481 * \param instance The instance to buffer the frame on 01482 * \param frame Frame that we want to buffer 01483 * 01484 * \retval 0 success 01485 * \retval -1 failure 01486 * 01487 * \since 1.8 01488 */ 01489 int ast_rtp_red_buffer(struct ast_rtp_instance *instance, struct ast_frame *frame); 01490 01491 /*! 01492 * \brief Retrieve statistics about an RTP instance 01493 * 01494 * \param instance Instance to get statistics on 01495 * \param stats Structure to put results into 01496 * \param stat What statistic(s) to retrieve 01497 * 01498 * \retval 0 success 01499 * \retval -1 failure 01500 * 01501 * Example usage: 01502 * 01503 * \code 01504 * struct ast_rtp_instance_stats stats; 01505 * ast_rtp_instance_get_stats(instance, &stats, AST_RTP_INSTANCE_STAT_ALL); 01506 * \endcode 01507 * 01508 * This retrieves all statistics the underlying RTP engine supports and puts the values into the 01509 * stats structure. 01510 * 01511 * \since 1.8 01512 */ 01513 int ast_rtp_instance_get_stats(struct ast_rtp_instance *instance, struct ast_rtp_instance_stats *stats, enum ast_rtp_instance_stat stat); 01514 01515 /*! 01516 * \brief Set standard statistics from an RTP instance on a channel 01517 * 01518 * \param chan Channel to set the statistics on 01519 * \param instance The RTP instance that statistics will be retrieved from 01520 * 01521 * Example usage: 01522 * 01523 * \code 01524 * ast_rtp_instance_set_stats_vars(chan, rtp); 01525 * \endcode 01526 * 01527 * This retrieves standard statistics from the RTP instance rtp and sets it on the channel pointed to 01528 * by chan. 01529 * 01530 * \since 1.8 01531 */ 01532 void ast_rtp_instance_set_stats_vars(struct ast_channel *chan, struct ast_rtp_instance *instance); 01533 01534 /*! 01535 * \brief Retrieve quality statistics about an RTP instance 01536 * 01537 * \param instance Instance to get statistics on 01538 * \param field What quality statistic to retrieve 01539 * \param buf What buffer to put the result into 01540 * \param size Size of the above buffer 01541 * 01542 * \retval non-NULL success 01543 * \retval NULL failure 01544 * 01545 * Example usage: 01546 * 01547 * \code 01548 * char quality[AST_MAX_USER_FIELD]; 01549 * ast_rtp_instance_get_quality(instance, AST_RTP_INSTANCE_STAT_FIELD_QUALITY, &buf, sizeof(buf)); 01550 * \endcode 01551 * 01552 * This retrieves general quality statistics and places a text representation into the buf pointed to by buf. 01553 * 01554 * \since 1.8 01555 */ 01556 char *ast_rtp_instance_get_quality(struct ast_rtp_instance *instance, enum ast_rtp_instance_stat_field field, char *buf, size_t size); 01557 01558 /*! 01559 * \brief Request that the underlying RTP engine provide audio frames in a specific format 01560 * 01561 * \param instance The RTP instance to change read format on 01562 * \param format Format that frames are wanted in 01563 * 01564 * \retval 0 success 01565 * \retval -1 failure 01566 * 01567 * Example usage: 01568 * 01569 * \code 01570 * struct ast_format tmp_fmt; 01571 * ast_rtp_instance_set_read_format(instance, ast_format_set(&tmp_fmt, AST_FORMAT_ULAW, 0)); 01572 * \endcode 01573 * 01574 * This requests that the RTP engine provide audio frames in the ULAW format. 01575 * 01576 * \since 1.8 01577 */ 01578 int ast_rtp_instance_set_read_format(struct ast_rtp_instance *instance, struct ast_format *format); 01579 01580 /*! 01581 * \brief Tell underlying RTP engine that audio frames will be provided in a specific format 01582 * 01583 * \param instance The RTP instance to change write format on 01584 * \param format Format that frames will be provided in 01585 * 01586 * \retval 0 success 01587 * \retval -1 failure 01588 * 01589 * Example usage: 01590 * 01591 * \code 01592 * struct ast_format tmp_fmt; 01593 * ast_rtp_instance_set_write_format(instance, ast_format_set(&tmp_fmt, AST_FORMAT_ULAW, 0)); 01594 * \endcode 01595 * 01596 * This tells the underlying RTP engine that audio frames will be provided to it in ULAW format. 01597 * 01598 * \since 1.8 01599 */ 01600 int ast_rtp_instance_set_write_format(struct ast_rtp_instance *instance, struct ast_format *format); 01601 01602 /*! 01603 * \brief Request that the underlying RTP engine make two RTP instances compatible with eachother 01604 * 01605 * \param chan Our own Asterisk channel 01606 * \param instance The first RTP instance 01607 * \param peer The peer Asterisk channel 01608 * 01609 * \retval 0 success 01610 * \retval -1 failure 01611 * 01612 * Example usage: 01613 * 01614 * \code 01615 * ast_rtp_instance_make_compatible(instance, peer); 01616 * \endcode 01617 * 01618 * This makes the RTP instance for 'peer' compatible with 'instance' and vice versa. 01619 * 01620 * \since 1.8 01621 */ 01622 int ast_rtp_instance_make_compatible(struct ast_channel *chan, struct ast_rtp_instance *instance, struct ast_channel *peer); 01623 01624 /*! \brief Request the formats that can be transcoded 01625 * 01626 * \param instance The RTP instance 01627 * \param to_endpoint Formats being sent/received towards the endpoint 01628 * \param to_asterisk Formats being sent/received towards Asterisk 01629 * \param result capabilities structure to store and return supported formats in. 01630 * 01631 * Example usage: 01632 * 01633 * \code 01634 * ast_rtp_instance_available_formats(instance, to_capabilities, from_capabilities, result_capabilities); 01635 * \endcode 01636 * 01637 * This sees if it is possible to have ulaw communicated to the endpoint but signed linear received into Asterisk. 01638 * 01639 * \since 1.8 01640 */ 01641 void ast_rtp_instance_available_formats(struct ast_rtp_instance *instance, struct ast_format_cap *to_endpoint, struct ast_format_cap *to_asterisk, struct ast_format_cap *result); 01642 01643 /*! 01644 * \brief Indicate to the RTP engine that packets are now expected to be sent/received on the RTP instance 01645 * 01646 * \param instance The RTP instance 01647 * 01648 * \retval 0 success 01649 * \retval -1 failure 01650 * 01651 * Example usage: 01652 * 01653 * \code 01654 * ast_rtp_instance_activate(instance); 01655 * \endcode 01656 * 01657 * This tells the underlying RTP engine of instance that packets will now flow. 01658 * 01659 * \since 1.8 01660 */ 01661 int ast_rtp_instance_activate(struct ast_rtp_instance *instance); 01662 01663 /*! 01664 * \brief Request that the underlying RTP engine send a STUN BIND request 01665 * 01666 * \param instance The RTP instance 01667 * \param suggestion The suggested destination 01668 * \param username Optionally a username for the request 01669 * 01670 * Example usage: 01671 * 01672 * \code 01673 * ast_rtp_instance_stun_request(instance, NULL, NULL); 01674 * \endcode 01675 * 01676 * This requests that the RTP engine send a STUN BIND request on the session pointed to by 01677 * 'instance'. 01678 * 01679 * \since 1.8 01680 */ 01681 void ast_rtp_instance_stun_request(struct ast_rtp_instance *instance, struct ast_sockaddr *suggestion, const char *username); 01682 01683 /*! 01684 * \brief Set the RTP timeout value 01685 * 01686 * \param instance The RTP instance 01687 * \param timeout Value to set the timeout to 01688 * 01689 * Example usage: 01690 * 01691 * \code 01692 * ast_rtp_instance_set_timeout(instance, 5000); 01693 * \endcode 01694 * 01695 * This sets the RTP timeout value on 'instance' to be 5000. 01696 * 01697 * \since 1.8 01698 */ 01699 void ast_rtp_instance_set_timeout(struct ast_rtp_instance *instance, int timeout); 01700 01701 /*! 01702 * \brief Set the RTP timeout value for when the instance is on hold 01703 * 01704 * \param instance The RTP instance 01705 * \param timeout Value to set the timeout to 01706 * 01707 * Example usage: 01708 * 01709 * \code 01710 * ast_rtp_instance_set_hold_timeout(instance, 5000); 01711 * \endcode 01712 * 01713 * This sets the RTP hold timeout value on 'instance' to be 5000. 01714 * 01715 * \since 1.8 01716 */ 01717 void ast_rtp_instance_set_hold_timeout(struct ast_rtp_instance *instance, int timeout); 01718 01719 /*! 01720 * \brief Set the RTP keepalive interval 01721 * 01722 * \param instance The RTP instance 01723 * \param period Value to set the keepalive interval to 01724 * 01725 * Example usage: 01726 * 01727 * \code 01728 * ast_rtp_instance_set_keepalive(instance, 5000); 01729 * \endcode 01730 * 01731 * This sets the RTP keepalive interval on 'instance' to be 5000. 01732 * 01733 * \since 1.8 01734 */ 01735 void ast_rtp_instance_set_keepalive(struct ast_rtp_instance *instance, int timeout); 01736 01737 /*! 01738 * \brief Get the RTP timeout value 01739 * 01740 * \param instance The RTP instance 01741 * 01742 * \retval timeout value 01743 * 01744 * Example usage: 01745 * 01746 * \code 01747 * int timeout = ast_rtp_instance_get_timeout(instance); 01748 * \endcode 01749 * 01750 * This gets the RTP timeout value for the RTP instance pointed to by 'instance'. 01751 * 01752 * \since 1.8 01753 */ 01754 int ast_rtp_instance_get_timeout(struct ast_rtp_instance *instance); 01755 01756 /*! 01757 * \brief Get the RTP timeout value for when an RTP instance is on hold 01758 * 01759 * \param instance The RTP instance 01760 * 01761 * \retval timeout value 01762 * 01763 * Example usage: 01764 * 01765 * \code 01766 * int timeout = ast_rtp_instance_get_hold_timeout(instance); 01767 * \endcode 01768 * 01769 * This gets the RTP hold timeout value for the RTP instance pointed to by 'instance'. 01770 * 01771 * \since 1.8 01772 */ 01773 int ast_rtp_instance_get_hold_timeout(struct ast_rtp_instance *instance); 01774 01775 /*! 01776 * \brief Get the RTP keepalive interval 01777 * 01778 * \param instance The RTP instance 01779 * 01780 * \retval period Keepalive interval value 01781 * 01782 * Example usage: 01783 * 01784 * \code 01785 * int interval = ast_rtp_instance_get_keepalive(instance); 01786 * \endcode 01787 * 01788 * This gets the RTP keepalive interval value for the RTP instance pointed to by 'instance'. 01789 * 01790 * \since 1.8 01791 */ 01792 int ast_rtp_instance_get_keepalive(struct ast_rtp_instance *instance); 01793 01794 /*! 01795 * \brief Get the RTP engine in use on an RTP instance 01796 * 01797 * \param instance The RTP instance 01798 * 01799 * \retval pointer to the engine 01800 * 01801 * Example usage: 01802 * 01803 * \code 01804 * struct ast_rtp_engine *engine = ast_rtp_instance_get_engine(instance); 01805 * \endcode 01806 * 01807 * This gets the RTP engine currently in use on the RTP instance pointed to by 'instance'. 01808 * 01809 * \since 1.8 01810 */ 01811 struct ast_rtp_engine *ast_rtp_instance_get_engine(struct ast_rtp_instance *instance); 01812 01813 /*! 01814 * \brief Get the RTP glue in use on an RTP instance 01815 * 01816 * \param instance The RTP instance 01817 * 01818 * \retval pointer to the glue 01819 * 01820 * Example: 01821 * 01822 * \code 01823 * struct ast_rtp_glue *glue = ast_rtp_instance_get_active_glue(instance); 01824 * \endcode 01825 * 01826 * This gets the RTP glue currently in use on the RTP instance pointed to by 'instance'. 01827 * 01828 * \since 1.8 01829 */ 01830 struct ast_rtp_glue *ast_rtp_instance_get_active_glue(struct ast_rtp_instance *instance); 01831 01832 /*! 01833 * \brief Get the channel that is associated with an RTP instance while in a bridge 01834 * 01835 * \param instance The RTP instance 01836 * 01837 * \retval pointer to the channel 01838 * 01839 * Example: 01840 * 01841 * \code 01842 * struct ast_channel *chan = ast_rtp_instance_get_chan(instance); 01843 * \endcode 01844 * 01845 * This gets the channel associated with the RTP instance pointed to by 'instance'. 01846 * 01847 * \note This will only return a channel while in a local or remote bridge. 01848 * 01849 * \since 1.8 01850 */ 01851 struct ast_channel *ast_rtp_instance_get_chan(struct ast_rtp_instance *instance); 01852 01853 /*! 01854 * \brief Send a comfort noise packet to the RTP instance 01855 * 01856 * \param instance The RTP instance 01857 * \param level Magnitude of the noise level 01858 * 01859 * \retval 0 Success 01860 * \retval non-zero Failure 01861 */ 01862 int ast_rtp_instance_sendcng(struct ast_rtp_instance *instance, int level); 01863 01864 int ast_rtp_instance_add_srtp_policy(struct ast_rtp_instance *instance, struct ast_srtp_policy *policy); 01865 struct ast_srtp *ast_rtp_instance_get_srtp(struct ast_rtp_instance *instance); 01866 01867 /*! \brief Custom formats declared in codecs.conf at startup must be communicated to the rtp_engine 01868 * so their mime type can payload number can be initialized. */ 01869 int ast_rtp_engine_load_format(const struct ast_format *format); 01870 01871 /*! \brief Formats requiring the use of a format attribute interface must have that 01872 * interface registered in order for the rtp engine to handle it correctly. If an 01873 * attribute interface is unloaded, this function must be called to notify the rtp_engine. */ 01874 int ast_rtp_engine_unload_format(const struct ast_format *format); 01875 01876 #if defined(__cplusplus) || defined(c_plusplus) 01877 } 01878 #endif 01879 01880 #endif /* _ASTERISK_RTP_ENGINE_H */
1.5.6