Close #1403: Fixed pjsua-lib in generating re-offer when the current session contains (disabled) unknown media types.

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@3865 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Nanang Izzuddin 2011-10-26 16:57:05 +00:00
parent 0ee072f2e3
commit cfa312c830
1 changed files with 14 additions and 8 deletions

View File

@ -1942,15 +1942,21 @@ pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id,
m->desc.fmt[0] = pj_str("31"); m->desc.fmt[0] = pj_str("31");
break; break;
default: default:
if (rem_sdp) { /* This must be us generating re-offer, and some unknown
pj_strdup(pool, &m->desc.media, * media may exist, so just clone from active local SDP
&rem_sdp->media[mi]->desc.media); * (and it should have been deactivated already).
pj_strdup(pool, &m->desc.fmt[0], */
&rem_sdp->media[mi]->desc.fmt[0]); pj_assert(call->inv && call->inv->neg &&
} else { sdp_neg_state == PJMEDIA_SDP_NEG_STATE_DONE);
pj_assert(!"Invalid call_med media type"); {
return PJ_EBUG; const pjmedia_sdp_session *s_;
pjmedia_sdp_neg_get_active_local(call->inv->neg, &s_);
pj_assert(mi < s_->media_count);
m = pjmedia_sdp_media_clone(pool, s_->media[mi]);
m->desc.port = 0;
} }
break;
} }
} }