Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/source/PeerConnection/PeerConnection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,7 @@ STATUS setRemoteDescription(PRtcPeerConnection pPeerConnection, PRtcSessionDescr
ENTERS();
STATUS retStatus = STATUS_SUCCESS;
PCHAR remoteIceUfrag = NULL, remoteIcePwd = NULL;
BOOL controlling = FALSE;
UINT32 i, j;
PSessionDescription pSessionDescription;

Expand All @@ -1315,6 +1316,7 @@ STATUS setRemoteDescription(PRtcPeerConnection pPeerConnection, PRtcSessionDescr
NULLABLE_SET_VALUE(pKvsPeerConnection->canTrickleIce, FALSE);

CHK_STATUS(deserializeSessionDescription(pSessionDescription, pSessionDescriptionInit->sdp));
controlling = pKvsPeerConnection->isOffer;

for (i = 0; i < pSessionDescription->sessionAttributesCount; i++) {
if (STRCMP(pSessionDescription->sdpAttributes[i].attributeName, "fingerprint") == 0) {
Expand All @@ -1328,6 +1330,9 @@ STATUS setRemoteDescription(PRtcPeerConnection pPeerConnection, PRtcSessionDescr
} else if (STRCMP(pSessionDescription->sdpAttributes[i].attributeName, "ice-options") == 0 &&
STRSTR(pSessionDescription->sdpAttributes[i].attributeValue, "trickle") != NULL) {
NULLABLE_SET_VALUE(pKvsPeerConnection->canTrickleIce, TRUE);
} else if (STRCMP(pSessionDescription->sdpAttributes[i].attributeName, "ice-lite") == 0) {
// if remote description says "ice-lite" we are always the ice controlling side
controlling = TRUE;
}
}

Expand Down Expand Up @@ -1383,8 +1388,7 @@ STATUS setRemoteDescription(PRtcPeerConnection pPeerConnection, PRtcSessionDescr
STRNCPY(pKvsPeerConnection->remoteIcePwd, remoteIcePwd, MAX_ICE_PWD_LEN);

// This starts the state machine timer callback that transitions states periodically
CHK_STATUS(iceAgentStartAgent(pKvsPeerConnection->pIceAgent, pKvsPeerConnection->remoteIceUfrag, pKvsPeerConnection->remoteIcePwd,
pKvsPeerConnection->isOffer));
CHK_STATUS(iceAgentStartAgent(pKvsPeerConnection->pIceAgent, pKvsPeerConnection->remoteIceUfrag, pKvsPeerConnection->remoteIcePwd, controlling));

if (!pKvsPeerConnection->isOffer) {
CHK_STATUS(setPayloadTypesFromOffer(pKvsPeerConnection->pCodecTable, pKvsPeerConnection->pRtxTable, pSessionDescription));
Expand Down