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
This commit is contained in:
paulc 2009-04-29 22:07:44 +00:00
parent 7e9dcba940
commit ff612b95d4
1 changed files with 9 additions and 1 deletions

View File

@ -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));