1
/* $Id: sdp_neg.h 2394 2008-12-23 17:27:53Z bennylp $ */
3
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
* Additional permission under GNU GPL version 3 section 7:
22
* If you modify this program, or any covered work, by linking or
23
* combining it with the OpenSSL project's OpenSSL library (or a
24
* modified version of that library), containing parts covered by the
25
* terms of the OpenSSL or SSLeay licenses, Teluu Inc. (http://www.teluu.com)
26
* grants you additional permission to convey the resulting work.
27
* Corresponding Source for a non-source form of such a combination
28
* shall include the source code for the parts of OpenSSL used as well
29
* as that of the covered work.
31
#ifndef __PJMEDIA_SDP_NEG_H__
32
#define __PJMEDIA_SDP_NEG_H__
37
* @brief SDP negotiator header file.
40
* @defgroup PJMEDIA_SDP_NEG SDP Negotiation State Machine (Offer/Answer Model, RFC 3264)
41
* @ingroup PJMEDIA_SESSION
42
* @brief SDP Negotiation State Machine (Offer/Answer Model, RFC 3264)
45
* The header file <b><pjmedia/sdp_neg.h></b> contains the declaration
46
* of SDP offer and answer negotiator. SDP offer and answer model is described
47
* in RFC 3264 <b>"An Offer/Answer Model with Session Description Protocol
50
* The SDP negotiator is represented with opaque type \a pjmedia_sdp_neg.
51
* This structure contains negotiation state and several SDP session
52
* descriptors currently being used in the negotiation.
55
* \section sdpneg_state_dia SDP Negotiator State Diagram
57
* The following diagram describes the state transition diagram of the
62
* modify_local_offer()
63
* create_w_local_offer() +-------------+ send_local_offer()
64
* ----------------------->| LOCAL_OFFER |<-----------------------
65
* | +-------------+______ |
66
* | | \______ cancel() |
67
* | set_remote_answer() | \______ |
69
* +--+---+ +-----------+ negotiate() +-~----+
70
* | NULL | | WAIT_NEGO |-------------------->| DONE |
71
* +------+ +-----------+ +------+
73
* | set_local_answer() | |
75
* | +--------------+ set_remote_offer() |
76
* ----------------------->| REMOTE_OFFER |<----------------------
77
* create_w_remote_offer() +--------------+
83
* \section sdpneg_offer_answer SDP Offer/Answer Model with Negotiator
85
* \subsection sdpneg_create_offer Creating Initial Offer
87
* Application creates an offer by manualy building the SDP session descriptor
88
* (pjmedia_sdp_session), or request PJMEDIA endpoint (pjmedia_endpt) to
89
* create SDP session descriptor based on capabilities that present in the
90
* endpoint by calling #pjmedia_endpt_create_sdp().
92
* Application then creates SDP negotiator instance by calling
93
* #pjmedia_sdp_neg_create_w_local_offer(), passing the SDP offer in the
94
* function arguments. The SDP negotiator keeps a copy of current local offer,
95
* and update its state to PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER.
97
* Application can then send the initial SDP offer that it creates to
98
* remote peer using signaling protocol such as SIP.
101
* \subsection sdpneg_subseq_offer Generating Subsequent Offer
103
* The negotiator can only create subsequent offer after it has finished
104
* the negotiation process of previous offer/answer session (i.e. the
105
* negotiator state is PJMEDIA_SDP_NEG_STATE_DONE).
107
* If any previous negotiation process was successfull (i.e. the return
108
* value of #pjmedia_sdp_neg_negotiate() was PJ_SUCCESS), the negotiator
109
* keeps both active local and active remote SDP.
111
* If application does not want send modified offer, it can just send
112
* the active local SDP as the offer. In this case, application calls
113
* #pjmedia_sdp_neg_send_local_offer() to get the active local SDP.
115
* If application wants to modify it's local offer, it MUST inform
116
* the negotiator about the modified SDP by calling
117
* #pjmedia_sdp_neg_modify_local_offer().
119
* In both cases, the negotiator will internally create a copy of the offer,
120
* and move it's state to PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER, where it
121
* waits until application passes the remote answer.
124
* \subsection sdpneg_receive_offer Receiving Initial Offer
126
* Application receives an offer in the incoming request from remote to
127
* establish multimedia session, such as incoming INVITE message with SDP
130
* Initially, when the initial offer is received, application creates the
131
* SDP negotiator by calling #pjmedia_sdp_neg_create_w_remote_offer(),
132
* specifying the remote SDP offer in one of the argument.
134
* At this stage, application may or may not ready to create an answer.
135
* For example, a SIP B2BUA needs to make outgoing call and receive SDP
136
* from the outgoing call leg in order to create a SDP answer to the
139
* If application is not ready to create an answer, it passes NULL as
140
* the local SDP when it calls #pjmedia_sdp_neg_create_w_remote_offer().
142
* The section @ref sdpneg_create_answer describes the case when
143
* application is ready to create a SDP answer.
146
* \subsection sdpneg_subseq_offer Receiving Subsequent Offer
148
* Application passes subsequent SDP offer received from remote by
149
* calling #pjmedia_sdp_neg_set_remote_offer().
151
* The negotiator can only receive subsequent offer after it has finished
152
* the negotiation process of previous offer/answer session (i.e. the
153
* negotiator state is PJMEDIA_SDP_NEG_STATE_DONE).
156
* \subsection sdpneg_recv_answer Receiving SDP Answer
158
* When application receives SDP answer from remote, it informs the
159
* negotiator by calling #pjmedia_sdp_neg_set_remote_answer(). The
160
* negotiator validates the answer (#pjmedia_sdp_validate()), and if
161
* succeeds, it moves it's state to PJMEDIA_SDP_NEG_STATE_WAIT_NEGO.
163
* Application then instruct the negotiator to negotiate the remote
164
* answer by calling #pjmedia_sdp_neg_negotiate(). The purpose of
165
* this negotiation is to verify remote answer, and update the initial
166
* offer according to the answer. For example, the initial offer may
167
* specify that a stream is \a sendrecv, while the answer specifies
168
* that remote stream is \a inactive. In this case, the negotiator
169
* will update the stream in the local active media as \a inactive
172
* If #pjmedia_sdp_neg_negotiate() returns PJ_SUCCESS, the negotiator will
173
* keep the updated local answer and remote answer internally. These two
174
* SDPs are called active local SDP and active remote SDP, as it describes
175
* currently active session.
177
* Application can retrieve the active local SDP by calling
178
* #pjmedia_sdp_neg_get_active_local(), and active remote SDP by calling
179
* #pjmedia_sdp_neg_get_active_remote().
181
* If #pjmedia_sdp_neg_negotiate() returns failure (i.e. not PJ_SUCCESS),
182
* it WILL NOT update its active local and active remote SDP.
184
* Regardless of the return status of the #pjmedia_sdp_neg_negotiate(),
185
* the negotiator state will move to PJMEDIA_SDP_NEG_STATE_DONE.
188
* \subsection sdpneg_cancel_offer Cancelling an Offer
190
* In other case, after an offer is generated (negotiator state is in
191
* PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER), the answer may not be received, and
192
* application wants the negotiator to reset itself to its previous state.
193
* Consider this example:
195
* - media has been established, and negotiator state is
196
* PJMEDIA_SDP_NEG_STATE_DONE.
197
* - application generates a new offer for re-INVITE, so in this case
198
* it would either call #pjmedia_sdp_neg_send_local_offer() or
199
* #pjmedia_sdp_neg_modify_local_offer()
200
* - the negotiator state moves to PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER
201
* - the re-INVITE was rejected with an error
203
* Since an answer is not received, it is necessary to reset the negotiator
204
* state back to PJMEDIA_SDP_NEG_STATE_DONE so that the negotiator can
205
* create or receive new offer.
207
* This can be accomplished by calling #pjmedia_sdp_neg_cancel_offer(),
208
* to reset the negotiator state back to PJMEDIA_SDP_NEG_STATE_DONE. In
209
* this case, both active local and active remote will not be modified.
211
* \subsection sdpneg_create_answer Generating SDP Answer
213
* After remote offer has been set in the negotiator, application can
214
* request the SDP negotiator to generate appropriate answer based on local
217
* To do this, first the application MUST have an SDP describing its local
218
* capabilities. This SDP can be built manually, or application can generate
219
* SDP to describe local media endpoint capability by calling
220
* #pjmedia_endpt_create_sdp(). When the application is a SIP B2BUA,
221
* application can treat the SDP received from the outgoing call leg as if
222
* it was it's local capability.
224
* The local SDP session descriptor DOES NOT have to match the SDP offer.
225
* For example, it can have more or less media lines than the offer, or
226
* their order may be different than the offer. The negotiator is capable
227
* to match and reorder local SDP according to remote offer, and create
228
* an answer that is suitable for the offer.
230
* After local SDP capability has been acquired, application can create
233
* If application does not already have the negotiator instance, it creates
234
* one by calling #pjmedia_sdp_neg_create_w_remote_offer(), specifying
235
* both remote SDP offer and local SDP as the arguments. The SDP negotiator
236
* validates both remote and local SDP by calling #pjmedia_sdp_validate(),
237
* and if both SDPs are valid, the negotiator state will move to
238
* PJMEDIA_SDP_NEG_STATE_WAIT_NEGO where it is ready to negotiate the
241
* If application already has the negotiator instance, it sets the local
242
* SDP in the negotiator by calling #pjmedia_sdp_neg_set_local_answer().
243
* The SDP negotiator then validates local SDP (#pjmedia_sdp_validate() ),
244
* and if it is valid, the negotiator state will move to
245
* PJMEDIA_SDP_NEG_STATE_WAIT_NEGO where it is ready to negotiate the
248
* After the SDP negotiator state has moved to PJMEDIA_SDP_NEG_STATE_WAIT_NEGO,
249
* application calls #pjmedia_sdp_neg_negotiate() to instruct the SDP
250
* negotiator to negotiate both offer and answer. This function returns
251
* PJ_SUCCESS if an answer can be generated AND at least one media stream
252
* is active in the session.
254
* If #pjmedia_sdp_neg_negotiate() returns PJ_SUCCESS, the negotiator will
255
* keep the remote offer and local answer internally. These two SDPs are
256
* called active local SDP and active remote SDP, as it describes currently
259
* Application can retrieve the active local SDP by calling
260
* #pjmedia_sdp_neg_get_active_local(), and send this SDP to remote as the
263
* If #pjmedia_sdp_neg_negotiate() returns failure (i.e. not PJ_SUCCESS),
264
* it WILL NOT update its active local and active remote SDP.
266
* Regardless of the return status of the #pjmedia_sdp_neg_negotiate(),
267
* the negotiator state will move to PJMEDIA_SDP_NEG_STATE_DONE.
272
#include <pjmedia/sdp.h>
277
* This enumeration describes SDP negotiation state.
279
enum pjmedia_sdp_neg_state
282
* This is the state of SDP negoator before it is initialized.
284
PJMEDIA_SDP_NEG_STATE_NULL,
287
* This state occurs when SDP negotiator has sent our offer to remote and
288
* it is waiting for answer.
290
PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER,
293
* This state occurs when SDP negotiator has received offer from remote
294
* and currently waiting for local answer.
296
PJMEDIA_SDP_NEG_STATE_REMOTE_OFFER,
299
* This state occurs when an offer (either local or remote) has been
300
* provided with answer. The SDP negotiator is ready to negotiate both
301
* session descriptors. Application can call #pjmedia_sdp_neg_negotiate()
302
* immediately to begin negotiation process.
304
PJMEDIA_SDP_NEG_STATE_WAIT_NEGO,
307
* This state occurs when SDP negotiation has completed, either
308
* successfully or not.
310
PJMEDIA_SDP_NEG_STATE_DONE
315
* @see pjmedia_sdp_neg_state
317
typedef enum pjmedia_sdp_neg_state pjmedia_sdp_neg_state;
321
* Opaque declaration of SDP negotiator.
323
typedef struct pjmedia_sdp_neg pjmedia_sdp_neg;
327
* Get the state string description of the specified state.
329
* @param state Negotiator state.
331
* @return String description of the state.
333
PJ_DECL(const char*) pjmedia_sdp_neg_state_str(pjmedia_sdp_neg_state state);
337
* Create the SDP negotiator with local offer. The SDP negotiator then
338
* will move to PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER state, where it waits
339
* until it receives answer from remote. When SDP answer from remote is
340
* received, application must call #pjmedia_sdp_neg_set_remote_answer().
342
* After calling this function, application should send the local SDP offer
343
* to remote party using signaling protocol such as SIP and wait for SDP
346
* @param pool Pool to allocate memory. The pool's lifetime needs
347
* to be valid for the duration of the negotiator.
348
* @param local The initial local capability.
349
* @param p_neg Pointer to receive the negotiator instance.
351
* @return PJ_SUCCESS on success, or the appropriate error
355
pjmedia_sdp_neg_create_w_local_offer( pj_pool_t *pool,
356
const pjmedia_sdp_session *local,
357
pjmedia_sdp_neg **p_neg);
360
* Initialize the SDP negotiator with remote offer, and optionally
361
* specify the initial local capability, if known. Application normally
362
* calls this function when it receives initial offer from remote.
364
* If local media capability is specified, this capability will be set as
365
* initial local capability of the negotiator, and after this function is
366
* called, the SDP negotiator state will move to state
367
* PJMEDIA_SDP_NEG_STATE_WAIT_NEGO, and the negotiation function can be
370
* If local SDP is not specified, the negotiator will not have initial local
371
* capability, and after this function is called the negotiator state will
372
* move to PJMEDIA_SDP_NEG_STATE_REMOTE_OFFER state. Application MUST supply
373
* local answer later with #pjmedia_sdp_neg_set_local_answer(), before
374
* calling the negotiation function.
376
* @param pool Pool to allocate memory. The pool's lifetime needs
377
* to be valid for the duration of the negotiator.
378
* @param initial Optional initial local capability.
379
* @param remote The remote offer.
380
* @param p_neg Pointer to receive the negotiator instance.
382
* @return PJ_SUCCESS on success, or the appropriate error
386
pjmedia_sdp_neg_create_w_remote_offer(pj_pool_t *pool,
387
const pjmedia_sdp_session *initial,
388
const pjmedia_sdp_session *remote,
389
pjmedia_sdp_neg **p_neg);
392
* This specifies the behavior of the SDP negotiator when responding to an
393
* offer, whether it should rather use the codec preference as set by
394
* remote, or should it rather use the codec preference as specified by
397
* For example, suppose incoming call has codec order "8 0 3", while
398
* local codec order is "3 0 8". If remote codec order is preferable,
399
* the selected codec will be 8, while if local codec order is preferable,
400
* the selected codec will be 3.
402
* By default, the value in PJMEDIA_SDP_NEG_PREFER_REMOTE_CODEC_ORDER will
405
* @param neg The SDP negotiator instance.
406
* @param prefer_remote If non-zero, the negotiator will use the codec
407
* order as specified in remote offer. If zero, it
408
* will prefer to use the local codec order.
411
pjmedia_sdp_neg_set_prefer_remote_codec_order(pjmedia_sdp_neg *neg,
412
pj_bool_t prefer_remote);
416
* Get SDP negotiator state.
418
* @param neg The SDP negotiator instance.
420
* @return The negotiator state.
422
PJ_DECL(pjmedia_sdp_neg_state)
423
pjmedia_sdp_neg_get_state( pjmedia_sdp_neg *neg );
426
* Get the currently active local SDP. Application can only call this
427
* function after negotiation has been done, or otherwise there won't be
428
* active SDPs. Calling this function will not change the state of the
431
* @param neg The SDP negotiator instance.
432
* @param local Pointer to receive the local active SDP.
434
* @return PJ_SUCCESS if local active SDP is present.
437
pjmedia_sdp_neg_get_active_local( pjmedia_sdp_neg *neg,
438
const pjmedia_sdp_session **local);
441
* Get the currently active remote SDP. Application can only call this
442
* function after negotiation has been done, or otherwise there won't be
443
* active SDPs. Calling this function will not change the state of the
446
* @param neg The SDP negotiator instance.
447
* @param remote Pointer to receive the remote active SDP.
449
* @return PJ_SUCCESS if remote active SDP is present.
452
pjmedia_sdp_neg_get_active_remote( pjmedia_sdp_neg *neg,
453
const pjmedia_sdp_session **remote);
457
* Determine whether remote sent answer (as opposed to offer) on the
458
* last negotiation. This function can only be called in state
459
* PJMEDIA_SDP_NEG_STATE_DONE.
461
* @param neg The SDP negotiator instance.
463
* @return Non-zero if it was remote who sent answer,
464
* otherwise zero if it was local who supplied
468
pjmedia_sdp_neg_was_answer_remote(pjmedia_sdp_neg *neg);
472
* Get the current remote SDP offer or answer. Application can only
473
* call this function in state PJMEDIA_SDP_NEG_STATE_REMOTE_OFFER or
474
* PJMEDIA_SDP_NEG_STATE_WAIT_NEGO, or otherwise there won't be remote
475
* SDP offer/answer. Calling this function will not change the state
478
* @param neg The SDP negotiator instance.
479
* @param remote Pointer to receive the current remote offer or
482
* @return PJ_SUCCESS if the negotiator currently has
483
* remote offer or answer.
486
pjmedia_sdp_neg_get_neg_remote( pjmedia_sdp_neg *neg,
487
const pjmedia_sdp_session **remote);
491
* Get the current local SDP offer or answer. Application can only
492
* call this function in state PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER or
493
* PJMEDIA_SDP_NEG_STATE_WAIT_NEGO, or otherwise there won't be local
494
* SDP offer/answer. Calling this function will not change the state
497
* @param neg The SDP negotiator instance.
498
* @param local Pointer to receive the current local offer or
501
* @return PJ_SUCCESS if the negotiator currently has
502
* local offer or answer.
505
pjmedia_sdp_neg_get_neg_local( pjmedia_sdp_neg *neg,
506
const pjmedia_sdp_session **local);
509
* Modify local session with a new SDP and treat this as a new offer.
510
* This function can only be called in state PJMEDIA_SDP_NEG_STATE_DONE.
511
* After calling this function, application can send the SDP as offer
512
* to remote party, using signaling protocol such as SIP.
513
* The negotiator state will move to PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER,
514
* where it waits for SDP answer from remote.
516
* @param pool Pool to allocate memory. The pool's lifetime needs
517
* to be valid for the duration of the negotiator.
518
* @param neg The SDP negotiator instance.
519
* @param local The new local SDP.
521
* @return PJ_SUCCESS on success, or the appropriate
525
pjmedia_sdp_neg_modify_local_offer( pj_pool_t *pool,
526
pjmedia_sdp_neg *neg,
527
const pjmedia_sdp_session *local);
530
* This function can only be called in PJMEDIA_SDP_NEG_STATE_DONE state.
531
* Application calls this function to retrieve currently active
532
* local SDP, and then send the SDP to remote as an offer. The negotiator
533
* state will then move to PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER, where it waits
534
* for SDP answer from remote.
536
* When SDP answer has been received from remote, application must call
537
* #pjmedia_sdp_neg_set_remote_answer().
539
* @param pool Pool to allocate memory. The pool's lifetime needs
540
* to be valid for the duration of the negotiator.
541
* @param neg The SDP negotiator instance.
542
* @param offer Pointer to receive active local SDP to be
545
* @return PJ_SUCCESS if local offer can be created.
548
pjmedia_sdp_neg_send_local_offer( pj_pool_t *pool,
549
pjmedia_sdp_neg *neg,
550
const pjmedia_sdp_session **offer);
553
* This function can only be called in PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER
554
* state, i.e. after application calls #pjmedia_sdp_neg_send_local_offer()
555
* function. Application calls this function when it receives SDP answer
556
* from remote. After this function is called, the negotiator state will
557
* move to PJMEDIA_SDP_NEG_STATE_WAIT_NEGO, and application can call the
558
* negotiation function #pjmedia_sdp_neg_negotiate().
560
* @param pool Pool to allocate memory. The pool's lifetime needs
561
* to be valid for the duration of the negotiator.
562
* @param neg The SDP negotiator instance.
563
* @param remote The remote answer.
565
* @return PJ_SUCCESS on success.
568
pjmedia_sdp_neg_set_remote_answer( pj_pool_t *pool,
569
pjmedia_sdp_neg *neg,
570
const pjmedia_sdp_session *remote);
575
* This function can only be called in PJMEDIA_SDP_NEG_STATE_DONE state.
576
* Application calls this function when it receives SDP offer from remote.
577
* After this function is called, the negotiator state will move to
578
* PJMEDIA_SDP_NEG_STATE_REMOTE_OFFER, and application MUST call the
579
* #pjmedia_sdp_neg_set_local_answer() to set local answer before it can
580
* call the negotiation function.
582
* @param pool Pool to allocate memory. The pool's lifetime needs
583
* to be valid for the duration of the negotiator.
584
* @param neg The SDP negotiator instance.
585
* @param remote The remote offer.
587
* @return PJ_SUCCESS on success.
590
pjmedia_sdp_neg_set_remote_offer( pj_pool_t *pool,
591
pjmedia_sdp_neg *neg,
592
const pjmedia_sdp_session *remote);
597
* This function can only be called in PJMEDIA_SDP_NEG_STATE_REMOTE_OFFER
598
* state, i.e. after application calls #pjmedia_sdp_neg_set_remote_offer()
599
* function. After this function is called, the negotiator state will
600
* move to PJMEDIA_SDP_NEG_STATE_WAIT_NEGO, and application can call the
601
* negotiation function #pjmedia_sdp_neg_negotiate().
603
* @param pool Pool to allocate memory. The pool's lifetime needs
604
* to be valid for the duration of the negotiator.
605
* @param neg The SDP negotiator instance.
606
* @param local Optional local answer. If negotiator has initial
607
* local capability, application can specify NULL on
608
* this argument; in this case, the negotiator will
609
* create answer by by negotiating remote offer with
610
* initial local capability. If negotiator doesn't have
611
* initial local capability, application MUST specify
614
* @return PJ_SUCCESS on success.
617
pjmedia_sdp_neg_set_local_answer( pj_pool_t *pool,
618
pjmedia_sdp_neg *neg,
619
const pjmedia_sdp_session *local);
623
* Call this function when the negotiator is in PJMEDIA_SDP_NEG_STATE_WAIT_NEGO
624
* state to see if it was local who is answering the offer (instead of
627
* @param neg The negotiator.
629
* @return PJ_TRUE if it is local is answering an offer, PJ_FALSE
630
* if remote has answered local offer.
632
PJ_DECL(pj_bool_t) pjmedia_sdp_neg_has_local_answer(pjmedia_sdp_neg *neg);
636
* Cancel previously sent offer, and move negotiator state back to
637
* previous stable state (PJMEDIA_SDP_NEG_STATE_DONE). The negotiator
638
* must be in PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER state.
640
* @param neg The negotiator.
642
* @return PJ_SUCCESS or the appropriate error code.
644
PJ_DECL(pj_status_t) pjmedia_sdp_neg_cancel_offer(pjmedia_sdp_neg *neg);
648
* Negotiate local and remote answer. Before calling this function, the
649
* SDP negotiator must be in PJMEDIA_SDP_NEG_STATE_WAIT_NEGO state.
650
* After calling this function, the negotiator state will move to
651
* PJMEDIA_SDP_NEG_STATE_DONE regardless whether the negotiation has
652
* been successfull or not.
654
* If the negotiation succeeds (i.e. the return value is PJ_SUCCESS),
655
* the active local and remote SDP will be replaced with the new SDP
656
* from the negotiation process.
658
* If the negotiation fails, the active local and remote SDP will not
661
* @param pool Pool to allocate memory. The pool's lifetime needs
662
* to be valid for the duration of the negotiator.
663
* @param neg The SDP negotiator instance.
664
* @param allow_asym Should be zero.
666
* @return PJ_SUCCESS when there is at least one media
667
* is actuve common in both offer and answer, or
668
* failure code when negotiation has failed.
670
PJ_DECL(pj_status_t) pjmedia_sdp_neg_negotiate( pj_pool_t *pool,
671
pjmedia_sdp_neg *neg,
672
pj_bool_t allow_asym);
684
#endif /* __PJMEDIA_SDP_NEG_H__ */