Module: sems Branch: master Commit: 7c01d2884fc9f073c46304151857b4c5b16da668 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=7c01d2884fc9f073c46304151857b4c5b16da668
Author: Raphael Coeffic <[email protected]> Committer: Raphael Coeffic <[email protected]> Date: Tue Dec 13 11:07:05 2011 +0100 b/f: reactivate 'a=direction:...' support. --- core/AmSdp.cpp | 7 ++----- core/AmSdp.h | 4 ---- core/AmSession.cpp | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/core/AmSdp.cpp b/core/AmSdp.cpp index 51bfcd9..8182ad1 100644 --- a/core/AmSdp.cpp +++ b/core/AmSdp.cpp @@ -112,8 +112,7 @@ string SdpAttribute::print() const { // class AmSdp: Methods // AmSdp::AmSdp() - : version(0), - remote_active(false) + : version(0) { l_origin.user = "sems"; l_origin.sessId = get_random(); @@ -126,8 +125,7 @@ AmSdp::AmSdp(const AmSdp& p_sdp_msg) l_origin(p_sdp_msg.l_origin), sessionName(p_sdp_msg.sessionName), conn(p_sdp_msg.conn), - media(p_sdp_msg.media), - remote_active(false) + media(p_sdp_msg.media) { } @@ -275,7 +273,6 @@ void AmSdp::clear() conn = SdpConnection(); attributes.clear(); media.clear(); - remote_active = false; l_origin = SdpOrigin(); } diff --git a/core/AmSdp.h b/core/AmSdp.h index 6d6f01d..486ac3b 100644 --- a/core/AmSdp.h +++ b/core/AmSdp.h @@ -171,10 +171,6 @@ public: std::vector<SdpMedia> media; // m= ... [a=rtpmap:...]+ //TODO: t= lines - // Is remote host requesting - // us to do passive RTP ? - bool remote_active; - SdpOrigin l_origin; // local origin (o= ) AmSdp(); diff --git a/core/AmSession.cpp b/core/AmSession.cpp index 0ac1ff1..371d114 100644 --- a/core/AmSession.cpp +++ b/core/AmSession.cpp @@ -1007,7 +1007,20 @@ bool AmSession::getSdpAnswer(const AmSdp& offer, AmSdp& answer) answer_media.port = RTPStream()->getLocalPort(); answer_media.nports = 0; answer_media.transport = TP_RTPAVP; - answer_media.dir = SdpMedia::DirBoth; + + switch(m_it->dir){ + case SdpMedia::DirBoth: + answer_media.dir = SdpMedia::DirBoth; + break; + case SdpMedia::DirActive: + answer_media.dir = SdpMedia::DirPassive; + break; + case SdpMedia::DirPassive: + answer_media.dir = SdpMedia::DirActive; + break; + } + + RTPStream()->setPassiveMode(answer_media.dir == SdpMedia::DirPassive); // Calculate the intersection with the offered set of payloads _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
