belle-sdp.h 32.7 KB
Newer Older
jehan's avatar
jehan committed
1
/*
jehan's avatar
jehan committed
2
	belle-sdp - SIP (RFC4566) library.
jehan's avatar
jehan committed
3 4 5 6
    Copyright (C) 2010  Belledonne Communications SARL

    This program is free software: you can redistribute it and/or modify
    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
jehan's avatar
jehan committed
8 9 10 11 12 13 14 15 16 17 18 19 20
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef BELLE_SDP_H_
#define BELLE_SDP_H_
21

22
#include "belle-sip/defs.h"
Simon Morlat's avatar
Simon Morlat committed
23
#include "belle-sip/list.h"
24

25
#define BELLE_SDP_CAST(obj,t) BELLE_SIP_CAST(obj,t)
jehan's avatar
jehan committed
26

Guillaume Beraudo's avatar
Guillaume Beraudo committed
27 28
BELLE_SIP_BEGIN_DECLS

jehan's avatar
jehan committed
29 30 31 32 33
/***************************************************************************************
 * Attribute
 *
 **************************************************************************************/
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);
Sylvain Berfini's avatar
Sylvain Berfini committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
38
BELLESIP_EXPORT void belle_sdp_attribute_set_name(belle_sdp_attribute_t* attribute, const char* name);
39 40
BELLESIP_EXPORT const char* belle_sdp_attribute_get_value(belle_sdp_attribute_t* attribute);
BELLESIP_EXPORT unsigned int belle_sdp_attribute_has_value(belle_sdp_attribute_t* attribute);
41 42 43 44 45 46 47
#define BELLE_SDP_ATTRIBUTE(t) BELLE_SDP_CAST(t,belle_sdp_attribute_t)
#define belle_sdp_attribute_init(obj)		/*nothing*/
/***************************************************************************************
 * RAW Attribute
 *
 **************************************************************************************/
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 50 51 52
BELLESIP_EXPORT belle_sdp_raw_attribute_t* belle_sdp_raw_attribute_parse(const char* attribute);
BELLESIP_EXPORT belle_sdp_raw_attribute_t* belle_sdp_raw_attribute_create(const char* name, const char* value);
BELLESIP_EXPORT void belle_sdp_raw_attribute_set_value(belle_sdp_raw_attribute_t* attribute, const char* value);
#define BELLE_SDP_RAW_ATTRIBUTE(t) BELLE_SDP_CAST(t,belle_sdp_raw_attribute_t)
53 54 55 56 57 58 59
/***************************************************************************************
 * RTCP-FB Attribute
 *
 **************************************************************************************/
