Skip to content

Commit

Permalink
fix msi for 2 friends calling each other at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Aug 24, 2020
1 parent 050bd77 commit a490217
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions toxav/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,14 +826,21 @@ static void handle_init(MSICall *call, const MSIMessage *msg)
/* Call starting */
LOGGER_API_INFO(call->session->tox,"MSI_CALL_REQUESTING:Friend sent an invite, but we are waiting for an call answer to our call");

/* if 2 friends call each other at the same time, ignore for now */
#if 0
/* if 2 friends call each other at the same time */
#if 1
call->peer_capabilities = msg->capabilities.value;
call->state = MSI_CALL_ACTIVE;

if (invoke_callback(call, MSI_ON_START) == -1) {
goto FAILURE;
}

// send the correct answer to the other friend
MSIMessage out_msg;
msg_init(&out_msg, REQU_PUSH);
out_msg.capabilities.exists = true;
out_msg.capabilities.value = call->self_capabilities;
send_message(call->session->tox, call->friend_number, &out_msg);
#endif
}
break;
Expand Down

0 comments on commit a490217

Please sign in to comment.