Esempio n. 1
0
 public override bool retrieveCall()
 {
     _smref.RetrieveRequested = true;
     CallProxy.retrieveCall();
     _smref.ChangeState(EStateId.ACTIVE);
     return(true);
 }
Esempio n. 2
0
 public override bool retrieveCall(int sessionId)
 {
     _smref.RetrieveRequested = true;
     CallProxy.retrieveCall(sessionId);
     _smref.changeState(EStateId.ACTIVE);
     return(true);
 }
Esempio n. 3
0
 public async Task <WrappedResponse <ProjectDefinition> > InsertAsync([FromBody] ProjectDefinition projectDefinition)
 {
     using (CallProxy)
     {
         return(await CallProxy.CallAsync(async() => await projectDefinitionWriter.InsertAsync(projectDefinition)));
     }
 }
Esempio n. 4
0
 public async Task <WrappedResponse <bool> > RunByIdAsync([FromQuery] Guid projectId)
 {
     using (CallProxy)
     {
         return(await CallProxy.CallAsync(async() => await runner.RunAsync(projectId)));
     }
 }
Esempio 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);
        }
Esempio 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);
            }
        }
Esempio n. 7
0
        public override bool connectCallMedia(int targetCallId)
        {
            retrieveCall();

            _smref.IsConference = CallProxy.connectCallMedia(targetCallId);
            return(_smref.IsConference);
        }
Esempio 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();
            }
        }
Esempio n. 9
0
 public async Task <WrappedResponse <ImmutableList <ProjectDefinition> > > GetAllAsync()
 {
     using (CallProxy)
     {
         return(await CallProxy.CallAsync(async() => await projectDefinitionsReader.GetAllProjectDefinitionsAsync()));
     }
 }
Esempio n. 10
0
 public override bool endCall()
 {
     // try once more (might not be needed)!
     CallProxy.endCall();
     // destroy it!
     _smref.Destroy();
     return(true);
 }
Esempio 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));
        }
Esempio 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);
 }
Esempio n. 13
0
        public override bool endCall()
        {
            _smref.Duration = System.DateTime.Now.Subtract(_smref.Time);

            _smref.changeState(EStateId.TERMINATED);
            CallProxy.endCall();
            return(base.endCall());
        }
Esempio 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);
 }
Esempio n. 15
0
        public override bool acceptCall()
        {
            _smref.Type = ECallType.EReceived;
            _smref.Time = System.DateTime.Now;

            CallProxy.acceptCall();
            _smref.ChangeState(EStateId.ACTIVE);
            return(true);
        }
Esempio 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();
            }
        }
Esempio n. 17
0
 public override void onAlerting()
 {
     CallProxy.endCall();
 }
Esempio n. 18
0
 public override bool conferenceCall()
 {
     return(CallProxy.conferenceCall());
 }
Esempio n. 19
0
 public override bool xferCallSession(int partnersession)
 {
     return(CallProxy.xferCallSession(partnersession));
 }
Esempio n. 20
0
 public override bool xferCall(string number)
 {
     return(CallProxy.xferCall(number));
 }
Esempio n. 21
0
 public override bool holdCall()
 {
     _smref.HoldRequested = true;
     return(CallProxy.holdCall());
 }
Esempio n. 22
0
 public override void onConnect()
 {
     CallProxy.endCall();
 }
Esempio 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);
 }
Esempio n. 24
0
 public override bool endCall()
 {
     _smref.Destroy();
     CallProxy.endCall();
     return(base.endCall());
 }
Esempio n. 25
0
 public override bool sendCallMessage(string message)
 {
     return(CallProxy.sendCallMessage(message));
 }
Esempio n. 26
0
 public override bool serviceRequest(int code, string dest)
 {
     CallProxy.serviceRequest(code, dest);
     return(true);
 }
Esempio n. 27
0
 public override bool dialDtmf(string digits, EDtmfMode mode)
 {
     CallProxy.dialDtmf(digits, mode);
     return(true);
 }
Esempio 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));
 }
Esempio n. 29
0
 public override bool endCall()
 {
     _smref.ChangeState(EStateId.TERMINATED);
     CallProxy.endCall();
     return(base.endCall());
 }
Esempio 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);
 }