From ff612b95d4a2bfd222fe928a0fb7393d0f529b55 Mon Sep 17 00:00:00 2001 From: paulc Date: Wed, 29 Apr 2009 22:07:44 +0000 Subject: [PATCH] If an early RTP start is requested but media list is unknown build a best guess. Patch by Peter Olsson - support for 3Com NBX PBX. git-svn-id: http://yate.null.ro/svn/yate/trunk@2604 acf43c95-373e-0410-b603-e72c3f656dc1 --- modules/ysipchan.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/ysipchan.cpp b/modules/ysipchan.cpp index 2d0d62a2..29a0fe44 100644 --- a/modules/ysipchan.cpp +++ b/modules/ysipchan.cpp @@ -3964,8 +3964,16 @@ bool YateSIPConnection::msgAnswered(Message& msg) MimeSdpBody* sdp = createPasstroughSDP(msg); if (!sdp) { m_rtpForward = false; + bool startNow = msg.getBoolValue("rtp_start",s_start_rtp); + if (startNow && !m_rtpMedia) { + // early RTP start but media list yet unknown - build best guess + ObjList* lst = new ObjList; + lst->append(new NetMedia("audio","RTP/AVP",msg.getValue("formats",s_audio))); + setMedia(lst); + m_rtpAddr = m_host; + } // normally don't start RTP yet, only when we get the ACK - sdp = createRtpSDP(msg.getBoolValue("rtp_start",s_start_rtp)); + sdp = createRtpSDP(startNow); } m->setBody(buildSIPBody(msg,sdp));