/// <summary> /// Initializes the base softphone engine. /// </summary> internal void InitSoftphone(bool useFixIP) { // if the softphone is already created, then close it if (softPhone != null) { // unregister the phone lines, because if the local IP address changed, the existing registrations will not work foreach (var line in PhoneLines) { if (line.LineState == PhoneLineState.RegistrationSucceeded || line.LineState == PhoneLineState.NoRegNeeded) { softPhone.UnregisterPhoneLine(line); } } softPhone.IncomingCall -= (SoftPhone_IncomingCall); softPhone.Close(); } // create new softphone if (LocalIP == null || !useFixIP) { softPhone = SoftPhoneFactory.CreateSoftPhone(MinPort, MaxPort, 5060); } else { softPhone = SoftPhoneFactory.CreateSoftPhone(LocalIP, MinPort, MaxPort, 5060); } softPhone.IncomingCall += (SoftPhone_IncomingCall); }
private void ZakonczNasluch() { softphone.Close(); softphone.UnregisterPhoneLine(phoneLine); phoneLine.Dispose(); watekDoRozmow.Abort(); watekDoRozmow = null; }
private void FrmSoftphone_FormClosing(object sender, FormClosingEventArgs e) { string file = CreatFile("cfgacc.ino"); WriteFile(file, infoAcc, 5); _softPhone.IncomingCall -= softPhone_inComingCall; _phoneLine.RegistrationStateChanged -= phoneLine_PhoneLineInformation; _softPhone.UnregisterPhoneLine(_phoneLine); _softPhone.Close(); }
public void Dispose() { Try(() => _call?.HangUp()); Try(() => _softphone?.UnregisterPhoneLine(_phoneLine)); Try(() => _phoneLine.Dispose()); Try(() => _mediaReceiver.Dispose()); Try(() => _mediaSender.Dispose()); Try(() => _connector.Dispose()); Try(() => _speaker.Dispose()); Try(() => _microphone.Dispose()); Try(() => _softphone.Close()); }
public void Dispose() { phoneLine?.Dispose(); softPhone?.Close(); }
private void frmNetTelefonv2_FormClosed(object sender, FormClosedEventArgs e) { softPhone.Close(); }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { softPhone.Close(); }