1 /*
2 Copyright (C) 2010-2015 Belledonne Communications SARL
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 */
18 
19 #ifndef LINPHONE_PROXY_CONFIG_H
20 #define LINPHONE_PROXY_CONFIG_H
21 
22 #include "linphone/types.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /**
29  * @addtogroup proxies
30  * @{
31 **/
32 
33 /**
34  * Creates an empty proxy config.
35  * @deprecated, use #linphone_core_create_proxy_config instead
36  * @donotwrap
37 **/
38 LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneProxyConfig *linphone_proxy_config_new(void);
39 
40 /**
41  * Acquire a reference to the proxy config.
42  * @param[in] cfg #LinphoneProxyConfig object.
43  * @return The same proxy config.
44 **/
45 LINPHONE_PUBLIC LinphoneProxyConfig *linphone_proxy_config_ref(LinphoneProxyConfig *cfg);
46 
47 /**
48  * Release reference to the proxy config.
49  * @param[in] cfg #LinphoneProxyConfig object.
50 **/
51 LINPHONE_PUBLIC void linphone_proxy_config_unref(LinphoneProxyConfig *cfg);
52 
53 /**
54  * Retrieve the user pointer associated with the proxy config.
55  * @param[in] cfg #LinphoneProxyConfig object.
56  * @return The user pointer associated with the proxy config.
57 **/
58 LINPHONE_PUBLIC void *linphone_proxy_config_get_user_data(const LinphoneProxyConfig *cfg);
59 
60 /**
61  * Assign a user pointer to the proxy config.
62  * @param[in] cfg #LinphoneProxyConfig object.
63  * @param[in] ud The user pointer to associate with the proxy config.
64 **/
65 LINPHONE_PUBLIC void linphone_proxy_config_set_user_data(LinphoneProxyConfig *cfg, void *ud);
66 
67 /**
68  * Sets the proxy address
69  *
70  * Examples of valid sip proxy address are:
71  * - IP address: sip:87.98.157.38
72  * - IP address with port: sip:87.98.157.38:5062
73  * - hostnames : sip:sip.example.net
74 **/
75 LINPHONE_PUBLIC LinphoneStatus linphone_proxy_config_set_server_addr(LinphoneProxyConfig *cfg, const char *server_addr);
76 
77 /**
78  * @deprecated Use linphone_proxy_config_set_identity_address()
79  * @donotwrap
80 **/
81 LINPHONE_PUBLIC	LINPHONE_DEPRECATED LinphoneStatus linphone_proxy_config_set_identity(LinphoneProxyConfig *cfg, const char *identity);
82 
83 /**
84  * Sets the user identity as a SIP address.
85  *
86  * This identity is normally formed with display name, username and domain, such
87  * as:
88  * Alice <sip:alice@example.net>
89  * The REGISTER messages will have from and to set to this identity.
90  *
91 **/
92 LINPHONE_PUBLIC LinphoneStatus linphone_proxy_config_set_identity_address(LinphoneProxyConfig *cfg, const LinphoneAddress *identity);
93 
94 /**
95  * Sets a SIP route.
96  * When a route is set, all outgoing calls will go to the route's destination if this proxy
97  * is the default one (see linphone_core_set_default_proxy() ).
98  * @return -1 if route is invalid, 0 otherwise.
99 **/
100 LINPHONE_PUBLIC LinphoneStatus linphone_proxy_config_set_route(LinphoneProxyConfig *cfg, const char *route);
101 
102 /**
103  * Sets the registration expiration time in seconds.
104 **/
105 LINPHONE_PUBLIC void linphone_proxy_config_set_expires(LinphoneProxyConfig *cfg, int expires);
106 
107 #define linphone_proxy_config_expires linphone_proxy_config_set_expires
108 
109 /**
110  * Indicates  either or not, REGISTRATION must be issued for this #LinphoneProxyConfig .
111  * <br> In case this #LinphoneProxyConfig has been added to #LinphoneCore, follows the linphone_proxy_config_edit() rule.
112  * @param[in] cfg #LinphoneProxyConfig object.
113  * @param val if true, registration will be engaged
114  */
115 LINPHONE_PUBLIC void linphone_proxy_config_enable_register(LinphoneProxyConfig *cfg, bool_t val);
116 
117 #define linphone_proxy_config_enableregister linphone_proxy_config_enable_register
118 
119 /**
120  * Starts editing a proxy configuration.
121  *
122  * Because proxy configuration must be consistent, applications MUST
123  * call linphone_proxy_config_edit() before doing any attempts to modify
124  * proxy configuration (such as identity, proxy address and so on).
125  * Once the modifications are done, then the application must call
126  * linphone_proxy_config_done() to commit the changes.
127 **/
128 LINPHONE_PUBLIC void linphone_proxy_config_edit(LinphoneProxyConfig *cfg);
129 
130 /**
131  * Commits modification made to the proxy configuration.
132 **/
133 LINPHONE_PUBLIC LinphoneStatus linphone_proxy_config_done(LinphoneProxyConfig *cfg);
134 
135 /**
136  * Indicates  either or not, PUBLISH must be issued for this #LinphoneProxyConfig .
137  * <br> In case this #LinphoneProxyConfig has been added to #LinphoneCore, follows the linphone_proxy_config_edit() rule.
138  * @param[in] cfg #LinphoneProxyConfig object.
139  * @param val if true, publish will be engaged
140  *
141  */
142 LINPHONE_PUBLIC void linphone_proxy_config_enable_publish(LinphoneProxyConfig *cfg, bool_t val);
143 
144 /**
145  * Set the publish expiration time in second.
146  * @param[in] cfg #LinphoneProxyConfig object.
147  * @param expires in second
148  * */
149 LINPHONE_PUBLIC void linphone_proxy_config_set_publish_expires(LinphoneProxyConfig *cfg, int expires);
150 
151 /**
152  * get the publish expiration time in second. Default value is the registration expiration value.
153  * @param[in] cfg #LinphoneProxyConfig object.
154  * @return expires in second
155  * */
156 LINPHONE_PUBLIC int linphone_proxy_config_get_publish_expires(const LinphoneProxyConfig *cfg);
157 
158 /**
159  * Sets whether liblinphone should replace "+" by international calling prefix in dialed numbers (passed to
160  * #linphone_core_invite ).
161 **/
162 LINPHONE_PUBLIC void linphone_proxy_config_set_dial_escape_plus(LinphoneProxyConfig *cfg, bool_t val);
163 
164 /**
165  * Sets a dialing prefix to be automatically prepended when inviting a number with
166  * linphone_core_invite();
167  * This dialing prefix shall usually be the country code of the country where the user is living, without "+".
168  *
169 **/
170 LINPHONE_PUBLIC void linphone_proxy_config_set_dial_prefix(LinphoneProxyConfig *cfg, const char *prefix);
171 
172  /**
173  * Indicates whether quality statistics during call should be stored and sent to a collector according to RFC 6035.
174  * @param[in] cfg #LinphoneProxyConfig object.
175  * @param[in] enable True to sotre quality statistics and sent them to the collector, false to disable it.
176  */
177 LINPHONE_PUBLIC void linphone_proxy_config_enable_quality_reporting(LinphoneProxyConfig *cfg, bool_t enable);
178 
179 /**
180  * Indicates whether quality statistics during call should be stored and sent to a collector according to RFC 6035.
181  * @param[in] cfg #LinphoneProxyConfig object.
182  * @return True if quality repotring is enabled, false otherwise.
183  */
184 LINPHONE_PUBLIC bool_t linphone_proxy_config_quality_reporting_enabled(LinphoneProxyConfig *cfg);
185 
186  /**
187  * Set the route of the collector end-point when using quality reporting. This SIP address
188  * should be used on server-side to process packets directly before discarding packets. Collector address
189  * should be a non existing account and will not receive any messages.
190  * If NULL, reports will be send to the proxy domain.
191  * @param[in] cfg #LinphoneProxyConfig object.
192  * @param[in] collector route of the collector end-point, if NULL PUBLISH will be sent to the proxy domain.
193  */
194 LINPHONE_PUBLIC void linphone_proxy_config_set_quality_reporting_collector(LinphoneProxyConfig *cfg, const char *collector);
195 
196  /**
197  * Get the route of the collector end-point when using quality reporting. This SIP address
198  * should be used on server-side to process packets directly before discarding packets. Collector address
199  * should be a non existing account and will not receive any messages.
200  * If NULL, reports will be send to the proxy domain.
201  * @param[in] cfg #LinphoneProxyConfig object.
202  * @return The SIP address of the collector end-point.
203  */
204 LINPHONE_PUBLIC const char *linphone_proxy_config_get_quality_reporting_collector(const LinphoneProxyConfig *cfg);
205 
206 /**
207  * Set the interval between 2 interval reports sending when using quality reporting. If call exceed interval size, an
208  * interval report will be sent to the collector. On call termination, a session report will be sent
209  * for the remaining period. Value must be 0 (disabled) or positive.
210  * @param[in] cfg #LinphoneProxyConfig object.
211  * @param[in] interval The interval in seconds, 0 means interval reports are disabled.
212  */
213 LINPHONE_PUBLIC void linphone_proxy_config_set_quality_reporting_interval(LinphoneProxyConfig *cfg, int interval);
214 
215 /**
216  * Get the interval between interval reports when using quality reporting.
217  * @param[in] cfg #LinphoneProxyConfig object.
218  * @return The interval in seconds, 0 means interval reports are disabled.
219  */
220 
221 LINPHONE_PUBLIC int linphone_proxy_config_get_quality_reporting_interval(LinphoneProxyConfig *cfg);
222 
223 /**
224  * Get the registration state of the given proxy config.
225  * @param[in] cfg #LinphoneProxyConfig object.
226  * @return The registration state of the proxy config.
227 **/
228 LINPHONE_PUBLIC LinphoneRegistrationState linphone_proxy_config_get_state(const LinphoneProxyConfig *cfg);
229 
230 /**
231  * @return a boolean indicating that the user is sucessfully registered on the proxy.
232  * @deprecated Use linphone_proxy_config_get_state() instead.
233  * @donotwrap
234 **/
235 LINPHONE_PUBLIC LINPHONE_DEPRECATED bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *cfg);
236 
237 /**
238  * Get the domain name of the given proxy config.
239  * @param[in] cfg #LinphoneProxyConfig object.
240  * @return The domain name of the proxy config.
241 **/
242 LINPHONE_PUBLIC const char *linphone_proxy_config_get_domain(const LinphoneProxyConfig *cfg);
243 
244 /**
245  * Get the realm of the given proxy config.
246  * @param[in] cfg #LinphoneProxyConfig object.
247  * @return The realm of the proxy config.
248 **/
249 LINPHONE_PUBLIC const char *linphone_proxy_config_get_realm(const LinphoneProxyConfig *cfg);
250 
251 /**
252  * Set the realm of the given proxy config.
253  * @param[in] cfg #LinphoneProxyConfig object.
254  * @param[in] realm New realm value.
255 **/
256 LINPHONE_PUBLIC void linphone_proxy_config_set_realm(LinphoneProxyConfig *cfg, const char * realm);
257 
258 /**
259  * @return the route set for this proxy configuration.
260 **/
261 LINPHONE_PUBLIC const char *linphone_proxy_config_get_route(const LinphoneProxyConfig *cfg);
262 
263 /**
264  * @return the SIP identity that belongs to this proxy configuration.
265 **/
266 LINPHONE_PUBLIC const LinphoneAddress *linphone_proxy_config_get_identity_address(const LinphoneProxyConfig *cfg);
267 
268 /**
269  * @deprecated use linphone_proxy_config_get_identity_address()
270  * @donotwrap
271 **/
272 LINPHONE_PUBLIC LINPHONE_DEPRECATED const char *linphone_proxy_config_get_identity(const LinphoneProxyConfig *cfg);
273 
274 /**
275  * @return TRUE if PUBLISH request is enabled for this proxy.
276 **/
277 LINPHONE_PUBLIC bool_t linphone_proxy_config_publish_enabled(const LinphoneProxyConfig *cfg);
278 
279 /**
280  * @return the proxy's SIP address.
281 **/
282 LINPHONE_PUBLIC	const char *linphone_proxy_config_get_server_addr(const LinphoneProxyConfig *cfg);
283 
284 #define linphone_proxy_config_get_addr linphone_proxy_config_get_server_addr
285 
286 /**
287  * @return the duration of registration.
288 **/
289 LINPHONE_PUBLIC int linphone_proxy_config_get_expires(const LinphoneProxyConfig *cfg);
290 
291 /**
292  * @return TRUE if registration to the proxy is enabled.
293 **/
294 LINPHONE_PUBLIC bool_t linphone_proxy_config_register_enabled(const LinphoneProxyConfig *cfg);
295 
296 /**
297  * Refresh a proxy registration.
298  * This is useful if for example you resuming from suspend, thus IP address may have changed.
299 **/
300 LINPHONE_PUBLIC void linphone_proxy_config_refresh_register(LinphoneProxyConfig *cfg);
301 
302 /**
303  * Prevent a proxy config from refreshing its registration.
304  * This is useful to let registrations to expire naturally (or) when the application wants to keep control on when
305  * refreshes are sent.
306  * However, linphone_core_set_network_reachable(lc,TRUE) will always request the proxy configs to refresh their registrations.
307  * The refreshing operations can be resumed with linphone_proxy_config_refresh_register().
308  * @param[in] cfg #LinphoneProxyConfig object.
309 **/
310 LINPHONE_PUBLIC void linphone_proxy_config_pause_register(LinphoneProxyConfig *cfg);
311 
312 LINPHONE_PUBLIC const LinphoneAddress* linphone_proxy_config_get_contact(const LinphoneProxyConfig *cfg);
313 
314 /**
315  * @return previously set contact parameters.
316 **/
317 LINPHONE_PUBLIC const char *linphone_proxy_config_get_contact_parameters(const LinphoneProxyConfig *cfg);
318 
319 /**
320  * Set optional contact parameters that will be added to the contact information sent in the registration.
321  * @param[in] cfg #LinphoneProxyConfig object.
322  * @param contact_params a string contaning the additional parameters in text form, like "myparam=something;myparam2=something_else"
323  *
324  * The main use case for this function is provide the proxy additional information regarding the user agent, like for example unique identifier or apple push id.
325  * As an example, the contact address in the SIP register sent will look like <sip:joe@15.128.128.93:50421>;apple-push-id=43143-DFE23F-2323-FA2232.
326 **/
327 LINPHONE_PUBLIC void linphone_proxy_config_set_contact_parameters(LinphoneProxyConfig *cfg, const char *contact_params);
328 
329 /**
330  * Set optional contact parameters that will be added to the contact information sent in the registration, inside the URI.
331  * @param[in] cfg #LinphoneProxyConfig object.
332  * @param contact_uri_params a string containing the additional parameters in text form, like "myparam=something;myparam2=something_else"
333  *
334  * The main use case for this function is provide the proxy additional information regarding the user agent, like for example unique identifier or apple push id.
335  * As an example, the contact address in the SIP register sent will look like <sip:joe@15.128.128.93:50421;apple-push-id=43143-DFE23F-2323-FA2232>.
336 **/
337 LINPHONE_PUBLIC void linphone_proxy_config_set_contact_uri_parameters(LinphoneProxyConfig *cfg, const char *contact_uri_params);
338 
339 /**
340  * @return previously set contact URI parameters.
341 **/
342 LINPHONE_PUBLIC const char* linphone_proxy_config_get_contact_uri_parameters(const LinphoneProxyConfig *cfg);
343 
344 /**
345  * Get the #LinphoneCore object to which is associated the #LinphoneProxyConfig.
346  * @param[in] cfg #LinphoneProxyConfig object.
347  * @return The #LinphoneCore object to which is associated the #LinphoneProxyConfig.
348 **/
349 LINPHONE_PUBLIC LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyConfig *cfg);
350 
351 /**
352  * @return whether liblinphone should replace "+" by "00" in dialed numbers (passed to
353  * #linphone_core_invite ).
354  *
355 **/
356 LINPHONE_PUBLIC bool_t linphone_proxy_config_get_dial_escape_plus(const LinphoneProxyConfig *cfg);
357 
358 /**
359  * @return dialing prefix.
360 **/
361 LINPHONE_PUBLIC	const char * linphone_proxy_config_get_dial_prefix(const LinphoneProxyConfig *cfg);
362 
363 /**
364  * Get the reason why registration failed when the proxy config state is LinphoneRegistrationFailed.
365  * @param[in] cfg #LinphoneProxyConfig object.
366  * @return The reason why registration failed for this proxy config.
367 **/
368 LINPHONE_PUBLIC LinphoneReason linphone_proxy_config_get_error(const LinphoneProxyConfig *cfg);
369 
370 /**
371  * Get detailed information why registration failed when the proxy config state is LinphoneRegistrationFailed.
372  * @param[in] cfg #LinphoneProxyConfig object.
373  * @return The details why registration failed for this proxy config.
374 **/
375 LINPHONE_PUBLIC const LinphoneErrorInfo *linphone_proxy_config_get_error_info(const LinphoneProxyConfig *cfg);
376 
377 /**
378  * Get the transport from either service route, route or addr.
379  * @param[in] cfg #LinphoneProxyConfig object.
380  * @return The transport as a string (I.E udp, tcp, tls, dtls)
381 **/
382 LINPHONE_PUBLIC const char* linphone_proxy_config_get_transport(const LinphoneProxyConfig *cfg);
383 
384 /**
385  * Destroys a proxy config.
386  * @note: LinphoneProxyConfig that have been removed from LinphoneCore with
387  * linphone_core_remove_proxy_config() must not be freed.
388  * @deprecated
389  * @donotwrap
390 **/
391 LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_proxy_config_destroy(LinphoneProxyConfig *cfg);
392 
393 LINPHONE_PUBLIC void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *type);
394 
395 LINPHONE_PUBLIC SipSetupContext *linphone_proxy_config_get_sip_setup_context(LinphoneProxyConfig *cfg);
396 
397 LINPHONE_PUBLIC SipSetup *linphone_proxy_config_get_sip_setup(LinphoneProxyConfig *cfg);
398 
399 /**
400  * Detect if the given input is a phone number or not.
401  * @param proxy #LinphoneProxyConfig argument, unused yet but may contain useful data. Can be NULL.
402  * @param username string to parse.
403  * @return TRUE if input is a phone number, FALSE otherwise.
404 **/
405 LINPHONE_PUBLIC bool_t linphone_proxy_config_is_phone_number(LinphoneProxyConfig *proxy, const char *username);
406 
407 /**
408  * See linphone_proxy_config_normalize_phone_number
409  * @param proxy #LinphoneProxyConfig object containing country code and/or escape symbol. If NULL passed, will use default configuration.
410  * @param username the string to parse
411  * @param result the newly normalized number
412  * @param result_len the size of the normalized number \a result
413  * @return TRUE if a phone number was recognized, FALSE otherwise.
414  * @deprecated use linphone_proxy_config_normalize_phone_number()
415  * @donotwrap
416  */
417 LINPHONE_PUBLIC LINPHONE_DEPRECATED bool_t linphone_proxy_config_normalize_number(LinphoneProxyConfig *proxy, const char *username, char *result, size_t result_len);
418 
419 /**
420  * Normalize a human readable phone number into a basic string. 888-444-222 becomes 888444222
421  * or +33888444222 depending on the #LinphoneProxyConfig object.
422  * This function will always generate a normalized username if input is a phone number.
423  * @param proxy #LinphoneProxyConfig object containing country code and/or escape symbol. If NULL passed, will use default configuration.
424  * @param username the string to parse
425  * @return NULL if input is an invalid phone number, normalized phone number from username input otherwise.
426 */
427 LINPHONE_PUBLIC char* linphone_proxy_config_normalize_phone_number(LinphoneProxyConfig *proxy, const char *username);
428 
429 /**
430  * Normalize a human readable sip uri into a fully qualified LinphoneAddress.
431  * A sip address should look like DisplayName \<sip:username\@domain:port\> .
432  * Basically this function performs the following tasks
433  * - if a phone number is entered, prepend country prefix and eventually escape the '+' by 00 of the proxy config.
434  * - if no domain part is supplied, append the domain name of the proxy config. Returns NULL if no proxy is provided at this point.
435  * - if no sip: is present, prepend it.
436  *
437  * The result is a syntactically correct SIP address.
438  * @param proxy #LinphoneProxyConfig object containing country code, escape symbol and/or domain name. Can be NULL if domain is already provided.
439  * @param username the string to parse
440  * @return NULL if invalid input, normalized sip address otherwise.
441 */
442 LINPHONE_PUBLIC LinphoneAddress* linphone_proxy_config_normalize_sip_uri(LinphoneProxyConfig *proxy, const char *username);
443 
444 /**
445  * Set default privacy policy for all calls routed through this proxy.
446  * @param[in] cfg #LinphoneProxyConfig object.
447  * @param privacy LinphonePrivacy to configure privacy
448  * */
449 LINPHONE_PUBLIC void linphone_proxy_config_set_privacy(LinphoneProxyConfig *cfg, LinphonePrivacyMask privacy);
450 
451 /**
452  * Get default privacy policy for all calls routed through this proxy.
453  * @param[in] cfg #LinphoneProxyConfig object.
454  * @return Privacy mode
455  * */
456 LINPHONE_PUBLIC LinphonePrivacyMask linphone_proxy_config_get_privacy(const LinphoneProxyConfig *cfg);
457 
458 /**
459  * Set the http file transfer server to be used for content type application/vnd.gsma.rcs-ft-http+xml
460  * @param[in] cfg #LinphoneProxyConfig object.
461  * @param server_url URL of the file server like https://file.linphone.org/upload.php
462  * @warning That function isn't implemented yet.
463  * @donotwrap
464  * */
465 LINPHONE_PUBLIC void linphone_proxy_config_set_file_transfer_server(LinphoneProxyConfig *cfg, const char * server_url);
466 
467 /**
468  * Get the http file transfer server to be used for content type application/vnd.gsma.rcs-ft-http+xml
469  * @param[in] cfg #LinphoneProxyConfig object.
470  * @return URL of the file server like https://file.linphone.org/upload.php
471  * @warning That function isn't implemented yet.
472  * @donotwrap
473  * */
474 LINPHONE_PUBLIC const char* linphone_proxy_config_get_file_transfer_server(const LinphoneProxyConfig *cfg);
475 
476 /**
477  * Indicates whether AVPF/SAVPF must be used for calls using this proxy config.
478  * @param[in] cfg #LinphoneProxyConfig object.
479  * @param[in] enable True to enable AVPF/SAVF, false to disable it.
480  * @deprecated use linphone_proxy_config_set_avpf_mode()
481  * @donotwrap
482  */
483 LINPHONE_DEPRECATED LINPHONE_PUBLIC void linphone_proxy_config_enable_avpf(LinphoneProxyConfig *cfg, bool_t enable);
484 
485 /**
486  * Indicates whether AVPF/SAVPF is being used for calls using this proxy config.
487  * @param[in] cfg #LinphoneProxyConfig object.
488  * @return True if AVPF/SAVPF is enabled, false otherwise.
489  */
490 LINPHONE_PUBLIC bool_t linphone_proxy_config_avpf_enabled(LinphoneProxyConfig *cfg);
491 
492 /**
493  * Set the interval between regular RTCP reports when using AVPF/SAVPF.
494  * @param[in] cfg #LinphoneProxyConfig object.
495  * @param[in] interval The interval in seconds (between 0 and 5 seconds).
496  */
497 LINPHONE_PUBLIC void linphone_proxy_config_set_avpf_rr_interval(LinphoneProxyConfig *cfg, uint8_t interval);
498 
499 /**
500  * Get the interval between regular RTCP reports when using AVPF/SAVPF.
501  * @param[in] cfg #LinphoneProxyConfig object.
502  * @return The interval in seconds.
503  */
504 LINPHONE_PUBLIC uint8_t linphone_proxy_config_get_avpf_rr_interval(const LinphoneProxyConfig *cfg);
505 
506 /**
507  * Get enablement status of RTCP feedback (also known as AVPF profile).
508  * @param[in] cfg #LinphoneProxyConfig object.
509  * @return the enablement mode, which can be LinphoneAVPFDefault (use LinphoneCore's mode), LinphoneAVPFEnabled (avpf is enabled), or LinphoneAVPFDisabled (disabled).
510 **/
511 LINPHONE_PUBLIC LinphoneAVPFMode linphone_proxy_config_get_avpf_mode(const LinphoneProxyConfig *cfg);
512 
513 /**
514  * Enable the use of RTCP feedback (also known as AVPF profile).
515  * @param[in] cfg #LinphoneProxyConfig object.
516  * @param[in] mode the enablement mode, which can be LinphoneAVPFDefault (use LinphoneCore's mode), LinphoneAVPFEnabled (avpf is enabled), or LinphoneAVPFDisabled (disabled).
517 **/
518 LINPHONE_PUBLIC void linphone_proxy_config_set_avpf_mode(LinphoneProxyConfig *cfg, LinphoneAVPFMode mode);
519 
520 /**
521  * Obtain the value of a header sent by the server in last answer to REGISTER.
522  * @param[in] cfg #LinphoneProxyConfig object.
523  * @param header_name the header name for which to fetch corresponding value
524  * @return the value of the queried header.
525 **/
526 LINPHONE_PUBLIC const char *linphone_proxy_config_get_custom_header(LinphoneProxyConfig *cfg, const char *header_name);
527 
528 /**
529  * Set the value of a custom header sent to the server in REGISTERs request.
530  * @param[in] cfg #LinphoneProxyConfig object.
531  * @param header_name the header name
532  * @param header_value the header's value
533 **/
534 LINPHONE_PUBLIC void linphone_proxy_config_set_custom_header(LinphoneProxyConfig *cfg, const char *header_name, const char *header_value);
535 
536 /**
537  * Find authentication info matching proxy config, if any, similarly to linphone_core_find_auth_info.
538  * @param[in] cfg #LinphoneProxyConfig object.
539  * @return a #LinphoneAuthInfo matching proxy config criteria if possible, NULL if nothing can be found.
540 **/
541 LINPHONE_PUBLIC const LinphoneAuthInfo* linphone_proxy_config_find_auth_info(const LinphoneProxyConfig *cfg);
542 
543 /**
544  * Get the persistent reference key associated to the proxy config.
545  *
546  * The reference key can be for example an id to an external database.
547  * It is stored in the config file, thus can survive to process exits/restarts.
548  *
549  * @param[in] cfg #LinphoneProxyConfig object.
550  * @return The reference key string that has been associated to the proxy config, or NULL if none has been associated.
551 **/
552 LINPHONE_PUBLIC const char * linphone_proxy_config_get_ref_key(const LinphoneProxyConfig *cfg);
553 
554 /**
555  * Associate a persistent reference key to the proxy config.
556  *
557  * The reference key can be for example an id to an external database.
558  * It is stored in the config file, thus can survive to process exits/restarts.
559  *
560  * @param[in] cfg #LinphoneProxyConfig object.
561  * @param[in] refkey The reference key string to associate to the proxy config.
562 **/
563 LINPHONE_PUBLIC void linphone_proxy_config_set_ref_key(LinphoneProxyConfig *cfg, const char *refkey);
564 
565 /**
566  * Get The policy that is used to pass through NATs/firewalls when using this proxy config.
567  * If it is set to NULL, the default NAT policy from the core will be used instead.
568  * @param[in] cfg #LinphoneProxyConfig object
569  * @return LinphoneNatPolicy object in use.
570  * @see linphone_core_get_nat_policy()
571  */
572 LINPHONE_PUBLIC LinphoneNatPolicy * linphone_proxy_config_get_nat_policy(const LinphoneProxyConfig *cfg);
573 
574 /**
575  * Set the policy to use to pass through NATs/firewalls when using this proxy config.
576  * If it is set to NULL, the default NAT policy from the core will be used instead.
577  * @param[in] cfg #LinphoneProxyConfig object
578  * @param[in] policy LinphoneNatPolicy object
579  * @see linphone_core_set_nat_policy()
580  */
581 LINPHONE_PUBLIC void linphone_proxy_config_set_nat_policy(LinphoneProxyConfig *cfg, LinphoneNatPolicy *policy);
582 
583 /**
584  * @}
585  */
586 
587 #ifdef __cplusplus
588 }
589 #endif
590 
591 #endif
592