diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-11-05 05:54:25 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-11-05 05:54:25 +0000 |
commit | 25e349017057a341703e5689039474403707455f (patch) | |
tree | 8fd7da4ce5ff1671cc0fbc42e929bdc2f925e717 /pjsip/src/pjsua-lib | |
parent | 813c120fd8f76524de3c36d504c0582367f3b020 (diff) |
Increment SDP version upon creating subsequent offer inside the call (ref: Sipit21/Mon/12:30)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1549 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_call.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index cb4959b3..aaf02efe 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -71,6 +71,21 @@ static void pjsua_call_on_tsx_state_changed(pjsip_inv_session *inv, static pj_status_t create_inactive_sdp(pjsua_call *call, pjmedia_sdp_session **p_answer); +/* Update SDP version in the offer */ +static void update_sdp_version(pjsua_call *call, + pjmedia_sdp_session *sdp) +{ + const pjmedia_sdp_session *old_sdp = NULL; + pj_status_t status; + + status = pjmedia_sdp_neg_get_active_local(call->inv->neg, &old_sdp); + if (status != PJ_SUCCESS || old_sdp == NULL) + return; + + sdp->origin.version = old_sdp->origin.version + 1; +} + + /* * Callback called by event framework when the xfer subscription state * has changed. @@ -1222,6 +1237,8 @@ PJ_DEF(pj_status_t) pjsua_call_set_hold(pjsua_call_id call_id, return status; } + update_sdp_version(call, sdp); + /* Create re-INVITE with new offer */ status = pjsip_inv_reinvite( call->inv, NULL, sdp, &tdata); if (status != PJ_SUCCESS) { @@ -1293,6 +1310,8 @@ PJ_DEF(pj_status_t) pjsua_call_reinvite( pjsua_call_id call_id, return status; } + update_sdp_version(call, sdp); + /* Create re-INVITE with new offer */ status = pjsip_inv_reinvite( call->inv, NULL, sdp, &tdata); if (status != PJ_SUCCESS) { @@ -2506,6 +2525,7 @@ static void pjsua_call_on_create_offer(pjsip_inv_session *inv, return; } + update_sdp_version(call, *offer); PJSUA_UNLOCK(); } |