Ejemplo n.º 1
0
 private async Task SipApiClientOnOnLineHangupEvent(ISipApiClient sender, LineHangupEvent e)
 {
     if (e.LineId != transferChannel.Id.ToString() && e.LineId != outboundLineId)
     {
         return;
     }
     if (e.LineId != transferChannel.Id.ToString())
     {
         await _call.SipLineApi.HangupLineAsync(transferChannel.Id.ToString());
     }
     _call.CallState.CallCanBeAbandoned = true;
     GoToNextStep(_call, _step);
     await _call.FireStateChange(Trigger.NextCallFlowStep);
 }
Ejemplo n.º 2
0
 private async Task SipApiClientOnOnLineHangupEvent(ISipApiClient sender, LineHangupEvent e)
 {
     if (e.LineId != _call.CallState.GetOutgoingLineId())
     {
         return;
     }
     if (!_call.CallState.TalkTimeStart.HasValue)
     {
         _call.CallState.CallCanBeAbandoned = true;
         await _call.FireStateChange(Trigger.FinishCall);
     }
     else
     {
         // we're not on hold anymore, so we can just remove our events and continue
         _call.SipApiClient.OnPromptPlaybackFinishedAsyncEvent -= AriClient_OnPlaybackFinishedAsyncEvent;
         _call.OnWorkflowStep -= OnWorkflowStep;
         _call.SipApiClient.OnLineHangupAsyncEvent -= SipApiClientOnOnLineHangupEvent;
     }
 }