Beispiel #1
0
        /// <summary>
        /// Destroy call. Calculate call duration time, edit call log, destroy session.
        /// </summary>
        public override void Destroy()
        {
            // stop tones & timers
            StopAllTimers();

            MediaProxy.stopTone();

            // Calculate timing
            if (true == Counting)
            {
                Duration = DateTime.Now.Subtract(Time);
            }
            Counting = false;

            // update call log
            if (((Type != ECallType.EDialed) || (CallingNumber.Length > 0)) && (Type != ECallType.EUndefined))
            {
                CallLoger.addCall(Type, CallingNumber, CallingName, Time, Duration);
                CallLoger.save();
            }
            // reset data
            CallingNumber = "";
            Incoming      = false;
            ChangeState(EStateId.IDLE);
            if (null != _manager)
            {
                _manager.DestroySession(Session);
            }
        }
Beispiel #2
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();
            }
        }
Beispiel #3
0
 internal override void OnEntry()
 {
     if (_smref.Config.AudioPlayOutgoing)
     {
         Task.Factory.StartNew(() => MediaProxy.playTone(ETones.EToneRingback), TaskCreationOptions.PreferFairness);
     }
 }
Beispiel #4
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);
            }
        }
Beispiel #5
0
        /// <summary>
        /// Enter release state. If release timer not implemented release call imediately
        /// </summary>
        internal override void OnEntry()
        {
            MediaProxy.playTone(ETones.EToneCongestion);
            bool success = _smref.StartTimer(ETimerType.ERELEASED);

            if (!success)
            {
                _smref.Destroy();
            }
        }
Beispiel #6
0
        /// <summary>
        /// Enter release state. If release timer not implemented release call imediately
        /// </summary>
        public override void onEntry()
        {
            MediaProxy.playTone(ETones.EToneCongestion);
            bool success = _smref.startTimer(ETimerType.ERELEASED);

            if (!success)
            {
                _smref.destroy();
            }
        }
Beispiel #7
0
        internal override void OnEntry()
        {
            _smref.Counting = true;

            foreach (var callItem in CCallManager.Instance[EStateId.INCOMING])
            {
                var call = callItem;

                if (call != null)
                {
                    Task.Factory.StartNew(() => call.MediaProxy.stopTone(), TaskCreationOptions.PreferFairness);
                }
            }

            Task.Factory.StartNew(() => MediaProxy.stopTone(), TaskCreationOptions.PreferFairness);
        }
Beispiel #8
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();
            }
        }
Beispiel #9
0
        public void Apply()
        {
            _convertOperation.Trim          = _trim;
            _convertOperation.LoudnessCheck = _loudnessCheck;
            _convertOperation.AudioVolume   = _audioVolume;
            _convertOperation.StartTC       = _startTC;
            _convertOperation.Duration      = _duration;
            _convertOperation.SourceFieldOrderEnforceConversion = _sourceFieldOrderEnforceConversion;
            _convertOperation.AudioChannelMappingConversion     = _audioChannelMappingConversion;
            _convertOperation.AspectConversion = _aspectConversion;
            _convertOperation.SourceFieldOrderEnforceConversion = _sourceFieldOrderEnforceConversion;

            IMediaProperties newMediaProperties;

            if (_convertOperation.DestMediaProperties is IPersistentMediaProperties)
            {
                newMediaProperties = PersistentMediaProxy.FromMedia(_convertOperation.DestMediaProperties as IPersistentMediaProperties);
            }
            else
            {
                newMediaProperties = MediaProxy.FromMedia(_convertOperation.DestMediaProperties);
            }

            newMediaProperties.MediaName = _destMediaName;
            if (newMediaProperties is IPersistentMediaProperties)
            {
                ((IPersistentMediaProperties)newMediaProperties).IdAux         = _idAux;
                ((IPersistentMediaProperties)newMediaProperties).MediaEmphasis = _destMediaEmphasis;
            }
            newMediaProperties.VideoFormat        = _destMediaVideoFormat;
            newMediaProperties.FileName           = _destFileName;
            newMediaProperties.TcStart            = _startTC;
            newMediaProperties.TcPlay             = _startTC;
            newMediaProperties.Duration           = _duration;
            newMediaProperties.DurationPlay       = _duration;
            newMediaProperties.MediaCategory      = _destCategory;
            newMediaProperties.Parental           = _destParental;
            _convertOperation.DestMediaProperties = newMediaProperties;  //required to pass this parameter from client to server application
        }
Beispiel #10
0
        /// <summary>
        /// Destroy call. Calculate call duration time, edit call log, destroy session.
        /// </summary>
        public override void Destroy()
        {
            // stop tones & timers
            StopAllTimers();

            Task.Factory.StartNew(() => MediaProxy.stopTone(), TaskCreationOptions.PreferFairness);

            // Calculate timing
            if (true == Counting)
            {
                Duration = DateTime.Now.Subtract(Time);
            }
            Counting = false;
            // reset data
            CallingNumber = "";
            Incoming      = false;
            ChangeState(EStateId.IDLE);
            if (null != _manager)
            {
                _manager.DestroySession(Session);
            }
        }
Beispiel #11
0
 public override void onExit()
 {
     MediaProxy.stopTone();
 }
Beispiel #12
0
 internal override void OnEntry()
 {
     _smref.Counting = true;
     MediaProxy.stopTone();
 }
Beispiel #13
0
 internal override void OnExit()
 {
     Task.Factory.StartNew(() => MediaProxy.stopTone(), TaskCreationOptions.PreferFairness);
     _smref.StopAllTimers();
 }
Beispiel #14
0
 internal override void OnExit()
 {
     MediaProxy.stopTone();
     _smref.StopAllTimers();
 }
Beispiel #15
0
 public override void onEntry()
 {
     MediaProxy.playTone(ETones.EToneRingback);
 }
Beispiel #16
0
 public override void onEntry()
 {
     MediaProxy.playTone(ETones.EToneCongestion);
     _smref.startTimer(ETimerType.ERELEASED);
 }
Beispiel #17
0
 public override void onExit()
 {
     MediaProxy.stopTone();
     _smref.stopAllTimers();
 }
Beispiel #18
0
 internal override void OnEntry()
 {
     MediaProxy.playTone(ETones.EToneRingback);
 }
Beispiel #19
0
 internal override void OnExit()
 {
     MediaProxy.stopTone();
 }
Beispiel #20
0
 public override void onEntry()
 {
     _smref.Counting = true;
     MediaProxy.stopTone();
 }