bbb-voice now responds OK with local SDP

bbb-voice was responding the Freeswitch REINVITE with 200 OK containing remote SDP and with no media description.
This commit is contained in:
kreismann 2016-03-30 18:21:15 -03:00 committed by Felipe Cecagno
parent 8e952c224d
commit 17828c35f7
2 changed files with 8 additions and 3 deletions

View File

@ -98,7 +98,7 @@ public abstract class CallListenerAdapter implements ExtendedCallListener
{ {
//printLog("RE-INVITE/MODIFY"); //printLog("RE-INVITE/MODIFY");
String local_session; String local_session;
if (sdp!=null && sdp.length()>0) /*if (sdp!=null && sdp.length()>0)
{ {
SessionDescriptor remote_sdp = new SessionDescriptor(sdp); SessionDescriptor remote_sdp = new SessionDescriptor(sdp);
SessionDescriptor local_sdp = new SessionDescriptor(call.getLocalSessionDescriptor()); SessionDescriptor local_sdp = new SessionDescriptor(call.getLocalSessionDescriptor());
@ -108,7 +108,7 @@ public abstract class CallListenerAdapter implements ExtendedCallListener
new_sdp = SdpTools.sdpAttirbuteSelection(new_sdp,"rtpmap"); new_sdp = SdpTools.sdpAttirbuteSelection(new_sdp,"rtpmap");
local_session = new_sdp.toString(); local_session = new_sdp.toString();
} }
else local_session=call.getLocalSessionDescriptor(); else*/ local_session=call.getLocalSessionDescriptor();
// accept immediatly // accept immediatly
call.accept(local_session); call.accept(local_session);
} }
@ -218,4 +218,3 @@ public abstract class CallListenerAdapter implements ExtendedCallListener
} }
} }

View File

@ -31,6 +31,8 @@ import org.zoolu.sip.header.*;
import org.zoolu.sip.provider.*; import org.zoolu.sip.provider.*;
import org.zoolu.tools.LogLevel; import org.zoolu.tools.LogLevel;
import org.slf4j.Logger;
import org.red5.logging.Red5LoggerFactory;
/** Class InviteDialog can be used to manage invite dialogs. /** Class InviteDialog can be used to manage invite dialogs.
* An InviteDialog can be both client or server. * An InviteDialog can be both client or server.
@ -82,6 +84,8 @@ public class InviteDialog extends Dialog implements TransactionClientListener, I
protected static final int D_BYED=8; protected static final int D_BYED=8;
protected static final int D_CLOSE=9; protected static final int D_CLOSE=9;
private static Logger logger = Red5LoggerFactory.getLogger(InviteDialog.class, "sip");
/** Gets the dialog state */ /** Gets the dialog state */
protected String getStatus() protected String getStatus()
{ switch (status) { switch (status)
@ -381,6 +385,7 @@ public class InviteDialog extends Dialog implements TransactionClientListener, I
* This method should be called when the InviteDialog is in D_INVITED or D_ReINVITED state */ * This method should be called when the InviteDialog is in D_INVITED or D_ReINVITED state */
public void accept(String contact, String sdp) public void accept(String contact, String sdp)
{ printLog("inside accept(sdp)",LogLevel.MEDIUM); { printLog("inside accept(sdp)",LogLevel.MEDIUM);
logger.debug("Accepting REINVITE. Responding OK with this sdp: " + sdp);
respond(200,SipResponses.reasonOf(200),contact,sdp); respond(200,SipResponses.reasonOf(200),contact,sdp);
} }
@ -483,6 +488,7 @@ public class InviteDialog extends Dialog implements TransactionClientListener, I
*/ */
public void onReceivedMessage(SipProvider sip_provider, Message msg) public void onReceivedMessage(SipProvider sip_provider, Message msg)
{ printLog("inside onReceivedMessage(sip_provider,message)",LogLevel.MEDIUM); { printLog("inside onReceivedMessage(sip_provider,message)",LogLevel.MEDIUM);
logger.debug("Received this message: " + msg.toString());
if (msg.isRequest() && !(msg.isAck() || msg.isCancel()) && msg.getCSeqHeader().getSequenceNumber()<=getRemoteCSeq()) if (msg.isRequest() && !(msg.isAck() || msg.isCancel()) && msg.getCSeqHeader().getSequenceNumber()<=getRemoteCSeq())
{ printLog("Request message is too late (CSeq too small): Message discarded",LogLevel.HIGH); { printLog("Request message is too late (CSeq too small): Message discarded",LogLevel.HIGH);
return; return;