private void BtnCall_Click(object sender, RoutedEventArgs e) { switch (appState) { case 0: case 1: case 2: break; case 3: string callId = abook.GetRandomOnlineUser(); if (callId == null) { WriteLog(String.Format("Error : {0} : No available user in Abook. Client cannot make call.", DateTime.Now.ToString("g"))); } else { tc.call(callId); WriteLog(String.Format("Info : {0} : Calling user {1}", DateTime.Now.ToString("g"), callId)); } break; case 4: case 5: tc.hangUp(); break; case 6: break; default: break; } mainWindow.Focus(); }
//--------------------- Button_Click_Call ------------------// // Call to remote user private void Button_Click_Call(object sender, RoutedEventArgs e) { if (!inConference) { //call the user string sUser = INI.ReadINI("connection", "call_to"); WriteLog(String.Format("Info : {0} : Call to {1}", DateTime.Now.ToString("g"), sUser)); labelInfo.Content = "Call ..."; // Try to call... tc.call(sUser); } else { // finish the call or leave the conference WriteLog(String.Format("hangUp : {0} ", DateTime.Now.ToString("g"))); labelInfo.Content = "hangUp ..."; // Try hangUp tc.hangUp(); } }
private void BtnCall_Click(object sender, RoutedEventArgs e) { if (isStarted && isLoggedIn) { //start and finish calls switch (btnCall.Content.ToString().ToLower()) { case "call": if (!isInCall && txtCallID.Text.Length > 0) { sdk.call(txtCallID.Text); btnCall.Content = "END CALL"; } break; case "end call": sdk.hangUp(); btnCall.Content = "CALL"; break; } } }