Skip to content

Instantly share code, notes, and snippets.

@primableatom
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save primableatom/88f4f1553612d013d43f to your computer and use it in GitHub Desktop.
Save primableatom/88f4f1553612d013d43f to your computer and use it in GitHub Desktop.
//As you can see in the video, the issue happens because this.answer returns from an if condition in here:
// callManager.js
this.answer = function(callid, onSuccess, onFailure, isVideoEnabled, videoQuality){
var internalCall = calls[callid],
videoNegotationAvailable = this.isVideoNegotationAvailable(callid);
if(internalCall) {
// check if term side tries to answer an audio only call with video
if (videoNegotationAvailable === false && isVideoEnabled === true) {
logger.error("[callManager.answer] Video Session Not Available Error ");
onFailure(fcs.Errors.VIDEO_SESSION_NOT_AVAILABLE);
return;
}
.......
}
// Here the culprit is the call to this.isVideoNegotationAvailable(callid) which returns false
// callManager.js
this.isVideoNegotationAvailable = function(callid) {
var internalCall = calls[callid];
return rtc.isVideoNegotationAvailable(internalCall.sdp);
};
This calls the isVideoNegotationAvailable in webtrc.js:
// webrtc.js
this.isVideoNegotationAvailable = function(sdp) {
if (sdp === null || sdp === undefined){
return false;
}
return isSdpHas(sdp, video);
};
The call to isSdpHas(sdp, video) returns false
Here is the definition of isSdpHas:
// webrtc.js
this.isSdpHas = function(pSdp, type) {
var msg = "isSdpHas for type " + type + ": ", result = false;
if (pSdp.indexOf(CONSTANTS.SDP.M_LINE + type) !== -1) {
result = true;
logger.info(msg + result);
return result;
}
logger.info(msg + result);
return result;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment