diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2010-06-04 13:41:34 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2010-06-04 13:41:34 +0000 |
commit | 01483432d459b7fe5637929328a701e0c3f4fdd8 (patch) | |
tree | 7476677bdf9c29a14675b079e5fb55c155785a73 /pjsip/src/pjsua-lib/pjsua_media.c | |
parent | 0c88735614f5caca1fb6899e59977b865cc72c28 (diff) |
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
Diffstat (limited to 'pjsip/src/pjsua-lib/pjsua_media.c')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_media.c | 23 |
1 files changed, 1 insertions, 22 deletions
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; i<rem_sdp->media_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 { |