typedef enum _belle_sdp_rtcp_fb_val_type {
	BELLE_SDP_RTCP_FB_ACK,
	BELLE_SDP_RTCP_FB_NACK,
60 61
	BELLE_SDP_RTCP_FB_TRR_INT,
	BELLE_SDP_RTCP_FB_CCM
62 63 64 65 66 67
} belle_sdp_rtcp_fb_val_type_t;
typedef enum _belle_sdp_rtcp_fb_val_param {
	BELLE_SDP_RTCP_FB_NONE,
	BELLE_SDP_RTCP_FB_PLI,
	BELLE_SDP_RTCP_FB_SLI,
	BELLE_SDP_RTCP_FB_RPSI,
68
	BELLE_SDP_RTCP_FB_APP,
69 70
	BELLE_SDP_RTCP_FB_FIR,
	BELLE_SDP_RTCP_FB_TMMBR
71 72
} belle_sdp_rtcp_fb_val_param_t;
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 77
BELLESIP_EXPORT int8_t belle_sdp_rtcp_fb_attribute_get_id(const belle_sdp_rtcp_fb_attribute_t* attribute);
BELLESIP_EXPORT void belle_sdp_rtcp_fb_attribute_set_id(belle_sdp_rtcp_fb_attribute_t* attribute, int8_t id);
78 79 80 81
BELLESIP_EXPORT belle_sdp_rtcp_fb_val_type_t belle_sdp_rtcp_fb_attribute_get_type(const belle_sdp_rtcp_fb_attribute_t* attribute);
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);
BELLESIP_EXPORT belle_sdp_rtcp_fb_val_param_t belle_sdp_rtcp_fb_attribute_get_param(const belle_sdp_rtcp_fb_attribute_t* attribute);
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 83
BELLESIP_EXPORT uint16_t belle_sdp_rtcp_fb_attribute_get_trr_int(const belle_sdp_rtcp_fb_attribute_t* attribute);
BELLESIP_EXPORT void belle_sdp_rtcp_fb_attribute_set_trr_int(belle_sdp_rtcp_fb_attribute_t* attribute, uint16_t milliseconds);
84 85
BELLESIP_EXPORT uint32_t belle_sdp_rtcp_fb_attribute_get_smaxpr(const belle_sdp_rtcp_fb_attribute_t* attribute);
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 89 90 91
/***************************************************************************************
 * RTCP-XR Attribute
 *
 **************************************************************************************/
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 96 97 98 99 100
BELLESIP_EXPORT const char* belle_sdp_rtcp_xr_attribute_get_rcvr_rtt_mode(const belle_sdp_rtcp_xr_attribute_t* attribute);
BELLESIP_EXPORT void belle_sdp_rtcp_xr_attribute_set_rcvr_rtt_mode(belle_sdp_rtcp_xr_attribute_t* attribute, const char *mode);
BELLESIP_EXPORT int belle_sdp_rtcp_xr_attribute_get_rcvr_rtt_max_size(const belle_sdp_rtcp_xr_attribute_t* attribute);
BELLESIP_EXPORT void belle_sdp_rtcp_xr_attribute_set_rcvr_rtt_max_size(belle_sdp_rtcp_xr_attribute_t* attribute, int max_size);
BELLESIP_EXPORT unsigned int belle_sdp_rtcp_xr_attribute_has_stat_summary(const belle_sdp_rtcp_xr_attribute_t* attribute);
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 103 104 105
BELLESIP_EXPORT void belle_sdp_rtcp_xr_attribute_add_stat_summary_flag(belle_sdp_rtcp_xr_attribute_t* attribute, const char* flag);
BELLESIP_EXPORT unsigned int belle_sdp_rtcp_xr_attribute_has_voip_metrics(const belle_sdp_rtcp_xr_attribute_t* attribute);
BELLESIP_EXPORT void belle_sdp_rtcp_xr_attribute_set_voip_metrics(belle_sdp_rtcp_xr_attribute_t* attribute, unsigned int enable);
#define BELLE_SDP_RTCP_XR_ATTRIBUTE(t) BELLE_SDP_CAST(t,belle_sdp_rtcp_xr_attribute_t)
jehan's avatar
jehan committed
106 107 108 109 110
/***************************************************************************************
 * Bandwidth
 *
 **************************************************************************************/
typedef struct _belle_sdp_bandwidth belle_sdp_bandwidth_t;
111
BELLESIP_EXPORT belle_sdp_bandwidth_t* belle_sdp_bandwidth_new(void);
112 113 114
BELLESIP_EXPORT belle_sdp_bandwidth_t* belle_sdp_bandwidth_parse (const char* bandwidth);
BELLESIP_EXPORT int belle_sdp_bandwidth_get_value(const belle_sdp_bandwidth_t* attribute);
BELLESIP_EXPORT const char* belle_sdp_bandwidth_get_type(const belle_sdp_bandwidth_t* attribute);
Ghislain MARY's avatar
Ghislain MARY committed
115 116
BELLESIP_EXPORT void belle_sdp_bandwidth_set_value(belle_sdp_bandwidth_t* attribute, int value);
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)
jehan's avatar
jehan committed
118 119 120 121 122
/***************************************************************************************
 * Connection
 *
 **************************************************************************************/
