1 /* 2 belle-sdp - SIP (RFC4566) library. 3 Copyright (C) 2010 Belledonne Communications SARL 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef BELLE_SDP_H_ 20 #define BELLE_SDP_H_ 21 22 #include "belle-sip/defs.h" 23 #include "belle-sip/list.h" 24 25 #define BELLE_SDP_CAST(obj,t) BELLE_SIP_CAST(obj,t) 26 27 BELLE_SIP_BEGIN_DECLS 28 29 /*************************************************************************************** 30 * Attribute 31 * 32 **************************************************************************************/ 33 typedef struct _belle_sdp_attribute belle_sdp_attribute_t; 34 BELLESIP_EXPORT belle_sdp_attribute_t* belle_sdp_attribute_new(void); 35 BELLESIP_EXPORT belle_sdp_attribute_t* belle_sdp_attribute_parse (const char* attribute); 36 BELLESIP_EXPORT belle_sdp_attribute_t* belle_sdp_attribute_create (const char* name,const char* value); 37 BELLESIP_EXPORT const char* belle_sdp_attribute_get_name(const belle_sdp_attribute_t* attribute); 38 BELLESIP_EXPORT void belle_sdp_attribute_set_name(belle_sdp_attribute_t* attribute, const char* name); 39 BELLESIP_EXPORT const char* belle_sdp_attribute_get_value(belle_sdp_attribute_t* attribute); 40 BELLESIP_EXPORT unsigned int belle_sdp_attribute_has_value(belle_sdp_attribute_t* attribute); 41 #define BELLE_SDP_ATTRIBUTE(t) BELLE_SDP_CAST(t,belle_sdp_attribute_t) 42 #define belle_sdp_attribute_init(obj) /*nothing*/ 43 /*************************************************************************************** 44 * RAW Attribute 45 * 46 **************************************************************************************/ 47 typedef struct _belle_sdp_raw_attribute belle_sdp_raw_attribute_t; 48 BELLESIP_EXPORT belle_sdp_raw_attribute_t* belle_sdp_raw_attribute_new(void); 49 BELLESIP_EXPORT belle_sdp_raw_attribute_t* belle_sdp_raw_attribute_parse(const char* attribute); 50 BELLESIP_EXPORT belle_sdp_raw_attribute_t* belle_sdp_raw_attribute_create(const char* name, const char* value); 51 BELLESIP_EXPORT void belle_sdp_raw_attribute_set_value(belle_sdp_raw_attribute_t* attribute, const char* value); 52 #define BELLE_SDP_RAW_ATTRIBUTE(t) BELLE_SDP_CAST(t,belle_sdp_raw_attribute_t) 53 /*************************************************************************************** 54 * RTCP-FB Attribute 55 * 56 **************************************************************************************/ 57 typedef enum _belle_sdp_rtcp_fb_val_type { 58 BELLE_SDP_RTCP_FB_ACK, 59 BELLE_SDP_RTCP_FB_NACK, 60 BELLE_SDP_RTCP_FB_TRR_INT, 61 BELLE_SDP_RTCP_FB_CCM 62 } belle_sdp_rtcp_fb_val_type_t; 63 typedef enum _belle_sdp_rtcp_fb_val_param { 64 BELLE_SDP_RTCP_FB_NONE, 65 BELLE_SDP_RTCP_FB_PLI, 66 BELLE_SDP_RTCP_FB_SLI, 67 BELLE_SDP_RTCP_FB_RPSI, 68 BELLE_SDP_RTCP_FB_APP, 69 BELLE_SDP_RTCP_FB_FIR, 70 BELLE_SDP_RTCP_FB_TMMBR 71 } belle_sdp_rtcp_fb_val_param_t; 72 typedef struct _belle_sdp_rtcp_fb_attribute belle_sdp_rtcp_fb_attribute_t; 73 BELLESIP_EXPORT belle_sdp_rtcp_fb_attribute_t* belle_sdp_rtcp_fb_attribute_new(void); 74 BELLESIP_EXPORT belle_sdp_rtcp_fb_attribute_t* belle_sdp_rtcp_fb_attribute_parse(const char* attribute); 75 BELLESIP_EXPORT belle_sdp_rtcp_fb_attribute_t* belle_sdp_rtcp_fb_attribute_create(void); 76 BELLESIP_EXPORT int8_t belle_sdp_rtcp_fb_attribute_get_id(const belle_sdp_rtcp_fb_attribute_t* attribute); 77 BELLESIP_EXPORT void belle_sdp_rtcp_fb_attribute_set_id(belle_sdp_rtcp_fb_attribute_t* attribute, int8_t id); 78 BELLESIP_EXPORT belle_sdp_rtcp_fb_val_type_t belle_sdp_rtcp_fb_attribute_get_type(const belle_sdp_rtcp_fb_attribute_t* attribute); 79 BELLESIP_EXPORT void belle_sdp_rtcp_fb_attribute_set_type(belle_sdp_rtcp_fb_attribute_t* attribute, belle_sdp_rtcp_fb_val_type_t type); 80 BELLESIP_EXPORT belle_sdp_rtcp_fb_val_param_t belle_sdp_rtcp_fb_attribute_get_param(const belle_sdp_rtcp_fb_attribute_t* attribute); 81 BELLESIP_EXPORT void belle_sdp_rtcp_fb_attribute_set_param(belle_sdp_rtcp_fb_attribute_t* attribute, belle_sdp_rtcp_fb_val_param_t param); 82 BELLESIP_EXPORT uint16_t belle_sdp_rtcp_fb_attribute_get_trr_int(const belle_sdp_rtcp_fb_attribute_t* attribute); 83 BELLESIP_EXPORT void belle_sdp_rtcp_fb_attribute_set_trr_int(belle_sdp_rtcp_fb_attribute_t* attribute, uint16_t milliseconds); 84 BELLESIP_EXPORT uint32_t belle_sdp_rtcp_fb_attribute_get_smaxpr(const belle_sdp_rtcp_fb_attribute_t* attribute); 85 BELLESIP_EXPORT void belle_sdp_rtcp_fb_attribute_set_smaxpr(belle_sdp_rtcp_fb_attribute_t* attribute, uint32_t smaxpr); 86 #define BELLE_SDP_RTCP_FB_ATTRIBUTE(t) BELLE_SDP_CAST(t,belle_sdp_rtcp_fb_attribute_t) 87 /*************************************************************************************** 88 * RTCP-XR Attribute 89 * 90 **************************************************************************************/ 91 typedef struct _belle_sdp_rtcp_xr_attribute belle_sdp_rtcp_xr_attribute_t; 92 BELLESIP_EXPORT belle_sdp_rtcp_xr_attribute_t* belle_sdp_rtcp_xr_attribute_new(void); 93 BELLESIP_EXPORT belle_sdp_rtcp_xr_attribute_t* belle_sdp_rtcp_xr_attribute_parse(const char* attribute); 94 BELLESIP_EXPORT belle_sdp_rtcp_xr_attribute_t* belle_sdp_rtcp_xr_attribute_create(void); 95 BELLESIP_EXPORT const char* belle_sdp_rtcp_xr_attribute_get_rcvr_rtt_mode(const belle_sdp_rtcp_xr_attribute_t* attribute); 96 BELLESIP_EXPORT void belle_sdp_rtcp_xr_attribute_set_rcvr_rtt_mode(belle_sdp_rtcp_xr_attribute_t* attribute, const char *mode); 97 BELLESIP_EXPORT int belle_sdp_rtcp_xr_attribute_get_rcvr_rtt_max_size(const belle_sdp_rtcp_xr_attribute_t* attribute); 98 BELLESIP_EXPORT void belle_sdp_rtcp_xr_attribute_set_rcvr_rtt_max_size(belle_sdp_rtcp_xr_attribute_t* attribute, int max_size); 99 BELLESIP_EXPORT unsigned int belle_sdp_rtcp_xr_attribute_has_stat_summary(const belle_sdp_rtcp_xr_attribute_t* attribute); 100 BELLESIP_EXPORT void belle_sdp_rtcp_xr_attribute_set_stat_summary(belle_sdp_rtcp_xr_attribute_t* attribute, unsigned int enable); 101 BELLESIP_EXPORT const belle_sip_list_t* belle_sdp_rtcp_xr_attribute_get_stat_summary_flags(const belle_sdp_rtcp_xr_attribute_t* attribute); 102 BELLESIP_EXPORT void belle_sdp_rtcp_xr_attribute_add_stat_summary_flag(belle_sdp_rtcp_xr_attribute_t* attribute, const char* flag); 103 BELLESIP_EXPORT unsigned int belle_sdp_rtcp_xr_attribute_has_voip_metrics(const belle_sdp_rtcp_xr_attribute_t* attribute); 104 BELLESIP_EXPORT void belle_sdp_rtcp_xr_attribute_set_voip_metrics(belle_sdp_rtcp_xr_attribute_t* attribute, unsigned int enable); 105 #define BELLE_SDP_RTCP_XR_ATTRIBUTE(t) BELLE_SDP_CAST(t,belle_sdp_rtcp_xr_attribute_t) 106 /*************************************************************************************** 107 * Bandwidth 108 * 109 **************************************************************************************/ 110 typedef struct _belle_sdp_bandwidth belle_sdp_bandwidth_t; 111 BELLESIP_EXPORT belle_sdp_bandwidth_t* belle_sdp_bandwidth_new(void); 112 BELLESIP_EXPORT belle_sdp_bandwidth_t* belle_sdp_bandwidth_parse (const char* bandwidth); 113 BELLESIP_EXPORT int belle_sdp_bandwidth_get_value(const belle_sdp_bandwidth_t* attribute); 114 BELLESIP_EXPORT const char* belle_sdp_bandwidth_get_type(const belle_sdp_bandwidth_t* attribute); 115 BELLESIP_EXPORT void belle_sdp_bandwidth_set_value(belle_sdp_bandwidth_t* attribute, int value); 116 BELLESIP_EXPORT void belle_sdp_bandwidth_set_type(belle_sdp_bandwidth_t* attribute, const char* type); 117 #define BELLE_SDP_BANDWIDTH(t) BELLE_SDP_CAST(t,belle_sdp_bandwidth_t) 118 /*************************************************************************************** 119 * Connection 120 * 121 **************************************************************************************/ 122 typedef struct _belle_sdp_connection belle_sdp_connection_t; 123 BELLESIP_EXPORT belle_sdp_connection_t* belle_sdp_connection_new(void); 124 BELLESIP_EXPORT belle_sdp_connection_t* belle_sdp_connection_create(const char* net_type, const char* addr_type, const char* addr); 125 BELLESIP_EXPORT belle_sdp_connection_t* belle_sdp_connection_parse (const char* connection); 126 BELLESIP_EXPORT const char* belle_sdp_connection_get_address(const belle_sdp_connection_t* connection); 127 BELLESIP_EXPORT const char* belle_sdp_connection_get_address_type(const belle_sdp_connection_t* connection); 128 BELLESIP_EXPORT const char* belle_sdp_connection_get_network_type(const belle_sdp_connection_t* connection); 129 BELLESIP_EXPORT int belle_sdp_connection_get_ttl(const belle_sdp_connection_t* connection); 130 BELLESIP_EXPORT int belle_sdp_connection_get_range(const belle_sdp_connection_t* connection); 131 BELLESIP_EXPORT void belle_sdp_connection_set_address(belle_sdp_connection_t* connection, const char* addr); 132 BELLESIP_EXPORT void belle_sdp_connection_set_address_type(belle_sdp_connection_t* connection, const char* type); 133 BELLESIP_EXPORT void belle_sdp_connection_set_network_type(belle_sdp_connection_t* connection, const char* type); 134 BELLESIP_EXPORT void belle_sdp_connection_set_ttl(belle_sdp_connection_t* connection,int ttl); 135 BELLESIP_EXPORT void belle_sdp_connection_set_range(belle_sdp_connection_t* connection,int range); 136 #define BELLE_SDP_CONNECTION(t) BELLE_SDP_CAST(t,belle_sdp_connection_t) 137 /*************************************************************************************** 138 * Email 139 * 140 **************************************************************************************/ 141 typedef struct _belle_sdp_email belle_sdp_email_t; 142 BELLESIP_EXPORT belle_sdp_email_t* belle_sdp_email_new(void); 143 BELLESIP_EXPORT belle_sdp_email_t* belle_sdp_email_parse (const char* email); 144 BELLESIP_EXPORT const char* belle_sdp_email_get_value(const belle_sdp_email_t* email); 145 BELLESIP_EXPORT void belle_sdp_email_set_value(belle_sdp_email_t* email, const char* value); 146 #define BELLE_SDP_EMAIL(t) BELLE_SDP_CAST(t,belle_sdp_email_t) 147 /*************************************************************************************** 148 * Info 149 * 150 **************************************************************************************/ 151 typedef struct _belle_sdp_info belle_sdp_info_t; 152 BELLESIP_EXPORT belle_sdp_info_t* belle_sdp_info_new(void); 153 BELLESIP_EXPORT belle_sdp_info_t* belle_sdp_info_parse (const char* info); 154 BELLESIP_EXPORT const char* belle_sdp_info_get_value(const belle_sdp_info_t* info); 155 BELLESIP_EXPORT void belle_sdp_info_set_value(belle_sdp_info_t* info, const char* value); 156 #define BELLE_SDP_INFO(t) BELLE_SDP_CAST(t,belle_sdp_info_t) 157 /*************************************************************************************** 158 * Key 159 * 160 **************************************************************************************/ 161 //typedef struct _belle_sdp_key belle_sdp_key_t; 162 //belle_sdp_key_t* belle_sdp_key_new(void); 163 //belle_sdp_key_t* belle_sdp_key_parse (const char* key); 164 //const char* belle_sdp_key_get_key(const belle_sdp_key_t* key); 165 //const char* belle_sdp_key_get_method(const belle_sdp_key_t* key); 166 //unsigned int belle_sdp_key_as_key(const belle_sdp_key_t* key); 167 //void belle_sdp_key_set_key(belle_sdp_key_t* key, const char* keyvalue); 168 //void belle_sdp_key_set_method(belle_sdp_key_t* key, const char* method); 169 //#define BELLE_SDP_KEY(t) BELLE_SDP_CAST(t,belle_sdp_key_t); 170 /*************************************************************************************** 171 * Media 172 * 173 **************************************************************************************/ 174 typedef struct _belle_sdp_media belle_sdp_media_t; 175 BELLESIP_EXPORT belle_sdp_media_t* belle_sdp_media_new(void); 176 BELLESIP_EXPORT belle_sdp_media_t* belle_sdp_media_parse (const char* media); 177 BELLESIP_EXPORT belle_sdp_media_t* belle_sdp_media_create(const char* media_type 178 ,int media_port 179 ,int port_count 180 ,const char* protocol 181 ,belle_sip_list_t* static_media_formats); 182 BELLESIP_EXPORT belle_sip_list_t* belle_sdp_media_get_media_formats(const belle_sdp_media_t* media); 183 BELLESIP_EXPORT const char* belle_sdp_media_get_raw_fmt(const belle_sdp_media_t* media); 184 BELLESIP_EXPORT int belle_sdp_media_get_media_port(const belle_sdp_media_t* media); 185 BELLESIP_EXPORT const char* belle_sdp_media_get_media_type(const belle_sdp_media_t* media); 186 BELLESIP_EXPORT int belle_sdp_media_get_port_count(const belle_sdp_media_t* media); 187 BELLESIP_EXPORT const char* belle_sdp_media_get_protocol(const belle_sdp_media_t* media); 188 BELLESIP_EXPORT void belle_sdp_media_set_media_formats(belle_sdp_media_t* media, belle_sip_list_t* mediaFormats); 189 BELLESIP_EXPORT void belle_sdp_media_set_raw_fmt(belle_sdp_media_t* media, const char* fmt); 190 BELLESIP_EXPORT void belle_sdp_media_set_media_port(belle_sdp_media_t* media, int port); 191 BELLESIP_EXPORT void belle_sdp_media_set_media_type(belle_sdp_media_t* media, const char* mediaType); 192 BELLESIP_EXPORT void belle_sdp_media_set_port_count(belle_sdp_media_t* media, int port_count); 193 BELLESIP_EXPORT void belle_sdp_media_set_protocol(belle_sdp_media_t* media, const char* protocole); 194 #define BELLE_SDP_MEDIA(t) BELLE_SDP_CAST(t,belle_sdp_media_t) 195 196 /*************************************************************************************** 197 * mime_parameter 198 * 199 **************************************************************************************/ 200 typedef struct _belle_sdp_mime_parameter belle_sdp_mime_parameter_t; 201 BELLESIP_EXPORT belle_sdp_mime_parameter_t* belle_sdp_mime_parameter_new(void); 202 BELLESIP_EXPORT belle_sdp_mime_parameter_t* belle_sdp_mime_parameter_create(const char* type, int media_format, int rate,int channel_count); 203 BELLESIP_EXPORT int belle_sdp_mime_parameter_get_rate(const belle_sdp_mime_parameter_t* mime_parameter); 204 BELLESIP_EXPORT void belle_sdp_mime_parameter_set_rate(belle_sdp_mime_parameter_t* mime_parameter,int rate); 205 BELLESIP_EXPORT int belle_sdp_mime_parameter_get_channel_count(const belle_sdp_mime_parameter_t* mime_parameter); 206 BELLESIP_EXPORT void belle_sdp_mime_parameter_set_channel_count(belle_sdp_mime_parameter_t* mime_parameter,int count); 207 BELLESIP_EXPORT int belle_sdp_mime_parameter_get_ptime(const belle_sdp_mime_parameter_t* mime_parameter); 208 BELLESIP_EXPORT void belle_sdp_mime_parameter_set_ptime(belle_sdp_mime_parameter_t* mime_parameter,int ptime); 209 BELLESIP_EXPORT int belle_sdp_mime_parameter_get_max_ptime(const belle_sdp_mime_parameter_t* mime_parameter); 210 BELLESIP_EXPORT void belle_sdp_mime_parameter_set_max_ptime(belle_sdp_mime_parameter_t* mime_parameter,int max_ptime); 211 BELLESIP_EXPORT const char* belle_sdp_mime_parameter_get_type(const belle_sdp_mime_parameter_t* mime_parameter); 212 BELLESIP_EXPORT void belle_sdp_mime_parameter_set_type(belle_sdp_mime_parameter_t* mime_parameter,const char* type); 213 BELLESIP_EXPORT int belle_sdp_mime_parameter_get_media_format(const belle_sdp_mime_parameter_t* mime_parameter); 214 BELLESIP_EXPORT void belle_sdp_mime_parameter_set_media_format(belle_sdp_mime_parameter_t* mime_parameter,int format); 215 BELLESIP_EXPORT const char* belle_sdp_mime_parameter_get_parameters(const belle_sdp_mime_parameter_t* mime_parameter); 216 BELLESIP_EXPORT void belle_sdp_mime_parameter_set_parameters(belle_sdp_mime_parameter_t* mime_parameter,const char* parameters); 217 #define BELLE_SDP_MIME_PARAMETER(t) BELLE_SDP_CAST(t,belle_sdp_mime_parameter_t) 218 219 /*************************************************************************************** 220 * Media Description 221 * 222 **************************************************************************************/ 223 typedef struct _belle_sdp_media_description belle_sdp_media_description_t; 224 BELLESIP_EXPORT belle_sdp_media_description_t* belle_sdp_media_description_new(void); 225 BELLESIP_EXPORT belle_sdp_media_description_t* belle_sdp_media_description_parse (const char* media_description); 226 BELLESIP_EXPORT belle_sdp_media_description_t* belle_sdp_media_description_create(const char* media_type 227 ,int media_port 228 ,int port_count 229 ,const char* protocol 230 ,belle_sip_list_t* static_media_formats); 231 BELLESIP_EXPORT void belle_sdp_media_description_add_dynamic_payloads(belle_sdp_media_description_t* media_description, belle_sip_list_t* payloadNames, belle_sip_list_t* payloadValues); 232 BELLESIP_EXPORT const char* belle_sdp_media_description_get_attribute_value(const belle_sdp_media_description_t* media_description, const char* name); 233 BELLESIP_EXPORT belle_sdp_attribute_t* belle_sdp_media_description_get_attribute(const belle_sdp_media_description_t* media_description, const char* name); 234 BELLESIP_EXPORT belle_sip_list_t* belle_sdp_media_description_get_attributes(const belle_sdp_media_description_t* media_description); 235 BELLESIP_EXPORT int belle_sdp_media_description_get_bandwidth(const belle_sdp_media_description_t* media_description, const char* name); 236 BELLESIP_EXPORT belle_sip_list_t* belle_sdp_media_description_get_bandwidths(const belle_sdp_media_description_t* media_description); 237 BELLESIP_EXPORT belle_sdp_connection_t* belle_sdp_media_description_get_connection(const belle_sdp_media_description_t* media_description); 238 BELLESIP_EXPORT belle_sdp_info_t* belle_sdp_media_description_get_info(const belle_sdp_media_description_t* media_description); 239 /*belle_sdp_key_t* belle_sdp_media_description_get_key(const belle_sdp_media_description_t* media_description);*/ 240 BELLESIP_EXPORT belle_sdp_media_t* belle_sdp_media_description_get_media(const belle_sdp_media_description_t* media_description); 241 BELLESIP_EXPORT belle_sip_list_t* belle_sdp_media_description_build_mime_parameters(const belle_sdp_media_description_t* media_description); 242 /*belle_sip_list_t* belle_sdp_media_description_get_mime_types(const belle_sdp_media_description_t* media_description);*/ 243 BELLESIP_EXPORT void belle_sdp_media_description_remove_attribute(belle_sdp_media_description_t* media_description,const char* attribute); 244 BELLESIP_EXPORT void belle_sdp_media_description_remove_bandwidth(belle_sdp_media_description_t* media_description,const char* bandwidth); 245 BELLESIP_EXPORT void belle_sdp_media_description_set_attribute_value(belle_sdp_media_description_t* media_description, const char* name, const char* value); 246 BELLESIP_EXPORT void belle_sdp_media_description_add_attribute(belle_sdp_media_description_t* media_description, const belle_sdp_attribute_t* attr); 247 BELLESIP_EXPORT void belle_sdp_media_description_set_attributes(belle_sdp_media_description_t* media_description, belle_sip_list_t* Attributes); 248 BELLESIP_EXPORT void belle_sdp_media_description_set_bandwidth(belle_sdp_media_description_t* media_description, const char* name, int value); 249 BELLESIP_EXPORT void belle_sdp_media_description_add_bandwidth(belle_sdp_media_description_t* media_description, const belle_sdp_bandwidth_t* bandwidth); 250 BELLESIP_EXPORT void belle_sdp_media_description_set_bandwidths(belle_sdp_media_description_t* media_description, belle_sip_list_t* bandwidths); 251 BELLESIP_EXPORT void belle_sdp_media_description_set_connection(belle_sdp_media_description_t* media_description, belle_sdp_connection_t* conn); 252 BELLESIP_EXPORT void belle_sdp_media_description_set_info(belle_sdp_media_description_t* media_description,belle_sdp_info_t* i); 253 /*void belle_sdp_media_description_set_key(belle_sdp_media_description_t* media_description,belle_sdp_key_t* key);*/ 254 BELLESIP_EXPORT void belle_sdp_media_description_set_media(belle_sdp_media_description_t* media_description, belle_sdp_media_t* media); 255 BELLESIP_EXPORT void belle_sdp_media_description_append_values_from_mime_parameter(belle_sdp_media_description_t* media_description, const belle_sdp_mime_parameter_t* mime_parameter); 256 #define BELLE_SDP_MEDIA_DESCRIPTION(t) BELLE_SDP_CAST(t,belle_sdp_media_description_t) 257 258 /*************************************************************************************** 259 * Origin 260 * 261 **************************************************************************************/ 262 typedef struct _belle_sdp_origin belle_sdp_origin_t; 263 BELLESIP_EXPORT belle_sdp_origin_t* belle_sdp_origin_new(void); 264 BELLESIP_EXPORT belle_sdp_origin_t* belle_sdp_origin_parse (const char* origin); 265 BELLESIP_EXPORT belle_sdp_origin_t* belle_sdp_origin_create(const char* user_name 266 , unsigned int session_id 267 , unsigned int session_version 268 , const char* network_type 269 , const char* addr_type 270 , const char* address); 271 BELLESIP_EXPORT const char* belle_sdp_origin_get_address(const belle_sdp_origin_t* origin); 272 BELLESIP_EXPORT const char* belle_sdp_origin_get_address_type(const belle_sdp_origin_t* origin); 273 BELLESIP_EXPORT const char* belle_sdp_origin_get_network_type(const belle_sdp_origin_t* origin); 274 BELLESIP_EXPORT unsigned int belle_sdp_origin_get_session_id(const belle_sdp_origin_t* origin); 275 BELLESIP_EXPORT unsigned int belle_sdp_origin_get_session_version(const belle_sdp_origin_t* origin); 276 BELLESIP_EXPORT const char* belle_sdp_origin_get_username(const belle_sdp_origin_t* origin); 277 BELLESIP_EXPORT void belle_sdp_origin_set_address(belle_sdp_origin_t* origin, const char* address); 278 BELLESIP_EXPORT void belle_sdp_origin_set_address_type(belle_sdp_origin_t* origin, const char* address); 279 BELLESIP_EXPORT void belle_sdp_origin_set_network_type(belle_sdp_origin_t* origin, const char* network_type); 280 BELLESIP_EXPORT void belle_sdp_origin_set_session_id(belle_sdp_origin_t* origin, unsigned int session_id); 281 BELLESIP_EXPORT void belle_sdp_origin_set_session_version(belle_sdp_origin_t* origin, unsigned int version); 282 BELLESIP_EXPORT void belle_sdp_origin_set_username(belle_sdp_origin_t* origin, const char* username); 283 #define BELLE_SDP_ORIGIN(t) BELLE_SDP_CAST(t,belle_sdp_origin_t) 284 /*************************************************************************************** 285 * Phone 286 * 287 **************************************************************************************/ 288 typedef struct _belle_sdp_phone belle_sdp_phone_t; 289 BELLESIP_EXPORT belle_sdp_phone_t* belle_sdp_phone_new(void); 290 BELLESIP_EXPORT belle_sdp_phone_t* belle_sdp_phone_parse (const char* phone); 291 BELLESIP_EXPORT const char* belle_sdp_phone_get_value(const belle_sdp_phone_t* phone); 292 BELLESIP_EXPORT void belle_sdp_phone_set_value(belle_sdp_phone_t* phone, const char* value); 293 #define BELLE_SDP_PHONE(t) BELLE_SDP_CAST(t,belle_sdp_phone_t) 294 /*************************************************************************************** 295 * Repeat time 296 * 297 **************************************************************************************/ 298 typedef struct _belle_sdp_repeate_time belle_sdp_repeate_time_t; 299 BELLESIP_EXPORT belle_sdp_repeate_time_t* belle_sdp_repeate_time_new(void); 300 BELLESIP_EXPORT belle_sdp_repeate_time_t* belle_sdp_repeate_time_parse (const char* repeate_time); 301 BELLESIP_EXPORT const char* belle_sdp_repeate_time_get_value(const belle_sdp_repeate_time_t* repeate_time); 302 BELLESIP_EXPORT void belle_sdp_repeate_time_set_value(belle_sdp_repeate_time_t* repeate_time, const char* value); 303 #define BELLE_SDP_REPEATE_TIME(t) BELLE_SDP_CAST(t,belle_sdp_repeate_time_t) 304 /*************************************************************************************** 305 * Session Name 306 * 307 **************************************************************************************/ 308 typedef struct _belle_sdp_session_name belle_sdp_session_name_t; 309 BELLESIP_EXPORT belle_sdp_session_name_t* belle_sdp_session_name_new(void); 310 BELLESIP_EXPORT belle_sdp_session_name_t* belle_sdp_session_name_create (const char* name); 311 BELLESIP_EXPORT const char* belle_sdp_session_name_get_value(const belle_sdp_session_name_t* session_name); 312 BELLESIP_EXPORT void belle_sdp_session_name_set_value(belle_sdp_session_name_t* session_name, const char* value); 313 #define BELLE_SDP_SESSION_NAME(t) BELLE_SDP_CAST(t,belle_sdp_session_name_t) 314 /*************************************************************************************** 315 * Time 316 * 317 **************************************************************************************/ 318 typedef struct _belle_sdp_time belle_sdp_time_t; 319 BELLESIP_EXPORT belle_sdp_time_t* belle_sdp_time_new(void); 320 BELLESIP_EXPORT belle_sdp_time_t* belle_sdp_time_parse (const char* time); 321 322 BELLESIP_EXPORT int belle_sdp_time_get_start(const belle_sdp_time_t* time); 323 BELLESIP_EXPORT int belle_sdp_time_get_stop(const belle_sdp_time_t* time); 324 BELLESIP_EXPORT void belle_sdp_time_set_start(belle_sdp_time_t* time, int value); 325 BELLESIP_EXPORT void belle_sdp_time_set_stop(belle_sdp_time_t* time, int value); 326 #define BELLE_SDP_TIME(t) BELLE_SDP_CAST(t,belle_sdp_time_t) 327 /*************************************************************************************** 328 * Time description 329 * 330 **************************************************************************************/ 331 typedef struct _belle_sdp_time_description belle_sdp_time_description_t; 332 BELLESIP_EXPORT belle_sdp_time_description_t* belle_sdp_time_description_new(void); 333 BELLESIP_EXPORT belle_sdp_time_description_t* belle_sdp_time_description_parse (const char* time_description); 334 BELLESIP_EXPORT belle_sdp_time_description_t* belle_sdp_time_description_create (int start,int stop); 335 336 BELLESIP_EXPORT belle_sip_list_t* belle_sdp_time_description_get_repeate_times(const belle_sdp_time_description_t* time_description); 337 BELLESIP_EXPORT belle_sdp_time_t* belle_sdp_time_description_get_time(const belle_sdp_time_description_t* time_description); 338 BELLESIP_EXPORT void belle_sdp_time_description_set_repeate_times(belle_sdp_time_description_t* time_description, belle_sip_list_t* times); 339 BELLESIP_EXPORT void belle_sdp_time_description_set_time(belle_sdp_time_description_t* time_description, belle_sdp_time_t* times); 340 #define BELLE_SDP_TIME_DESCRIPTION(t) BELLE_SDP_CAST(t,belle_sdp_time_description_t) 341 /*************************************************************************************** 342 * URI 343 * 344 **************************************************************************************/ 345 typedef struct _belle_sdp_uri belle_sdp_uri_t; 346 BELLESIP_EXPORT belle_sdp_uri_t* belle_sdp_uri_new(void); 347 BELLESIP_EXPORT belle_sdp_uri_t* belle_sdp_uri_parse (const char* uri); 348 BELLESIP_EXPORT const char* belle_sdp_uri_get_value(const belle_sdp_uri_t* uri); 349 BELLESIP_EXPORT void belle_sdp_uri_set_value(belle_sdp_uri_t* uri, const char* value); 350 #define BELLE_SDP_URI(t) BELLE_SDP_CAST(t,belle_sdp_uri_t) 351 /*************************************************************************************** 352 * Version 353 * 354 **************************************************************************************/ 355 typedef struct _belle_sdp_version belle_sdp_version_t; 356 belle_sdp_version_t* belle_sdp_version_new(void); 357 BELLESIP_EXPORT belle_sdp_version_t* belle_sdp_version_create(int version); 358 BELLESIP_EXPORT int belle_sdp_version_get_version(const belle_sdp_version_t* version); 359 BELLESIP_EXPORT void belle_sdp_version_set_version(belle_sdp_version_t* version, int value); 360 #define BELLE_SDP_VERSION(t) BELLE_SDP_CAST(t,belle_sdp_version_t) 361 362 /*************************************************************************************** 363 * Session Description 364 * 365 **************************************************************************************/ 366 typedef struct _belle_sdp_session_description belle_sdp_session_description_t; 367 BELLESIP_EXPORT belle_sdp_session_description_t* belle_sdp_session_description_new(void); 368 BELLESIP_EXPORT belle_sdp_session_description_t* belle_sdp_session_description_parse (const char* session_description); 369 370 BELLESIP_EXPORT belle_sip_list_t * belle_sdp_session_description_get_attributes(const belle_sdp_session_description_t *session_description); 371 BELLESIP_EXPORT const char* belle_sdp_session_description_get_attribute_value(const belle_sdp_session_description_t* session_description, const char* name); 372 BELLESIP_EXPORT const belle_sdp_attribute_t* belle_sdp_session_description_get_attribute(const belle_sdp_session_description_t* session_description, const char* name); 373 BELLESIP_EXPORT int belle_sdp_session_description_get_bandwidth(const belle_sdp_session_description_t* session_description, const char* name); 374 BELLESIP_EXPORT belle_sip_list_t* belle_sdp_session_description_get_bandwidths(const belle_sdp_session_description_t* session_description); 375 BELLESIP_EXPORT belle_sdp_connection_t* belle_sdp_session_description_get_connection(const belle_sdp_session_description_t* session_description); 376 BELLESIP_EXPORT belle_sip_list_t* belle_sdp_session_description_get_emails(const belle_sdp_session_description_t* session_description); 377 BELLESIP_EXPORT belle_sdp_info_t* belle_sdp_session_description_get_info(const belle_sdp_session_description_t* session_description); 378 /*belle_sdp_key_t* belle_sdp_session_description_get_key(const belle_sdp_session_description_t* session_description);*/ 379 BELLESIP_EXPORT belle_sip_list_t* belle_sdp_session_description_get_media_descriptions(const belle_sdp_session_description_t* session_description); 380 BELLESIP_EXPORT belle_sdp_origin_t* belle_sdp_session_description_get_origin(const belle_sdp_session_description_t* session_description); 381 BELLESIP_EXPORT belle_sip_list_t* belle_sdp_session_description_get_phones(const belle_sdp_session_description_t* session_description); 382 BELLESIP_EXPORT belle_sdp_session_name_t* belle_sdp_session_description_get_session_name(const belle_sdp_session_description_t* session_description); 383 BELLESIP_EXPORT belle_sip_list_t* belle_sdp_session_description_get_time_descriptions(const belle_sdp_session_description_t* session_description); 384 BELLESIP_EXPORT belle_sdp_uri_t* belle_sdp_session_description_get_uri(const belle_sdp_session_description_t* session_description); 385 BELLESIP_EXPORT belle_sdp_version_t* belle_sdp_session_description_get_version(const belle_sdp_session_description_t* session_description); 386 BELLESIP_EXPORT belle_sdp_uri_t* belle_sdp_session_description_get_zone_adjustments(const belle_sdp_session_description_t* session_description); 387 BELLESIP_EXPORT void belle_sdp_session_description_remove_attribute(belle_sdp_session_description_t* session_description, const char* name); 388 BELLESIP_EXPORT void belle_sdp_session_description_remove_bandwidth(belle_sdp_session_description_t* session_description, const char* name); 389 BELLESIP_EXPORT void belle_sdp_session_description_set_attribute_value(belle_sdp_session_description_t* session_description, const char* name, const char* value); 390 BELLESIP_EXPORT void belle_sdp_session_description_add_attribute(belle_sdp_session_description_t* session_description, const belle_sdp_attribute_t* attribute); 391 BELLESIP_EXPORT void belle_sdp_session_description_set_attributes(belle_sdp_session_description_t* session_description, belle_sip_list_t* Attributes); 392 BELLESIP_EXPORT void belle_sdp_session_description_set_bandwidth(belle_sdp_session_description_t* session_description, const char* name, int value); 393 BELLESIP_EXPORT void belle_sdp_session_description_set_bandwidths(belle_sdp_session_description_t* session_description, belle_sip_list_t* bandwidths); 394 BELLESIP_EXPORT void belle_sdp_session_description_add_bandwidth(belle_sdp_session_description_t* session_description, const belle_sdp_bandwidth_t* bandwidth); 395 BELLESIP_EXPORT void belle_sdp_session_description_set_connection(belle_sdp_session_description_t* session_description, belle_sdp_connection_t* conn); 396 BELLESIP_EXPORT void belle_sdp_session_description_set_emails(belle_sdp_session_description_t* session_description, belle_sip_list_t* emails); 397 BELLESIP_EXPORT void belle_sdp_session_description_set_info(belle_sdp_session_description_t* session_description, belle_sdp_info_t* i); 398 /*void belle_sdp_session_description_set_key(belle_sdp_session_description_t* session_description, belle_sdp_key_t* key);*/ 399 BELLESIP_EXPORT void belle_sdp_session_description_set_media_descriptions(belle_sdp_session_description_t* session_description, belle_sip_list_t* mediaDescriptions); 400 BELLESIP_EXPORT void belle_sdp_session_description_add_media_description(belle_sdp_session_description_t* session_description, belle_sdp_media_description_t* media_description); 401 BELLESIP_EXPORT void belle_sdp_session_description_set_origin(belle_sdp_session_description_t* session_description, belle_sdp_origin_t* origin); 402 BELLESIP_EXPORT void belle_sdp_session_description_set_phones(belle_sdp_session_description_t* session_description, belle_sip_list_t* phones); 403 BELLESIP_EXPORT void belle_sdp_session_description_set_session_name(belle_sdp_session_description_t* session_description, belle_sdp_session_name_t* sessionName); 404 BELLESIP_EXPORT void belle_sdp_session_description_set_time_descriptions(belle_sdp_session_description_t* session_description, belle_sip_list_t* times); 405 BELLESIP_EXPORT void belle_sdp_session_description_set_time_description(belle_sdp_session_description_t* session_description, belle_sdp_time_description_t* time_desc); 406 BELLESIP_EXPORT void belle_sdp_session_description_set_uri(belle_sdp_session_description_t* session_description, belle_sdp_uri_t* uri); 407 BELLESIP_EXPORT void belle_sdp_session_description_set_version(belle_sdp_session_description_t* session_description, belle_sdp_version_t* v); 408 BELLESIP_EXPORT void belle_sdp_session_description_set_zone_adjustments(belle_sdp_session_description_t* session_description, belle_sdp_uri_t* zoneAdjustments); 409 #define BELLE_SDP_SESSION_DESCRIPTION(t) BELLE_SDP_CAST(t,belle_sdp_session_description_t) 410 411 BELLE_SIP_END_DECLS 412 #endif /* BELLE_SDP_H_ */ 413