public static CallAudioStreamServer getServer(Skype skype)
 {
     if (serverSingleton == null)
     {
         serverSingleton = new CallAudioStreamServer(skype);
     }
     return(serverSingleton);
 }
        public bool waitForResponse(int timeOutInSeconds)
        {
            Semaphore responseSemaphore = new Semaphore(0, 1);
            Thread    waitingThread     = new Thread(new ParameterizedThreadStart(waitingForAnswerThreadProc));

            waitingThread.IsBackground = true;
            waitingThread.Start(responseSemaphore);
            logger.Info("Waiting for answer... (ID = " + call.Id + ")");
            if (!responseSemaphore.WaitOne(timeOutInSeconds * 1000) || call.Status != TCallStatus.clsInProgress)
            {
                try {
                    call.Finish();
                }
                catch (Exception) {}
                logger.Info("\tRefused (ID = " + call.Id + ")");
                return(false);
            }
            skype.CallStatus += callStatusChangedEvent;
            logger.Info("\tAnswered (ID = " + call.Id + ")");
            call.OutputDevice[TCallIoDeviceType.callIoDeviceTypePort] = CallAudioStreamServer.getServer(skype).ListeningPort.ToString();
            return(true);
        }
 public static CallAudioStreamServer getServer(Skype skype)
 {
     if (serverSingleton == null)
         serverSingleton = new CallAudioStreamServer(skype);
     return serverSingleton;
 }