typedef struct _belle_sdp_connection belle_sdp_connection_t;
123
BELLESIP_EXPORT belle_sdp_connection_t* belle_sdp_connection_new(void);
Sylvain Berfini's avatar
Sylvain Berfini committed
124
BELLESIP_EXPORT belle_sdp_connection_t* belle_sdp_connection_create(const char* net_type, const char* addr_type, const char* addr);
125 126 127 128
BELLESIP_EXPORT belle_sdp_connection_t* belle_sdp_connection_parse (const char* connection);
BELLESIP_EXPORT const char* belle_sdp_connection_get_address(const belle_sdp_connection_t* connection);
BELLESIP_EXPORT const char* belle_sdp_connection_get_address_type(const belle_sdp_connection_t* connection);
BELLESIP_EXPORT const char* belle_sdp_connection_get_network_type(const belle_sdp_connection_t* connection);
129 130
BELLESIP_EXPORT int belle_sdp_connection_get_ttl(const belle_sdp_connection_t* connection);
BELLESIP_EXPORT int belle_sdp_connection_get_range(const belle_sdp_connection_t* connection);
Ghislain MARY's avatar
Ghislain MARY committed
131 132 133
BELLESIP_EXPORT void belle_sdp_connection_set_address(belle_sdp_connection_t* connection, const char* addr);
BELLESIP_EXPORT void belle_sdp_connection_set_address_type(belle_sdp_connection_t* connection, const char* type);
BELLESIP_EXPORT void belle_sdp_connection_set_network_type(belle_sdp_connection_t* connection, const char* type);
134 135
BELLESIP_EXPORT void belle_sdp_connection_set_ttl(belle_sdp_connection_t* connection,int ttl);
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)
jehan's avatar
jehan committed
137 138 139 140 141
/***************************************************************************************
 * Email
 *
 **************************************************************************************/
typedef struct _belle_sdp_email belle_sdp_email_t;
142
BELLESIP_EXPORT belle_sdp_email_t* belle_sdp_email_new(void);
143 144
BELLESIP_EXPORT belle_sdp_email_t* belle_sdp_email_parse (const char* email);
BELLESIP_EXPORT const char* belle_sdp_email_get_value(const belle_sdp_email_t* email);
Ghislain MARY's avatar
Ghislain MARY committed
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)
jehan's avatar
jehan committed
147 148 149 150 151
/***************************************************************************************
 * Info
 *
 **************************************************************************************/
typedef struct _belle_sdp_info belle_sdp_info_t;
152
BELLESIP_EXPORT belle_sdp_info_t* belle_sdp_info_new(void);
153 154
BELLESIP_EXPORT belle_sdp_info_t* belle_sdp_info_parse (const char* info);
BELLESIP_EXPORT const char* belle_sdp_info_get_value(const belle_sdp_info_t* info);
Ghislain MARY's avatar
Ghislain MARY committed
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)
jehan's avatar
jehan committed
157 158 159 160
/***************************************************************************************
 * Key
 *
 **************************************************************************************/
161
//typedef struct _belle_sdp_key belle_sdp_key_t;
162
//belle_sdp_key_t* belle_sdp_key_new(void);
163 164 165 166 167 168 169
//belle_sdp_key_t* belle_sdp_key_parse (const char* key);
//const char* belle_sdp_key_get_key(const belle_sdp_key_t* key);
//const char* belle_sdp_key_get_method(const belle_sdp_key_t* key);
//unsigned int belle_sdp_key_as_key(const belle_sdp_key_t* key);
//void belle_sdp_key_set_key(belle_sdp_key_t* key, const char* keyvalue);
//void belle_sdp_key_set_method(belle_sdp_key_t* key, const char* method);
//#define BELLE_SDP_KEY(t) BELLE_SDP_CAST(t,belle_sdp_key_t);
jehan's avatar
jehan committed
170 171 172 173 174
/***************************************************************************************
 * Media
 *
 **************************************************************************************/
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);
Ghislain MARY's avatar
Ghislain MARY committed
177
BELLESIP_EXPORT belle_sdp_media_t* belle_sdp_media_create(const char* media_type
jehan's avatar
jehan committed
178 179 180 181
                         ,int media_port
                         ,int port_count
                         ,const char* protocol
                         ,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 185
BELLESIP_EXPORT int	belle_sdp_media_get_media_port(const belle_sdp_media_t* media);
BELLESIP_EXPORT const char* belle_sdp_media_get_media_type(const belle_sdp_media_t* media);
Ghislain MARY's avatar
Ghislain MARY committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
190 191 192 193
BELLESIP_EXPORT void belle_sdp_media_set_media_port(belle_sdp_media_t* media, int port);
BELLESIP_EXPORT void belle_sdp_media_set_media_type(belle_sdp_media_t* media, const char* mediaType);
BELLESIP_EXPORT void belle_sdp_media_set_port_count(belle_sdp_media_t* media, int port_count);
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)
jehan's avatar
jehan committed
195

