00001 /* 00002 The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 00003 Copyright (C) 2001,2002,2003,2004 Aymeric MOIZARD jack@atosc.org 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 */ 00019 00020 #ifndef __SDP_RFC3264_H__ 00021 #define __SDP_RFC3264_H__ 00022 00023 #include <osipparser2/osip_list.h> 00024 #include <osipparser2/sdp_message.h> 00025 00037 #ifdef __cplusplus 00038 extern "C" 00039 { 00040 #endif 00041 00046 struct osip_rfc3264; 00047 00052 #define MAX_AUDIO_CODECS 100 00053 00057 #define MAX_VIDEO_CODECS 100 00058 00062 #define MAX_T38_CODECS 2 00063 00067 #define MAX_APP_CODECS 100 00068 00073 int osip_rfc3264_init (struct osip_rfc3264 **config); 00074 00079 void osip_rfc3264_free (struct osip_rfc3264 *config); 00080 00086 int osip_rfc3264_endof_media (struct osip_rfc3264 *config, int pos); 00087 00093 sdp_media_t *osip_rfc3264_get (struct osip_rfc3264 *config, int pos); 00094 00100 int osip_rfc3264_remove (struct osip_rfc3264 *config, int pos); 00101 00106 int osip_rfc3264_reset_media (struct osip_rfc3264 *config); 00107 00114 int osip_rfc3264_add_audio_media (struct osip_rfc3264 *config, sdp_media_t *med, int pos); 00115 00121 int osip_rfc3264_del_audio_media (struct osip_rfc3264 *config, int pos); 00122 00129 int osip_rfc3264_add_t38_media (struct osip_rfc3264 *config, sdp_media_t *med, int pos); 00130 00136 int osip_rfc3264_del_t38_media (struct osip_rfc3264 *config, int pos); 00137 00144 int osip_rfc3264_add_video_media (struct osip_rfc3264 *config, sdp_media_t *med, int pos); 00145 00151 int osip_rfc3264_del_video_media (struct osip_rfc3264 *config, int pos); 00152 00153 00158 sdp_media_t *osip_rfc3264_find_audio (struct osip_rfc3264 *config, char *payload, 00159 char *rtpmap); 00160 00167 sdp_media_t *osip_rfc3264_find_video (struct osip_rfc3264 *config, char *payload, 00168 char *rtpmap); 00169 00175 sdp_media_t *osip_rfc3264_find_t38 (struct osip_rfc3264 *config, char *payload); 00176 00182 sdp_media_t *osip_rfc3264_find_app (struct osip_rfc3264 *config, char *payload); 00183 00196 int osip_rfc3264_match(struct osip_rfc3264 *config, 00197 sdp_message_t *remote_sdp, 00198 sdp_media_t *audio_tab[], 00199 sdp_media_t *video_tab[], 00200 sdp_media_t *t38_tab[], 00201 sdp_media_t *app_tab[], 00202 int pos_media); 00203 00211 int osip_rfc3264_match_audio(struct osip_rfc3264 *config, 00212 sdp_message_t *remote_sdp, 00213 sdp_media_t *remote_med, 00214 sdp_media_t *audio_tab[]); 00215 00223 int osip_rfc3264_match_video(struct osip_rfc3264 *config, 00224 sdp_message_t *remote_sdp, 00225 sdp_media_t *remote_med, 00226 sdp_media_t *video_tab[]); 00227 00235 int osip_rfc3264_match_t38(struct osip_rfc3264 *config, 00236 sdp_message_t *remote_sdp, 00237 sdp_media_t *remote_med, 00238 sdp_media_t *t38_tab[]); 00239 00247 int osip_rfc3264_match_app(struct osip_rfc3264 *config, 00248 sdp_message_t *remote_sdp, 00249 sdp_media_t *remote_med, 00250 sdp_media_t *app_tab[]); 00251 00252 00260 int osip_rfc3264_prepare_answer(struct osip_rfc3264 *config, 00261 sdp_message_t *remote_sdp, 00262 char *local_sdp, int length); 00263 00275 int 00276 osip_rfc3264_complete_answer(struct osip_rfc3264 *config, 00277 sdp_message_t *remote_sdp, 00278 sdp_message_t *local_sdp, 00279 sdp_media_t *med, 00280 int mline); 00281 00292 int osip_rfc3264_accept_codec(struct osip_rfc3264 *config, 00293 sdp_media_t *med, 00294 sdp_message_t *remote_sdp, 00295 sdp_message_t *local_sdp); 00296 00297 00303 int __osip_rfc3264_print_codecs(struct osip_rfc3264 *config); 00304 00305 00306 #ifdef __cplusplus 00307 } 00308 #endif 00309 00310 #endif