summaryrefslogtreecommitdiff
path: root/include/asterisk/sdp_options.h
blob: e45ae8cb106f90724e247f2130ef8fed28ce5147 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
/*
 * Asterisk -- An open source telephony toolkit.
 *
 * Copyright (C) 2017, Digium, Inc.
 *
 * Mark Michelson <mmichelson@digium.com>
 *
 * See http://www.asterisk.org for more information about
 * the Asterisk project. Please do not directly contact
 * any of the maintainers of this project for assistance;
 * the project provides a web site, mailing lists and IRC
 * channels for your use.
 *
 * This program is free software, distributed under the terms of
 * the GNU General Public License Version 2. See the LICENSE file
 * at the top of the source tree.
 */

#ifndef _ASTERISK_SDP_OPTIONS_H
#define _ASTERISK_SDP_OPTIONS_H

#include "asterisk/udptl.h"
#include "asterisk/format_cap.h"

struct ast_sdp_options;

/*!
 * \brief SDP DTMF mode options
 */
enum ast_sdp_options_dtmf {
	/*! No DTMF to be used */
	AST_SDP_DTMF_NONE,
	/*! Use RFC 4733 events for DTMF */
	AST_SDP_DTMF_RFC_4733,
	/*! Use DTMF in the audio stream */
	AST_SDP_DTMF_INBAND,
	/*! Use SIP 4733 if supported by the other side or INBAND if not */
	AST_SDP_DTMF_AUTO,
};

/*!
 * \brief ICE options
 *
 * This is an enum because it will support a TRICKLE-ICE option
 * in the future.
 */
enum ast_sdp_options_ice {
	/*! ICE is not enabled on this session */
	AST_SDP_ICE_DISABLED,
	/*! Standard ICE is enabled on this session */
	AST_SDP_ICE_ENABLED_STANDARD,
};

/*!
 * \brief Implementation of the SDP
 *
 * Users of the SDP API set the implementation based on what they
 * natively handle. This indicates the type of SDP that the API expects
 * when being given an SDP, and it indicates the type of SDP that the API
 * returns when asked for one.
 */
enum ast_sdp_options_impl {
	/*! SDP is represented as a string */
	AST_SDP_IMPL_STRING,
	/*! SDP is represented as a pjmedia_sdp_session */
	AST_SDP_IMPL_PJMEDIA,
	/*! End of the list */
	AST_SDP_IMPL_END,
};

/*!
 * \brief SDP encryption options
 */
enum ast_sdp_options_encryption {
	/*! No encryption */
	AST_SDP_ENCRYPTION_DISABLED,
	/*! SRTP SDES encryption */
	AST_SDP_ENCRYPTION_SRTP_SDES,
	/*! DTLS encryption */
	AST_SDP_ENCRYPTION_DTLS,
};

/*!
 * \brief Callback when processing an offer SDP for our answer SDP.
 * \since 15.0.0
 *
 * \details
 * This callback is called after merging our last negotiated topology
 * with the remote's offer topology and before we have sent our answer
 * SDP.  At this point you can alter new_topology streams.  You can
 * decline, remove formats, or rename streams.  Changing anything else
 * on the streams is likely to not end well.
 *
 * * To decline a stream simply set the stream state to
 *   AST_STREAM_STATE_REMOVED.  You could implement a maximum number
 *   of active streams of a given type policy.
 *
 * * To remove formats use the format API to remove any formats from a
 *   stream.  The streams have the current joint negotiated formats.
 *   Most likely you would want to remove all but the first format.
 *
 * * To rename a stream you need to clone the stream and give it a
 *   new name and then set it in new_topology using
 *   ast_stream_topology_set_stream().
 *
 * \note Removing all formats is an error.  You should decline the
 * stream instead.
 *
 * \param context User supplied context data pointer for the SDP
 * state.
 * \param old_topology Active negotiated topology.  NULL if this is
 * the first SDP negotiation.  The old topology is available so you
 * can tell if any streams are new or changing type.
 * \param new_topology New negotiated topology that we intend to
 * generate the answer SDP.
 *
 * \return Nothing
 */
typedef void (*ast_sdp_answerer_modify_cb)(void *context,
	const struct ast_stream_topology *old_topology,
	struct ast_stream_topology *new_topology);