196 197 198 199 200
/***************************************************************************************
 * mime_parameter
 *
 **************************************************************************************/
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);
Sylvain Berfini's avatar
Sylvain Berfini committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
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);
Sylvain Berfini's avatar
Sylvain Berfini committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
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);
Sylvain Berfini's avatar
Sylvain Berfini committed
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

jehan's avatar
jehan committed
219 220 221 222 223
/***************************************************************************************
 * Media Description
 *
 **************************************************************************************/
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);
Sylvain Berfini's avatar
Sylvain Berfini committed
226
BELLESIP_EXPORT belle_sdp_media_description_t* belle_sdp_media_description_create(const char* media_type
jehan's avatar
jehan committed
227 228 229 230
                         	 	 	 	 	 	 	 	 	 	 ,int media_port
                         	 	 	 	 	 	 	 	 	 	 ,int port_count
                         	 	 	 	 	 	 	 	 	 	 ,const char* protocol
                         	 	 	 	 	 	 	 	 	 	 ,belle_sip_list_t* static_media_formats);
Ghislain MARY's avatar
Ghislain MARY committed
231 232
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);
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 235
BELLESIP_EXPORT belle_sip_list_t* belle_sdp_media_description_get_attributes(const belle_sdp_media_description_t* media_description);
BELLESIP_EXPORT int	belle_sdp_media_description_get_bandwidth(const belle_sdp_media_description_t* media_description, const char* name);
Ghislain MARY's avatar
Ghislain MARY committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
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 241
BELLESIP_EXPORT belle_sdp_media_t* belle_sdp_media_description_get_media(const belle_sdp_media_description_t* media_description);
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);*/
Ghislain MARY's avatar
Ghislain MARY committed
243 244
BELLESIP_EXPORT void belle_sdp_media_description_remove_attribute(belle_sdp_media_description_t* media_description,const char* attribute);
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);
Sylvain Berfini's avatar
Sylvain Berfini committed
246
BELLESIP_EXPORT void belle_sdp_media_description_add_attribute(belle_sdp_media_description_t* media_description, const belle_sdp_attribute_t* attr);
Ghislain MARY's avatar
Ghislain MARY committed
247
BELLESIP_EXPORT void belle_sdp_media_description_set_attributes(belle_sdp_media_description_t* media_description, belle_sip_list_t* Attributes);
Sylvain Berfini's avatar
Sylvain Berfini committed
248
BELLESIP_EXPORT void belle_sdp_media_description_set_bandwidth(belle_sdp_media_description_t* media_description, const char* name, int value);
Ghislain MARY's avatar
Ghislain MARY committed
249 250 251 252
BELLESIP_EXPORT void belle_sdp_media_description_add_bandwidth(belle_sdp_media_description_t* media_description, const belle_sdp_bandwidth_t* bandwidth);
BELLESIP_EXPORT void belle_sdp_media_description_set_bandwidths(belle_sdp_media_description_t* media_description, belle_sip_list_t* bandwidths);
BELLESIP_EXPORT void belle_sdp_media_description_set_connection(belle_sdp_media_description_t* media_description, belle_sdp_connection_t* conn);
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)
jehan's avatar
jehan committed
257

