Hi there,
I am developing multi-party video conference.
For specific use-case, the call host can receive multiple call requests (up to 4). When call host accepts all requests, it sends back to each caller peer message indicating that it accepts the request. In its turn, the caller, joins the room and make calls to all room participants. Here is the code, I am using to make this:
// call to all room occupants
var calling;
if (angular.isDefined(calling)) {
return;
}
var i = 0;
calling = $interval(function () {
if (i < $scope.callers.length && $scope.callers[i].easyrtcId) {
if (easyrtc.getConnectStatus($scope.callers[i].easyrtcId) === easyrtc.NOT_CONNECTED) {
//easyrtc.enableDataChannels($scope.callers[i].easyrtcId);
easyrtc.call($scope.callers[i].easyrtcId,
function(easyrtcid) {
$log.debug("completed call to " + easyrtcid);
},
function(errorCode, errorText) {
$log.debug("err:" + errorText);
MessageService.error(errorText, locale.getString('room.CALLFAILURE'));
},
function(accepted, bywho) {
$log.debug((accepted?"accepted":"rejected")+ " by " + bywho);
}
);
}
++i;
} else {
$interval.cancel(calling);
calling = undefined;
}
}, 500);
making long story short - I am performing call request to each call participant, holding call request with 500 milliseconds each. However to all call requests succeeded.
The error I received is "setRemoteDescription failed Failed to set remote answer sdp: Called in wrong state: STATE_INPROGRESS" in easyrtc.js line 4401 in Console.
Any help would be appreciated!
Best Regards,
Angel