private void Sdk_OnInviteReceived(object sender, AxTrueConf_CallXLib._ITrueConfCallXEvents_OnInviteReceivedEvent e) { dynamic data = Json.Decode(e.eventDetails); //get information about incoming call from JSON data string message = ""; switch (data.type) { case 0: //type 0 - incoming peer-to-peer call message = "Do you want accept call from "; break; case 1: //type 1 - incoming invitation to conference message = "Do you want accept invite to conference from "; break; } DialogResult result = MessageBox.Show(message + data.peerId + "?", "Incoming call", MessageBoxButtons.YesNo); //ask user about incoming call or invitation if (result == DialogResult.Yes) //if user says "Yes" { sdk.accept(); //accept incoming call or invitation } else { sdk.reject(); //else reject incoming call or invitation } }
private void Sdk_OnInviteReceived(object sender, AxTrueConf_CallXLib._ITrueConfCallXEvents_OnInviteReceivedEvent e) { if (status != 4 && status != 5) //if app state is not in call or in conference { sdk.accept(); //accept incoming invitation lblCallStatus.Content = "Calling..."; //change the content of the call status label dynamic json = JsonConvert.DeserializeObject(e.eventDetails); //gconvert the received JSON object txtCallId.Text = json.peerId; //put received peerId to the call textbox } }