jehan's avatar
jehan committed
258 259 260 261 262
/***************************************************************************************
 * Origin
 *
 **************************************************************************************/
typedef struct _belle_sdp_origin belle_sdp_origin_t;
263
BELLESIP_EXPORT belle_sdp_origin_t* belle_sdp_origin_new(void);
Ghislain MARY's avatar
Ghislain MARY committed
264
BELLESIP_EXPORT belle_sdp_origin_t* belle_sdp_origin_parse (const char* origin);
Sylvain Berfini's avatar
Sylvain Berfini committed
265
BELLESIP_EXPORT belle_sdp_origin_t* belle_sdp_origin_create(const char* user_name
jehan's avatar
jehan committed
266 267 268 269 270
											, unsigned int session_id
											, unsigned int session_version
											, const char* network_type
											, const char* addr_type
											, const char* address);
271 272 273 274 275
BELLESIP_EXPORT const char* belle_sdp_origin_get_address(const belle_sdp_origin_t* origin);
BELLESIP_EXPORT const char* belle_sdp_origin_get_address_type(const belle_sdp_origin_t* origin);
BELLESIP_EXPORT const char* belle_sdp_origin_get_network_type(const belle_sdp_origin_t* origin);
BELLESIP_EXPORT unsigned int belle_sdp_origin_get_session_id(const belle_sdp_origin_t* origin);
BELLESIP_EXPORT unsigned int belle_sdp_origin_get_session_version(const belle_sdp_origin_t* origin);
Ghislain MARY's avatar
Ghislain MARY committed
276 277 278 279 280 281 282
BELLESIP_EXPORT const char* belle_sdp_origin_get_username(const belle_sdp_origin_t* origin);
BELLESIP_EXPORT void belle_sdp_origin_set_address(belle_sdp_origin_t* origin, const char* address);
BELLESIP_EXPORT void belle_sdp_origin_set_address_type(belle_sdp_origin_t* origin, const char* address);
BELLESIP_EXPORT void belle_sdp_origin_set_network_type(belle_sdp_origin_t* origin, const char* network_type);
BELLESIP_EXPORT void belle_sdp_origin_set_session_id(belle_sdp_origin_t* origin, unsigned int session_id);
BELLESIP_EXPORT void belle_sdp_origin_set_session_version(belle_sdp_origin_t* origin, unsigned int version);
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)
jehan's avatar
jehan committed
284 285 286 287 288
/***************************************************************************************
 * Phone
 *
 **************************************************************************************/
typedef struct _belle_sdp_phone belle_sdp_phone_t;
289
BELLESIP_EXPORT belle_sdp_phone_t* belle_sdp_phone_new(void);
Ghislain MARY's avatar
Ghislain MARY committed
290 291 292
BELLESIP_EXPORT belle_sdp_phone_t* belle_sdp_phone_parse (const char* phone);
BELLESIP_EXPORT const char* belle_sdp_phone_get_value(const belle_sdp_phone_t* phone);
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)
jehan's avatar
jehan committed
294 295 296 297 298
/***************************************************************************************
 * Repeat time
 *
 **************************************************************************************/
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);
Ghislain MARY's avatar
Ghislain MARY committed
300 301 302
BELLESIP_EXPORT belle_sdp_repeate_time_t* belle_sdp_repeate_time_parse (const char* repeate_time);
BELLESIP_EXPORT const char* belle_sdp_repeate_time_get_value(const belle_sdp_repeate_time_t* repeate_time);
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)
jehan's avatar
jehan committed
304 305 306 307 308
/***************************************************************************************
 * Session Name
 *
 **************************************************************************************/
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);
Sylvain Berfini's avatar
Sylvain Berfini committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
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)
jehan's avatar
jehan committed
314 315 316 317 318
/***************************************************************************************
 * Time
 *
 **************************************************************************************/
typedef struct _belle_sdp_time belle_sdp_time_t;
319
BELLESIP_EXPORT belle_sdp_time_t* belle_sdp_time_new(void);
Ghislain MARY's avatar
Ghislain MARY committed
320
BELLESIP_EXPORT belle_sdp_time_t* belle_sdp_time_parse (const char* time);
jehan's avatar
jehan committed
321

