From 998a1fa8fdb03e9922184fb1202d1e4705086030 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Thu, 23 Apr 2009 11:50:25 +0000 Subject: Fixed ticket #794: Bug with generating SDP version in origin line (thanks Joel Dodson for the report) - the INVITE session now correctly uses the SDP offer "fixed" by the negotiator, hence it will have the correct origin fields. - removed update_sdp_version() from PJSUA-LIB - the negotiator now also fixes the session ID of subsequent answer so that it's identical to the previous SDP git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2643 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/src/pjmedia/sdp_neg.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'pjmedia') diff --git a/pjmedia/src/pjmedia/sdp_neg.c b/pjmedia/src/pjmedia/sdp_neg.c index bbc5148e..60ca36ef 100644 --- a/pjmedia/src/pjmedia/sdp_neg.c +++ b/pjmedia/src/pjmedia/sdp_neg.c @@ -422,10 +422,18 @@ PJ_DEF(pj_status_t) pjmedia_sdp_neg_set_local_answer( pj_pool_t *pool, /* State now is STATE_WAIT_NEGO. */ neg->state = PJMEDIA_SDP_NEG_STATE_WAIT_NEGO; if (local) { - if (!neg->initial_sdp) { + neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, local); + if (neg->initial_sdp) { + /* I don't think there is anything in RFC 3264 that mandates + * answerer to place the same origin (and increment version) + * in the answer, but probably it won't hurt either. + * Note that the version will be incremented in + * pjmedia_sdp_neg_negotiate() + */ + neg->neg_local_sdp->origin.id = neg->initial_sdp->origin.id; + } else { neg->initial_sdp = pjmedia_sdp_session_clone(pool, local); } - neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, local); } else { PJ_ASSERT_RETURN(neg->initial_sdp, PJMEDIA_SDPNEG_ENOINITIAL); neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, neg->initial_sdp); -- cgit v1.2.3