From 01483432d459b7fe5637929328a701e0c3f4fdd8 Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Fri, 4 Jun 2010 13:41:34 +0000 Subject: Re #668: - Fixed process_answer() of SDP negotiation, when no common format in a media, instead of returning error, it should just deactivate the media (offer & answer) and continue negotiating next media. - Generalized the way of deactivating media: set port to 0 and remove all attributes. - Added new API pjmedia_sdp_media_clone_deactivate() to clone media and deactivate the newly cloned media. - Updated PJMEDIA SDP negotiation test. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3198 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsua-lib/pjsua_media.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'pjsip/src/pjsua-lib/pjsua_media.c') diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c index ed5a99ad..311c015c 100644 --- a/pjsip/src/pjsua-lib/pjsua_media.c +++ b/pjsip/src/pjsua-lib/pjsua_media.c @@ -1301,32 +1301,11 @@ pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id, for (i=0; imedia_count; ++i) { const pjmedia_sdp_media *rem_m = rem_sdp->media[i]; pjmedia_sdp_media *m; - const pjmedia_sdp_attr *a; if ((int)i == call->audio_idx) continue; - m = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media); - pj_strdup(pool, &m->desc.media, &rem_m->desc.media); - pj_strdup(pool, &m->desc.transport, &rem_m->desc.transport); - m->desc.port = 0; - - /* Add one format, copy from the offer. And copy the corresponding - * rtpmap and fmtp attributes too. - */ - m->desc.fmt_count = 1; - pj_strdup(pool, &m->desc.fmt[0], &rem_m->desc.fmt[0]); - if ((a=pjmedia_sdp_attr_find2(rem_m->attr_count, rem_m->attr, - "rtpmap", &m->desc.fmt[0])) != NULL) - { - m->attr[m->attr_count++] = pjmedia_sdp_attr_clone(pool, a); - } - if ((a=pjmedia_sdp_attr_find2(rem_m->attr_count, rem_m->attr, - "fmtp", &m->desc.fmt[0])) != NULL) - { - m->attr[m->attr_count++] = pjmedia_sdp_attr_clone(pool, a); - } - + m = pjmedia_sdp_media_clone_deactivate(pool, rem_m); if (i==sdp->media_count) sdp->media[sdp->media_count++] = m; else { -- cgit v1.2.3