322 323
BELLESIP_EXPORT int belle_sdp_time_get_start(const belle_sdp_time_t* time);
BELLESIP_EXPORT int belle_sdp_time_get_stop(const belle_sdp_time_t* time);
Ghislain MARY's avatar
Ghislain MARY committed
324 325
BELLESIP_EXPORT void belle_sdp_time_set_start(belle_sdp_time_t* time, int value);
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)
jehan's avatar
jehan committed
327 328 329 330 331
/***************************************************************************************
 * Time description
 *
 **************************************************************************************/
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);
Ghislain MARY's avatar
Ghislain MARY committed
333
BELLESIP_EXPORT belle_sdp_time_description_t* belle_sdp_time_description_parse (const char* time_description);
Sylvain Berfini's avatar
Sylvain Berfini committed
334
BELLESIP_EXPORT belle_sdp_time_description_t* belle_sdp_time_description_create (int start,int stop);
jehan's avatar
jehan committed
335

Ghislain MARY's avatar
Ghislain MARY committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
338 339
BELLESIP_EXPORT void belle_sdp_time_description_set_repeate_times(belle_sdp_time_description_t* time_description, belle_sip_list_t* times);
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)
jehan's avatar
jehan committed
341 342 343 344 345
/***************************************************************************************
 * URI
 *
 **************************************************************************************/
typedef struct _belle_sdp_uri belle_sdp_uri_t;
346
BELLESIP_EXPORT belle_sdp_uri_t* belle_sdp_uri_new(void);
Ghislain MARY's avatar
Ghislain MARY committed
347 348 349
BELLESIP_EXPORT belle_sdp_uri_t* belle_sdp_uri_parse (const char* uri);
BELLESIP_EXPORT const char* belle_sdp_uri_get_value(const belle_sdp_uri_t* uri);
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)
jehan's avatar
jehan committed
351 352 353 354 355
/***************************************************************************************
 * Version
 *
 **************************************************************************************/
typedef struct _belle_sdp_version belle_sdp_version_t;
356
belle_sdp_version_t* belle_sdp_version_new(void);
Sylvain Berfini's avatar
Sylvain Berfini committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
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)
jehan's avatar
jehan committed
361 362 363 364 365 366

