summaryrefslogtreecommitdiff
path: root/pjmedia
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2009-10-06 11:29:14 +0000
committerNanang Izzuddin <nanang@teluu.com>2009-10-06 11:29:14 +0000
commit31a9ba0b9488e15f685eb9c343fc1f628e40cc6e (patch)
tree8fcff1b51b36ebbe0976452765245d9bff10c121 /pjmedia
parentc8d381ec5640a00e3d950c297b4987ade8772214 (diff)
Ticket #964:
- Fixed creating media answer in SDP negotation to just clone the offer (and update media direction) when media offer specifies port 0 (media inactive). - Added pjsua python test. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2926 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r--pjmedia/src/pjmedia/sdp_neg.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/pjmedia/src/pjmedia/sdp_neg.c b/pjmedia/src/pjmedia/sdp_neg.c
index 9c4e9cfa..6ce097e3 100644
--- a/pjmedia/src/pjmedia/sdp_neg.c
+++ b/pjmedia/src/pjmedia/sdp_neg.c
@@ -1006,6 +1006,15 @@ static pj_status_t match_offer(pj_pool_t *pool,
const pjmedia_sdp_media *master, *slave;
pj_str_t pt_amr_need_adapt = {NULL, 0};
+ /* If offer has zero port, just clone the offer and update direction */
+ if (offer->desc.port == 0) {
+ answer = pjmedia_sdp_media_clone(pool, offer);
+ remove_all_media_directions(answer);
+ update_media_direction(pool, offer, answer);
+ *p_answer = answer;
+ return PJ_SUCCESS;
+ }
+
/* Set master/slave negotiator based on prefer_remote_codec_order. */
if (prefer_remote_codec_order) {
master = offer;
@@ -1218,10 +1227,6 @@ static pj_status_t match_offer(pj_pool_t *pool,
}
answer->desc.fmt_count = pt_answer_count;
- /* If offer has zero port, set our answer with zero port too */
- if (offer->desc.port == 0)
- answer->desc.port = 0;
-
/* Update media direction. */
update_media_direction(pool, offer, answer);