public void SomeTerminalAnswer(object sender, AnswerTerminalEventArgs eventargs)
 {
     if (sender is TerminalUnit)
     {
         if ((sender as TerminalUnit).LinkOnATSPort.whoCall != null)
         {
             if ((sender as TerminalUnit).LinkOnATSPort.PortStatus == PortStatusEnum.WAIT_FOR_ANSWER)
             {
                 (sender as TerminalUnit).LinkOnATSPort.BillingRecord = new BillingRecordUnit(eventargs.AnswerCallTime);
                 (sender as TerminalUnit).LinkOnATSPort.PortStatus    = PortStatusEnum.BUSY;
                 (sender as TerminalUnit).LinkOnATSPort.whoCall.LinkOnATSPort.PortStatus    = PortStatusEnum.BUSY;
                 (sender as TerminalUnit).LinkOnATSPort.BillingRecord.Terminal              = (sender as TerminalUnit).LinkOnATSPort.whoCall;
                 (sender as TerminalUnit).LinkOnATSPort.BillingRecord.toTerminal            = sender as TerminalUnit;
                 (sender as TerminalUnit).LinkOnATSPort.whoCall.LinkOnATSPort.BillingRecord = (sender as TerminalUnit).LinkOnATSPort.BillingRecord;
                 eventargs.ResultOperationMessage = "Начался разговор!";
             }
             else
             {
                 eventargs.ResultOperationMessage = "Никто не звонит!";
             }
         }
         else
         {
             eventargs.ResultOperationMessage = "Непонятно кто и как звонит!";
         }
     }
 }
Beispiel #2
0
 public void Answer(out string result, DateTime answer_call_time)
 {
     if ((LinkOnATSPort != null) && (OnAnswer != null))
     {
         if (LinkOnATSPort.PortStatus == PortStatusEnum.WAIT_FOR_ANSWER)
         {
             AnswerTerminalEventArgs eventargs = new AnswerTerminalEventArgs(answer_call_time);
             OnAnswer(this, eventargs);
             result = eventargs.ResultOperationMessage;
         }
         else
         {
             result = "Никто не звонит что бы отвечать!";
         }
     }
     else
     {
         result = "Терминал не зарегистрирован!";
     }
 }