/***************************************************************************************
 * Session Description
 *
 **************************************************************************************/
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);
Ghislain MARY's avatar
Ghislain MARY committed
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);
Sylvain Berfini's avatar
Sylvain Berfini committed
373
BELLESIP_EXPORT int	belle_sdp_session_description_get_bandwidth(const belle_sdp_session_description_t* session_description, const char* name);
Ghislain MARY's avatar
Ghislain MARY committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
376 377
BELLESIP_EXPORT belle_sip_list_t* belle_sdp_session_description_get_emails(const belle_sdp_session_description_t* session_description);
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 380
BELLESIP_EXPORT belle_sip_list_t* belle_sdp_session_description_get_media_descriptions(const belle_sdp_session_description_t* session_description);
BELLESIP_EXPORT belle_sdp_origin_t*	belle_sdp_session_description_get_origin(const belle_sdp_session_description_t* session_description);
Ghislain MARY's avatar
Ghislain MARY committed
381
BELLESIP_EXPORT belle_sip_list_t* belle_sdp_session_description_get_phones(const belle_sdp_session_description_t* session_description);
382 383
BELLESIP_EXPORT belle_sdp_session_name_t* belle_sdp_session_description_get_session_name(const belle_sdp_session_description_t* session_description);
BELLESIP_EXPORT belle_sip_list_t* belle_sdp_session_description_get_time_descriptions(const belle_sdp_session_description_t* session_description);
Ghislain MARY's avatar
Ghislain MARY committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
386 387 388 389 390 391
BELLESIP_EXPORT belle_sdp_uri_t* belle_sdp_session_description_get_zone_adjustments(const belle_sdp_session_description_t* session_description);
BELLESIP_EXPORT void belle_sdp_session_description_remove_attribute(belle_sdp_session_description_t* session_description, const char* name);
BELLESIP_EXPORT void belle_sdp_session_description_remove_bandwidth(belle_sdp_session_description_t* session_description, const char* name);
BELLESIP_EXPORT void belle_sdp_session_description_set_attribute_value(belle_sdp_session_description_t* session_description, const char* name, const char* value);
BELLESIP_EXPORT void belle_sdp_session_description_add_attribute(belle_sdp_session_description_t* session_description, const belle_sdp_attribute_t* attribute);
BELLESIP_EXPORT void belle_sdp_session_description_set_attributes(belle_sdp_session_description_t* session_description, belle_sip_list_t* Attributes);
Sylvain Berfini's avatar
Sylvain Berfini committed
392
BELLESIP_EXPORT void belle_sdp_session_description_set_bandwidth(belle_sdp_session_description_t* session_description, const char* name, int value);
Ghislain MARY's avatar
Ghislain MARY committed
393 394
BELLESIP_EXPORT void belle_sdp_session_description_set_bandwidths(belle_sdp_session_description_t* session_description, belle_sip_list_t* bandwidths);
BELLESIP_EXPORT void belle_sdp_session_description_add_bandwidth(belle_sdp_session_description_t* session_description, const belle_sdp_bandwidth_t* bandwidth);
Sylvain Berfini's avatar
Sylvain Berfini committed
395
BELLESIP_EXPORT void belle_sdp_session_description_set_connection(belle_sdp_session_description_t* session_description, belle_sdp_connection_t* conn);
Ghislain MARY's avatar
Ghislain MARY committed
396 397
BELLESIP_EXPORT void belle_sdp_session_description_set_emails(belle_sdp_session_description_t* session_description, belle_sip_list_t* emails);
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);*/
Ghislain MARY's avatar
Ghislain MARY committed
399
BELLESIP_EXPORT void belle_sdp_session_description_set_media_descriptions(belle_sdp_session_description_t* session_description, belle_sip_list_t* mediaDescriptions);
Sylvain Berfini's avatar
Sylvain Berfini committed
400 401
BELLESIP_EXPORT void belle_sdp_session_description_add_media_description(belle_sdp_session_description_t* session_description, belle_sdp_media_description_t* media_description);
BELLESIP_EXPORT void belle_sdp_session_description_set_origin(belle_sdp_session_description_t* session_description, belle_sdp_origin_t* origin);
Ghislain MARY's avatar
Ghislain MARY committed
402
BELLESIP_EXPORT void belle_sdp_session_description_set_phones(belle_sdp_session_description_t* session_description, belle_sip_list_t* phones);
Sylvain Berfini's avatar
Sylvain Berfini committed
403
BELLESIP_EXPORT void belle_sdp_session_description_set_session_name(belle_sdp_session_description_t* session_description, belle_sdp_session_name_t* sessionName);
Ghislain MARY's avatar
Ghislain MARY committed
404
BELLESIP_EXPORT void belle_sdp_session_description_set_time_descriptions(belle_sdp_session_description_t* session_description, belle_sip_list_t* times);
Sylvain Berfini's avatar
Sylvain Berfini committed
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);
Ghislain MARY's avatar
Ghislain MARY committed
406
BELLESIP_EXPORT void belle_sdp_session_description_set_uri(belle_sdp_session_description_t* session_description, belle_sdp_uri_t* uri);
Sylvain Berfini's avatar
Sylvain Berfini committed
407
BELLESIP_EXPORT void belle_sdp_session_description_set_version(belle_sdp_session_description_t* session_description, belle_sdp_version_t* v);
Ghislain MARY's avatar
Ghislain MARY committed
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)
Guillaume Beraudo's avatar
Guillaume Beraudo committed
410 411

BELLE_SIP_END_DECLS
jehan's avatar
jehan committed
412
#endif /* BELLE_SDP_H_ */