summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2011-10-26 16:57:05 +0000
committerNanang Izzuddin <nanang@teluu.com>2011-10-26 16:57:05 +0000
commitd7df88f805eb70e1b89fd781770ffb32c581062f (patch)
tree240ff55fa39f41abd208fcb88ca3c3abb368b6c1 /pjsip
parent6187fb31a1f1e9b1f07f1b9b8022c97f3c02b25e (diff)
Close #1403: Fixed pjsua-lib in generating re-offer when the current session contains (disabled) unknown media types.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3865 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_media.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c
index 6f9ae173..8fe57a11 100644
--- a/pjsip/src/pjsua-lib/pjsua_media.c
+++ b/pjsip/src/pjsua-lib/pjsua_media.c
@@ -1942,15 +1942,21 @@ pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id,
m->desc.fmt[0] = pj_str("31");
break;
default:
- if (rem_sdp) {
- pj_strdup(pool, &m->desc.media,
- &rem_sdp->media[mi]->desc.media);
- pj_strdup(pool, &m->desc.fmt[0],
- &rem_sdp->media[mi]->desc.fmt[0]);
- } else {
- pj_assert(!"Invalid call_med media type");
- return PJ_EBUG;
+ /* This must be us generating re-offer, and some unknown
+ * media may exist, so just clone from active local SDP
+ * (and it should have been deactivated already).
+ */
+ pj_assert(call->inv && call->inv->neg &&
+ sdp_neg_state == PJMEDIA_SDP_NEG_STATE_DONE);
+ {
+ 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;
}
}