/*!
 * \internal
 * \brief Callback when generating a topology for our SDP offer.
 * \since 15.0.0
 *
 * \details
 * This callback is called after merging any topology updates from the
 * system by ast_sdp_state_update_local_topology() and before we have
 * sent our offer SDP.  At this point you can alter new_topology
 * streams.  You can decline, add/remove/update formats, or rename
 * streams.  Changing anything else on the streams is likely to not
 * end well.
 *
 * * To decline a stream simply set the stream state to
 *   AST_STREAM_STATE_REMOVED.  You could implement a maximum number
 *   of active streams of a given type policy.
 *
 * * To update formats use the format API to change formats of the
 *   streams.  The streams have the current proposed formats.  You
 *   could do whatever you want for formats but you should stay within
 *   the configured formats for the stream type's endpoint.  However,
 *   you should use ast_sdp_state_update_local_topology() instead of
 *   this backdoor method.
 *
 * * To rename a stream you need to clone the stream and give it a
 *   new name and then set it in new_topology using
 *   ast_stream_topology_set_stream().
 *
 * \note Removing all formats is an error.  You should decline the
 * stream instead.
 *
 * \note Declined new streams that are in slots higher than present in
 * old_topology are removed so the SDP can be smaller.  The remote has
 * never seen those slots so we shouldn't bother keeping them.
 *
 * \param context User supplied context data pointer for the SDP
 * state.
 * \param old_topology Active negotiated topology.  NULL if this is
 * the first SDP negotiation.  The old topology is available so you
 * can tell if any streams are new or changing type.
 * \param new_topology Merged topology that we intend to generate the
 * offer SDP.
 *
 * \return Nothing
 */
typedef void (*ast_sdp_offerer_modify_cb)(void *context,
	const struct ast_stream_topology *old_topology,
	struct ast_stream_topology *new_topology);

/*!
 * \brief Callback when generating an offer SDP to configure extra stream data.
 * \since 15.0.0
 *
 * \details
 * This callback is called after any ast_sdp_offerer_modify_cb
 * callback and before we have sent our offer SDP.  The callback can
 * call several SDP API calls to configure the proposed capabilities
 * of streams before we create the SDP offer.  For example, the
 * callback could configure a stream specific connection address, T.38
 * parameters, RTP instance, or UDPTL instance parameters.
 *
 * \param context User supplied context data pointer for the SDP
 * state.
 * \param topology Topology ready to configure extra stream options.
 *
 * \return Nothing
 */
typedef void (*ast_sdp_offerer_config_cb)(void *context, const struct ast_stream_topology *topology);

/*!
 * \brief Callback before applying a topology.
 * \since 15.0.0
 *
 * \details
 * This callback is called before the topology is applied so the
 * using module can do what is necessary before the topology becomes
 * active.
 *
 * \param context User supplied context data pointer for the SDP
 * state.
 * \param topology Topology ready to be applied.
 *
 * \return Nothing
 */
typedef void (*ast_sdp_preapply_cb)(void *context, const struct ast_stream_topology *topology);

/*!
 * \brief Callback after applying a topology.
 * \since 15.0.0
 *
 * \details
 * This callback is called after the topology is applied so the
 * using module can do what is necessary after the topology becomes
 * active.
 *
 * \param context User supplied context data pointer for the SDP
 * state.
 * \param topology Topology already applied.
 *
 * \return Nothing
 */
typedef void (*ast_sdp_postapply_cb)(void *context, const struct ast_stream_topology *topology);

/*!
 * \since 15.0.0
 * \brief Allocate a new SDP options structure.
 *
 * This will heap-allocate an SDP options structure and
 * initialize it to a set of default values.
 *
 * \retval NULL Allocation failure
 * \retval non-NULL Newly allocated SDP options
 */
struct ast_sdp_options *ast_sdp_options_alloc(void);

/*!
 * \since 15.0.0
 * \brief Free an SDP options structure.
 *
 * \note This only needs to be called if an error occurs between
 *       options allocation and a call to ast_sdp_state_alloc()
 *       Otherwise, the SDP state will take care of freeing the
 *       options for you.
 *
 * \param options The options to free
 */
