Exemplo n.º 1
0
 public override bool retrieveCall()
 {
     _smref.RetrieveRequested = true;
     CallProxy.retrieveCall();
     _smref.ChangeState(EStateId.ACTIVE);
     return(true);
 }
Exemplo n.º 2
0
 public override bool retrieveCall(int sessionId)
 {
     _smref.RetrieveRequested = true;
     CallProxy.retrieveCall(sessionId);
     _smref.changeState(EStateId.ACTIVE);
     return(true);
 }
Exemplo n.º 3
0
 public async Task <WrappedResponse <ProjectDefinition> > InsertAsync([FromBody] ProjectDefinition projectDefinition)
 {
     using (CallProxy)
     {
         return(await CallProxy.CallAsync(async() => await projectDefinitionWriter.InsertAsync(projectDefinition)));
     }
 }
Exemplo n.º 4
0
 public async Task <WrappedResponse <bool> > RunByIdAsync([FromQuery] Guid projectId)
 {
     using (CallProxy)
     {
         return(await CallProxy.CallAsync(async() => await runner.RunAsync(projectId)));
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// Handle incoming call requests. Check for supplementary services flags.
        /// </summary>
        /// <param name="callingNo"></param>
        /// <param name="display"></param>
        public override void incomingCall(string callingNo, string display, IEnumerable <KeyValuePair <string, string> > headers)
        {
            // check supplementary services flags
            if ((_smref.Config.CFUFlag == true) && (_smref.Config.CFUNumber.Length > 0))
            {
                // do NOT notify about state changes
                _smref.DisableStateNotifications = true;
                CallProxy.serviceRequest((int)EServiceCodes.SC_CFU, _smref.Config.CFUNumber);
                this.endCall();
                return;
            }
            else if (_smref.Config.DNDFlag == true)
            {
                // do NOT notify about state changes
                _smref.DisableStateNotifications = true;
                CallProxy.serviceRequest((int)EServiceCodes.SC_DND, "");
                this.endCall();
                return;
            }

            _smref.CallingNumber = callingNo;
            _smref.CallingName   = display;
            _smref.Headers       = headers;
            _smref.ChangeState(EStateId.INCOMING);
        }
Exemplo n.º 6
0
        public override void onEntry()
        {
            _smref.Incoming = true;

            int sessionId = _smref.Session;

            if ((_smref.Config.CFUFlag == true) && (_smref.Config.CFUNumber.Length > 0))
            {
                CallProxy.serviceRequest(sessionId, (int)EServiceCodes.SC_CFU, _smref.Config.CFUNumber);
            }
            else if (_smref.Config.DNDFlag == true)
            {
                CallProxy.serviceRequest(sessionId, (int)EServiceCodes.SC_DND, "");
            }
            else if (_smref.Config.AAFlag == true)
            {
                this.acceptCall(sessionId);
            }
            else
            {
                CallProxy.alerted(sessionId);
                _smref.Type = ECallType.EMissed;
                MediaProxy.playTone(ETones.EToneRing);
            }

            // if CFNR active start timer
            if (_smref.Config.CFNRFlag)
            {
                _smref.startTimer(ETimerType.ENOREPLY);
            }
        }
Exemplo n.º 7
0
        public override bool connectCallMedia(int targetCallId)
        {
            retrieveCall();

            _smref.IsConference = CallProxy.connectCallMedia(targetCallId);
            return(_smref.IsConference);
        }
Exemplo n.º 8
0
        internal override void OnEntry()
        {
            // set incoming call flags
            _smref.Incoming = true;

            int sessionId = SessionId;

            // Start no response timer
            _smref.StartTimer(ETimerType.ENORESPONSE);

            CallProxy.alerted();
            _smref.Type = ECallType.EMissed;
            MediaProxy.playTone(ETones.EToneRing);

            // if CFNR active start timer
            if (_smref.Config.CFNRFlag)
            {
                _smref.StartTimer(ETimerType.ENOREPLY);
            }
            // auto answer call (if single call)
            if ((_smref.Config.AAFlag == true) && (_smref.NumberOfCalls == 1))
            {
                this.acceptCall();
            }
        }
Exemplo n.º 9
0
 public async Task <WrappedResponse <ImmutableList <ProjectDefinition> > > GetAllAsync()
 {
     using (CallProxy)
     {
         return(await CallProxy.CallAsync(async() => await projectDefinitionsReader.GetAllProjectDefinitionsAsync()));
     }
 }
Exemplo n.º 10
0
 public override bool endCall()
 {
     // try once more (might not be needed)!
     CallProxy.endCall();
     // destroy it!
     _smref.Destroy();
     return(true);
 }
Exemplo n.º 11
0
        public override bool endCall(int sesionnId)
        {
            _smref.Duration = System.DateTime.Now.Subtract(_smref.Time);

            CallProxy.endCall(sesionnId);
            _smref.destroy();
            return(base.endCall(sesionnId));
        }
Exemplo n.º 12
0
 /// <summary>
 /// Make call to a given number and accountId. Assign sessionId to call state machine got from VoIP part.
 /// </summary>
 /// <param name="dialedNo"></param>
 /// <param name="accountId"></param>
 /// <returns></returns>
 public override int makeCall(string dialedNo, Sipek.Sip.SipHeader[] headers)
 {
     _smref.CallingNumber = dialedNo;
     // make call and save sessionId
     _smref.ChangeState(EStateId.CONNECTING);
     _smref.Session = CallProxy.makeCall(dialedNo, headers);
     return(_smref.Session);
 }
Exemplo n.º 13
0
        public override bool endCall()
        {
            _smref.Duration = System.DateTime.Now.Subtract(_smref.Time);

            _smref.changeState(EStateId.TERMINATED);
            CallProxy.endCall();
            return(base.endCall());
        }
Exemplo n.º 14
0
 /// <summary>
 /// Make call to a given number and accountId. Assign sessionId to call state machine got from VoIP part.
 /// </summary>
 /// <param name="dialedNo"></param>
 /// <param name="accountId"></param>
 /// <returns></returns>
 public override int makeCall(string dialedNo, int accountId)
 {
     _smref.CallingNumber = dialedNo;
     // make call and save sessionId
     _smref.ChangeState(EStateId.CONNECTING);
     _smref.Session = CallProxy.makeCall(dialedNo, accountId);
     return(_smref.Session);
 }
Exemplo n.º 15
0
        public override bool acceptCall()
        {
            _smref.Type = ECallType.EReceived;
            _smref.Time = System.DateTime.Now;

            CallProxy.acceptCall();
            _smref.ChangeState(EStateId.ACTIVE);
            return(true);
        }
Exemplo n.º 16
0
        internal override void OnEntry()
        {
            // set incoming call flags
            _smref.Incoming = true;

            int sessionId = SessionId;

            // drop call if pause flag
            if (_smref.Config.PauseFlag)
            {
                this.endCall();

                return;
            }

            // Start no response timer
            _smref.StartTimer(ETimerType.ENORESPONSE);

            CallProxy.alerted();
            _smref.Type = ECallType.EMissed;

            // Don't play any sounds while active calls persist
            if (_smref.Config.AudioPlayOnIncoming && (this._smref.NumberOfCalls == 1 || _smref.Config.AudioPlayOnIncomingAndActive))
            {
                Task.Factory.StartNew(() => MediaProxy.playTone(ETones.EToneRing), TaskCreationOptions.PreferFairness);
            }

            // if CFNR active start timer
            if (_smref.Config.CFNRFlag)
            {
                _smref.StartTimer(ETimerType.ENOREPLY);
            }

            // auto answer call (if single call)
            if ((_smref.Config.AAFlag == true) && (_smref.NumberOfCalls == 1))
            {
                this.acceptCall();
            }
        }
Exemplo n.º 17
0
 public override void onAlerting()
 {
     CallProxy.endCall();
 }
Exemplo n.º 18
0
 public override bool conferenceCall()
 {
     return(CallProxy.conferenceCall());
 }
Exemplo n.º 19
0
 public override bool xferCallSession(int partnersession)
 {
     return(CallProxy.xferCallSession(partnersession));
 }
Exemplo n.º 20
0
 public override bool xferCall(string number)
 {
     return(CallProxy.xferCall(number));
 }
Exemplo n.º 21
0
 public override bool holdCall()
 {
     _smref.HoldRequested = true;
     return(CallProxy.holdCall());
 }
Exemplo n.º 22
0
 public override void onConnect()
 {
     CallProxy.endCall();
 }
Exemplo n.º 23
0
 /// <summary>
 /// Response timer expired. Releasing the call...
 /// </summary>
 /// <param name="sessionId"></param>
 /// <returns></returns>
 public override bool noResponseTimerExpired(int sessionId)
 {
     _smref.ChangeState(EStateId.TERMINATED);
     CallProxy.endCall();
     return(true);
 }
Exemplo n.º 24
0
 public override bool endCall()
 {
     _smref.Destroy();
     CallProxy.endCall();
     return(base.endCall());
 }
Exemplo n.º 25
0
 public override bool sendCallMessage(string message)
 {
     return(CallProxy.sendCallMessage(message));
 }
Exemplo n.º 26
0
 public override bool serviceRequest(int code, string dest)
 {
     CallProxy.serviceRequest(code, dest);
     return(true);
 }
Exemplo n.º 27
0
 public override bool dialDtmf(string digits, EDtmfMode mode)
 {
     CallProxy.dialDtmf(digits, mode);
     return(true);
 }
Exemplo n.º 28
0
 public override bool xferCall(string number)
 {
     // In fact this is not Tranfser. It's Deflect => redirect...
     return(CallProxy.serviceRequest((int)EServiceCodes.SC_CD, number));
 }
Exemplo n.º 29
0
 public override bool endCall()
 {
     _smref.ChangeState(EStateId.TERMINATED);
     CallProxy.endCall();
     return(base.endCall());
 }
Exemplo n.º 30
0
 /// <summary>
 /// No reply timer expired. Send service code to call proxy.
 /// </summary>
 /// <param name="sessionId"></param>
 /// <returns></returns>
 public override bool noReplyTimerExpired(int sessionId)
 {
     CallProxy.serviceRequest((int)EServiceCodes.SC_CFNR, _smref.Config.CFUNumber);
     return(true);
 }