summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2010-06-23 12:38:28 +0000
committerBenny Prijono <bennylp@teluu.com>2010-06-23 12:38:28 +0000
commitc05e6f6d3a1ac90dd2930184aa895bc57d840536 (patch)
treeccab35fd4fe7354e4908647f5adff2a49f36012c
parentfc7d78d6dc115e3f70eb40c3d5cdaba5cce64de9 (diff)
Fixed #1079 (Media transport should be kept alive during double-hold scenario). Details:
- now the stream will be destroyed but the media transport will be kept alive during doublehold scenario - small fix in SRTP to also negotiate crypto even when the media is marked as inactive, otherwise it's possible that an "optional" endpoint would create RTP/AVP offer and send it to "mandatory" endpoint, which would be rejected and cause the media port to be set to zero git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3219 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjmedia/src/pjmedia/transport_srtp.c7
-rw-r--r--pjsip/src/pjsua-lib/pjsua_call.c7
-rw-r--r--pjsip/src/pjsua-lib/pjsua_media.c6
3 files changed, 19 insertions, 1 deletions
diff --git a/pjmedia/src/pjmedia/transport_srtp.c b/pjmedia/src/pjmedia/transport_srtp.c
index 20005c39..d8f41a95 100644
--- a/pjmedia/src/pjmedia/transport_srtp.c
+++ b/pjmedia/src/pjmedia/transport_srtp.c
@@ -1165,9 +1165,16 @@ static pj_status_t transport_encode_sdp(pjmedia_transport *tp,
goto BYPASS_SRTP;
/* If the media is inactive, do nothing. */
+ /* No, we still need to process SRTP offer/answer even if the media is
+ * marked as inactive, because the transport is still alive in this
+ * case (e.g. for keep-alive). See:
+ * http://trac.pjsip.org/repos/ticket/1079
+ */
+ /*
if (pjmedia_sdp_media_find_attr(m_loc, &ID_INACTIVE, NULL) ||
(m_rem && pjmedia_sdp_media_find_attr(m_rem, &ID_INACTIVE, NULL)))
goto BYPASS_SRTP;
+ */
/* Check remote media transport & set local media transport
* based on SRTP usage option.
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c
index f3ca5cba..8cd8ce56 100644
--- a/pjsip/src/pjsua-lib/pjsua_call.c
+++ b/pjsip/src/pjsua-lib/pjsua_call.c
@@ -2184,7 +2184,12 @@ static void dump_media_session(const char *indent,
rem_addr = rem_addr_buf;
}
- if (info.stream_info[i].dir == PJMEDIA_DIR_ENCODING)
+ if (call->media_dir == PJMEDIA_DIR_NONE) {
+ /* To handle when the stream that is currently being paused
+ * (http://trac.pjsip.org/repos/ticket/1079)
+ */
+ dir = "inactive";
+ } else if (info.stream_info[i].dir == PJMEDIA_DIR_ENCODING)
dir = "sendonly";
else if (info.stream_info[i].dir == PJMEDIA_DIR_DECODING)
dir = "recvonly";
diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c
index fd8163a0..2eb08944 100644
--- a/pjsip/src/pjsua-lib/pjsua_media.c
+++ b/pjsip/src/pjsua-lib/pjsua_media.c
@@ -1557,6 +1557,11 @@ pj_status_t pjsua_media_channel_update(pjsua_call_id call_id,
/* Call media direction */
call->media_dir = PJMEDIA_DIR_NONE;
+ /* Don't stop transport because we need to transmit keep-alives, and
+ * also to prevent restarting ICE negotiation. See
+ * http://trac.pjsip.org/repos/ticket/1094
+ */
+#if 0
/* Shutdown transport's session */
pjmedia_transport_media_stop(call->med_tp);
call->med_tp_st = PJSUA_MED_TP_IDLE;
@@ -1568,6 +1573,7 @@ pj_status_t pjsua_media_channel_update(pjsua_call_id call_id,
pjmedia_transport_close(call->med_tp);
call->med_tp = call->med_orig;
}
+#endif
} else {
pjmedia_transport_info tp_info;