void ast_sdp_options_free(struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options media_address
 *
 * \param options SDP Options
 * \param media_address
 */
void ast_sdp_options_set_media_address(struct ast_sdp_options *options,
	const char *media_address);

/*!
 * \since 15.0.0
 * \brief Get SDP Options media_address
 *
 * \param options SDP Options
 *
 * \returns media_address
 */
const char *ast_sdp_options_get_media_address(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options interface_address
 *
 * \param options SDP Options
 * \param interface_address
 */
void ast_sdp_options_set_interface_address(struct ast_sdp_options *options,
	const char *interface_address);

/*!
 * \since 15.0.0
 * \brief Get SDP Options interface_address
 *
 * \param options SDP Options
 *
 * \returns interface_address
 */
const char *ast_sdp_options_get_interface_address(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options sdpowner
 *
 * \param options SDP Options
 * \param sdpowner
 */
void ast_sdp_options_set_sdpowner(struct ast_sdp_options *options,
	const char *sdpowner);

/*!
 * \since 15.0.0
 * \brief Get SDP Options sdpowner
 *
 * \param options SDP Options
 *
 * \returns sdpowner
 */
const char *ast_sdp_options_get_sdpowner(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options sdpsession
 *
 * \param options SDP Options
 * \param sdpsession
 */
void ast_sdp_options_set_sdpsession(struct ast_sdp_options *options,
	const char *sdpsession);

/*!
 * \since 15.0.0
 * \brief Get SDP Options sdpsession
 *
 * \param options SDP Options
 *
 * \returns sdpsession
 */
const char *ast_sdp_options_get_sdpsession(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options rtp_engine
 *
 * \param options SDP Options
 * \param rtp_engine
 */
void ast_sdp_options_set_rtp_engine(struct ast_sdp_options *options,
	const char *rtp_engine);

/*!
 * \since 15.0.0
 * \brief Get SDP Options rtp_engine
 *
 * \param options SDP Options
 *
 * \returns rtp_engine
 */
const char *ast_sdp_options_get_rtp_engine(const struct ast_sdp_options *options);

void ast_sdp_options_set_state_context(struct ast_sdp_options *options, void *state_context);
void *ast_sdp_options_get_state_context(const struct ast_sdp_options *options);

void ast_sdp_options_set_answerer_modify_cb(struct ast_sdp_options *options, ast_sdp_answerer_modify_cb answerer_modify_cb);
ast_sdp_answerer_modify_cb ast_sdp_options_get_answerer_modify_cb(const struct ast_sdp_options *options);

void ast_sdp_options_set_offerer_modify_cb(struct ast_sdp_options *options, ast_sdp_offerer_modify_cb offerer_modify_cb);
ast_sdp_offerer_modify_cb ast_sdp_options_get_offerer_modify_cb(const struct ast_sdp_options *options);

void ast_sdp_options_set_offerer_config_cb(struct ast_sdp_options *options, ast_sdp_offerer_config_cb offerer_config_cb);
ast_sdp_offerer_config_cb ast_sdp_options_get_offerer_config_cb(const struct ast_sdp_options *options);

void ast_sdp_options_set_preapply_cb(struct ast_sdp_options *options, ast_sdp_preapply_cb preapply_cb);
ast_sdp_preapply_cb ast_sdp_options_get_preapply_cb(const struct ast_sdp_options *options);

void ast_sdp_options_set_postapply_cb(struct ast_sdp_options *options, ast_sdp_postapply_cb postapply_cb);
ast_sdp_postapply_cb ast_sdp_options_get_postapply_cb(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options rtp_symmetric
 *
 * \param options SDP Options
 * \param rtp_symmetric
 */
void ast_sdp_options_set_rtp_symmetric(struct ast_sdp_options *options,
	unsigned int rtp_symmetric);

/*!
 * \since 15.0.0
 * \brief Get SDP Options rtp_symmetric
 *
 * \param options SDP Options
 *
 * \returns rtp_symmetric
 */
unsigned int ast_sdp_options_get_rtp_symmetric(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options rtp_ipv6
 *
 * \param options SDP Options
 * \param rtp_ipv6
 */
void ast_sdp_options_set_rtp_ipv6(struct ast_sdp_options *options,
	unsigned int rtp_ipv6);

/*!
 * \since 15.0.0
 * \brief Get SDP Options rtp_ipv6
 *
 * \param options SDP Options
 *
 * \returns rtp_ipv6
 */
unsigned int ast_sdp_options_get_rtp_ipv6(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options g726_non_standard
 *
 * \param options SDP Options
 * \param g726_non_standard
 */
void ast_sdp_options_set_g726_non_standard(struct ast_sdp_options *options,
	unsigned int g726_non_standard);

/*!
 * \since 15.0.0
 * \brief Get SDP Options g726_non_standard
 *
 * \param options SDP Options
 *
 * \returns g726_non_standard
 */
unsigned int ast_sdp_options_get_g726_non_standard(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options tos_audio
 *
 * \param options SDP Options
 * \param tos_audio
 */
void ast_sdp_options_set_tos_audio(struct ast_sdp_options *options,
	unsigned int tos_audio);

/*!
 * \since 15.0.0
 * \brief Get SDP Options tos_audio
 *
 * \param options SDP Options
 *
 * \returns tos_audio
 */
unsigned int ast_sdp_options_get_tos_audio(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options cos_audio
 *
 * \param options SDP Options
 * \param cos_audio
 */
void ast_sdp_options_set_cos_audio(struct ast_sdp_options *options,
	unsigned int cos_audio);

/*!
 * \since 15.0.0
 * \brief Get SDP Options cos_audio
 *
 * \param options SDP Options
 *
 * \returns cos_audio
 */
unsigned int ast_sdp_options_get_cos_audio(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options tos_video
 *
 * \param options SDP Options
 * \param tos_video
 */
void ast_sdp_options_set_tos_video(struct ast_sdp_options *options,
	unsigned int tos_video);

/*!
 * \since 15.0.0
 * \brief Get SDP Options tos_video
 *
 * \param options SDP Options
 *
 * \returns tos_video
 */
unsigned int ast_sdp_options_get_tos_video(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options cos_video
 *
 * \param options SDP Options
 * \param cos_video
 */
void ast_sdp_options_set_cos_video(struct ast_sdp_options *options,
	unsigned int cos_video);

/*!
 * \since 15.0.0
 * \brief Get SDP Options cos_video
 *
 * \param options SDP Options
 *
 * \returns cos_video
 */
unsigned int ast_sdp_options_get_cos_video(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options dtmf
 *
 * \param options SDP Options
 * \param dtmf
 */
void ast_sdp_options_set_dtmf(struct ast_sdp_options *options,
	enum ast_sdp_options_dtmf dtmf);

/*!
 * \since 15.0.0
 * \brief Get SDP Options dtmf
 *
 * \param options SDP Options
 *
 * \returns dtmf
 */
enum ast_sdp_options_dtmf ast_sdp_options_get_dtmf(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options ice
 *
 * \param options SDP Options
 * \param ice
 */
void ast_sdp_options_set_ice(struct ast_sdp_options *options,
	enum ast_sdp_options_ice ice);

/*!
 * \since 15.0.0
 * \brief Get SDP Options ice
 *
 * \param options SDP Options
 *
 * \returns ice
 */
enum ast_sdp_options_ice ast_sdp_options_get_ice(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options impl
 *
 * \param options SDP Options
 * \param impl
 */
void ast_sdp_options_set_impl(struct ast_sdp_options *options,
	enum ast_sdp_options_impl impl);

/*!
 * \since 15.0.0
 * \brief Get SDP Options impl
 *
 * \param options SDP Options
 *
 * \returns impl
 */
enum ast_sdp_options_impl ast_sdp_options_get_impl(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options encryption
 *
 * \param options SDP Options
 * \param encryption
 */
void ast_sdp_options_set_encryption(struct ast_sdp_options *options,
	enum ast_sdp_options_encryption encryption);

/*!
 * \since 15.0.0
 * \brief Get SDP Options encryption
 *
 * \param options SDP Options
 *
 * \returns encryption
 */
enum ast_sdp_options_encryption ast_sdp_options_get_encryption(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Get SDP Options RTCP MUX
 *
 * \param options SDP Options
 *
 * \returns Boolean indicating if RTCP MUX is enabled.
 */
unsigned int ast_sdp_options_get_rtcp_mux(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options RTCP MUX
 *
 * \param options SDP Options
 * \param value Boolean that indicates if RTCP MUX should be enabled.
 */
void ast_sdp_options_set_rtcp_mux(struct ast_sdp_options *options, unsigned int value);

/*!
 * \since 15.0.0
 * \brief Set SDP Options udptl_symmetric
 *
 * \param options SDP Options
 * \param udptl_symmetric
 */
void ast_sdp_options_set_udptl_symmetric(struct ast_sdp_options *options,
	unsigned int udptl_symmetric);

/*!
 * \since 15.0.0
 * \brief Get SDP Options udptl_symmetric
 *
 * \param options SDP Options
 *
 * \returns udptl_symmetric
 */
unsigned int ast_sdp_options_get_udptl_symmetric(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options udptl_error_correction
 *
 * \param options SDP Options
 * \param error_correction
 */
void ast_sdp_options_set_udptl_error_correction(struct ast_sdp_options *options,
	enum ast_t38_ec_modes error_correction);

/*!
 * \since 15.0.0
 * \brief Get SDP Options udptl_error_correction
 *
 * \param options SDP Options
 *
 * \returns udptl_error_correction
 */
enum ast_t38_ec_modes ast_sdp_options_get_udptl_error_correction(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options udptl_far_max_datagram
 *
 * \param options SDP Options
 * \param far_max_datagram
 */
void ast_sdp_options_set_udptl_far_max_datagram(struct ast_sdp_options *options,
	unsigned int far_max_datagram);

/*!
 * \since 15.0.0
 * \brief Get SDP Options udptl_far_max_datagram
 *
 * \param options SDP Options
 *
 * \returns udptl_far_max_datagram
 */
unsigned int ast_sdp_options_get_udptl_far_max_datagram(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Set SDP Options max_streams
 *
 * \param options SDP Options
 * \param max_streams
 */
void ast_sdp_options_set_max_streams(struct ast_sdp_options *options,
	unsigned int max_streams);

/*!
 * \since 15.0.0
 * \brief Get SDP Options max_streams
 *
 * \param options SDP Options
 *
 * \returns max_streams
 */
unsigned int ast_sdp_options_get_max_streams(const struct ast_sdp_options *options);

/*!
 * \since 15.0.0
 * \brief Enable setting SSRC level attributes on SDPs
 *
 * \param options SDP Options
 * \param ssrc Boolean indicating if SSRC attributes should be included in generated SDPs
 */
void ast_sdp_options_set_ssrc(struct ast_sdp_options *options, unsigned int ssrc);

/*!
 * \since 15.0.0
 * \brief Get SDP Options ssrc
 *
 * \param options SDP Options
 *
 * \returns Whether SSRC-level attributes will be added to our SDP.
 */
unsigned int ast_sdp_options_get_ssrc(const struct ast_sdp_options *options);

/*!
 * \brief Set the SDP options scheduler context used to create new streams of the type.
 * \since 15.0.0
 *
 * \param options SDP Options
 * \param type Media type the scheduler context is for.
 * \param sched Scheduler context to use for the specified media type.
 *
 * \return Nothing
 */
void ast_sdp_options_set_sched_type(struct ast_sdp_options *options,
	enum ast_media_type type, struct ast_sched_context *sched);

/*!
 * \brief Get the SDP options scheduler context used to create new streams of the type.
 * \since 15.0.0
 *
 * \param options SDP Options
 * \param type Media type the format cap represents.
 *
 * \return The stored scheduler context to create new streams of the type.
 */
struct ast_sched_context *ast_sdp_options_get_sched_type(const struct ast_sdp_options *options,
	enum ast_media_type type);

/*!
 * \brief Set all allowed stream types to create new streams.
 * \since 15.0.0
 *
 * \param options SDP Options
 * \param cap Format capabilities to set all allowed stream types at once.
 *            Could be NULL to disable creating any new streams.
 *
 * \return Nothing
 */
void ast_sdp_options_set_format_caps(struct ast_sdp_options *options,
	struct ast_format_cap *cap);

/*!
 * \brief Set the SDP options format cap used to create new streams of the type.
 * \since 15.0.0
 *
 * \param options SDP Options
 * \param type Media type the format cap represents.
 * \param cap Format capabilities to use for the specified media type.
 *            Could be NULL to disable creating new streams of type.
 *
 * \return Nothing
 */
void ast_sdp_options_set_format_cap_type(struct ast_sdp_options *options,
	enum ast_media_type type, struct ast_format_cap *cap);

/*!
 * \brief Get the SDP options format cap used to create new streams of the type.
 * \since 15.0.0
 *
 * \param options SDP Options
 * \param type Media type the format cap represents.
 *
 * \retval NULL if stream not allowed to be created.
 * \retval cap to use in negotiating the new stream.
 *
 * \note The returned cap does not have its own ao2 ref.
 */
struct ast_format_cap *ast_sdp_options_get_format_cap_type(const struct ast_sdp_options *options,
	enum ast_media_type type);

#endif /* _ASTERISK_SDP_OPTIONS_H */