I'am working on simple VoiceChat in C#. I am using Ozeki framework to make a call with user.
Everything works fine, but I have a problem when I want to make a call after call. After first call, I have to register my ip again using Ozeki method. But one of my port is still in use. So how can I clear port 5060 after call ?
This is method for register ip:
void Ozeki()
{
softphone = SoftPhoneFactory.CreateSoftPhone(6000, 6200);
microphone = Microphone.GetDefaultDevice();
speaker = Speaker.GetDefaultDevice();
mediaSender = new PhoneCallAudioSender();
mediaReceiver = new PhoneCallAudioReceiver();
connector = new MediaConnector();
var config = new DirectIPPhoneLineConfig(local_ip, 5060);
phoneLine = softphone.CreateDirectIPPhoneLine(config);
phoneLine.RegistrationStateChanged += line_RegStateChanged;
softphone.IncomingCall += softphone_IncomingCall;
softphone.RegisterPhoneLine(phoneLine);
}
So again, how can I 'clear' port 5060?