Beispiel #1
0
 public CallPropertyChange( Call call, String property, String changedFrom, String changedTo )
 {
     mCall = call;
     mProperty = property;
     mChangedFrom = changedFrom;
     mChangedTo = changedTo;
 }
Beispiel #2
0
 public CallPropertyChange( Call call, String property, long changedFrom, long changedTo )
 {
     mCall = call;
     mProperty = property;
     mChangedFrom = changedFrom.ToString();
     mChangedTo = changedTo.ToString();
 }
Beispiel #3
0
 public void Log( Device device, Line line, Call call, DateTime starttime, DateTime endtime )
 {
     lock (this) {
         string strFile = "";
         try {
             strFile = System.Configuration.ConfigurationManager.AppSettings["callLogFile"];
         } catch (System.Configuration.SettingsPropertyNotFoundException) {
             strFile = System.Environment.CurrentDirectory + "\\calls.log";
         }
         if (strFile == "") {
             strFile = System.Environment.CurrentDirectory + "\\calls.log";
         } else {
             strFile = System.Environment.CurrentDirectory + "\\" + strFile;
         }
         StreamWriter objLogFile = File.AppendText(strFile);
         string strLine = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss.ffffff");
         string phone = "unknown";
         if (call.Type == CallType.Inbound) {
             phone = line.LastCallerNumber;
         } else {
             phone = line.LastCalledNumber;
         }
         strLine += "," + device.Name + "," + call.Name + "," +  line.Name + "," + call.Type.ToString() +"," + phone + "," + starttime + "," + endtime + "," + call.Duration;
         objLogFile.WriteLine(strLine);
         objLogFile.Close();
     }
 }
Beispiel #4
0
 public CallRecord(	Device device, Line line, Call call,
     DateTime startTime, DateTime endTime)
 {
     Device = device;
     Line = line;
     Call = call;
     StartTime = startTime;
     EndTime = endTime;
 }
Beispiel #5
0
 public Line(	String name, String lastCalledNumber, String lastCallerNumber, bool messageWaiting,
     Call[] calls, RegistrationState registrationState)
 {
     mName = name;
     mLastCalledNumber = lastCalledNumber;
     mLastCallerNumber = lastCallerNumber;
     mMessageWaiting = messageWaiting;
     mCalls = calls;
     mRegistrationState = registrationState;
 }
Beispiel #6
0
 public IDeviceMonitor GetMonitor( Call callState )
 {
     foreach( DeviceMonitorControl control in DeviceMonitorControls )
         foreach( Line line in control.DeviceMonitor.GetDeviceState().Lines )
             foreach( Call call in line.Calls )
                 if( call == callState )
                     return control.DeviceMonitor;
     throw new DomainObjectNotFoundException( "Couldn't find a monitor owning the specified call." );
 }
        protected override void AnalyseCall( String page, Call callState, Line lineState, IList<CallPropertyChange> callChanges )
        {
            Activity callActivity = GetActivity( StringHelper.ExtractSubstring( page, callState.Name + " State:<td><font color=\"darkblue\">", "<", lineState.Name + " Status" ) );
            if( callActivity != callState.Activity )
                callChanges.Add( new CallPropertyChange( callState, PROPERTY_CALL_ACTIVITY, callState.Activity.ToString(), callActivity.ToString() ) );
            callState.Activity = callActivity;

            String duration = StringHelper.EmptyToNull( StringHelper.ExtractSubstring( page, callState.Name + " Duration:<td><font color=\"darkblue\">", "<", lineState.Name + " Status" ) );
            if( duration != callState.Duration )
                callChanges.Add( new CallPropertyChange( callState, PROPERTY_CALL_DURATION, callState.Duration, duration ) );
            callState.Duration = duration;

            CallType type = GetCallType( StringHelper.ExtractSubstring( page, callState.Name + " Type:<td><font color=\"darkblue\">", "<", lineState.Name + " Status" ) );
            if( type != callState.Type )
                callChanges.Add( new CallPropertyChange( callState, PROPERTY_CALL_TYPE, callState.Type.ToString(), type.ToString() ) );
            callState.Type = type;

            Tone tone = GetTone( StringHelper.ExtractSubstring( page, callState.Name + " Tone:<td><font color=\"darkblue\">", "<", lineState.Name + " Status" ) );
            if( tone != callState.Tone )
                callChanges.Add( new CallPropertyChange( callState, PROPERTY_CALL_TONE, callState.Tone.ToString(), tone.ToString() ) );
            callState.Tone = tone;

            String encoder = StringHelper.EmptyToNull( StringHelper.ExtractSubstring( page, callState.Name + " Encoder:<td><font color=\"darkblue\">", "<", lineState.Name + " Status" ) );
            if( encoder != callState.Encoder )
                callChanges.Add( new CallPropertyChange( callState, PROPERTY_CALL_ENCODER, callState.Encoder, encoder ) );
            callState.Encoder = encoder;

            String decoder = StringHelper.EmptyToNull( StringHelper.ExtractSubstring( page, callState.Name + " Decoder:<td><font color=\"darkblue\">", "<", lineState.Name + " Status" ) );
            if( decoder != callState.Decoder )
                callChanges.Add( new CallPropertyChange( callState, PROPERTY_CALL_DECODER, callState.Decoder, decoder ) );
            callState.Decoder = decoder;

            long bytesSent = ParseInt64( StringHelper.ExtractSubstring( page, callState.Name + " Bytes Sent:<td><font color=\"darkblue\">", "<", lineState.Name + " Status" ) );
            if( bytesSent != callState.BytesSent )
                callChanges.Add( new CallPropertyChange( callState, PROPERTY_CALL_BYTESSENT, callState.BytesSent, bytesSent ) );
            callState.BytesSent = bytesSent;

            long bytesReceived = ParseInt64( StringHelper.ExtractSubstring( page, callState.Name + " Bytes Recv:<td><font color=\"darkblue\">", "<", lineState.Name + " Status" ) );
            if( bytesReceived != callState.BytesReceived )
                callChanges.Add( new CallPropertyChange( callState, PROPERTY_CALL_BYTESRECEIVED, callState.BytesReceived, bytesReceived ) );
            callState.BytesReceived = bytesReceived;

            long packetLoss = ParseInt64( StringHelper.ExtractSubstring( page, callState.Name + " Packets Lost:<td><font color=\"darkblue\">", "<", lineState.Name + " Status" ) );
            if( packetLoss != callState.PacketLoss )
                callChanges.Add( new CallPropertyChange( callState, PROPERTY_CALL_PACKETLOSS, callState.PacketLoss, packetLoss ) );
            callState.PacketLoss = packetLoss;

            long packetError = ParseInt64( StringHelper.ExtractSubstring( page, callState.Name + " Packet Error:<td><font color=\"darkblue\">", "<", lineState.Name + " Status" ) );
            if( packetError != callState.PacketError )
                callChanges.Add( new CallPropertyChange( callState, PROPERTY_CALL_PACKETERROR, callState.PacketError, packetError ) );
            callState.PacketError = packetError;

            long jitter = ParseInt64( StringHelper.ExtractSubstring( page, callState.Name + " Jitter:<td><font color=\"darkblue\">", "<", lineState.Name + " Status" ).Replace( " ms", "") );
            if( jitter != callState.Jitter )
                callChanges.Add( new CallPropertyChange( callState, PROPERTY_CALL_JITTER, callState.Jitter, jitter ) );
            callState.Jitter = jitter;

            long decodeLatency = ParseInt64( StringHelper.ExtractSubstring( page, callState.Name + " Decode Latency:<td><font color=\"darkblue\">", "<", lineState.Name + " Status" ).Replace( " ms", "") );
            if( decodeLatency != callState.DecodeLatency )
                callChanges.Add( new CallPropertyChange( callState, PROPERTY_CALL_DECODELATENCY, callState.DecodeLatency, decodeLatency ) );
            callState.DecodeLatency = decodeLatency;

            long roundTripDelay = ParseInt64( StringHelper.ExtractSubstring( page, callState.Name + " Round Trip Delay:<td><font color=\"darkblue\">", "<", lineState.Name + " Status" ).Replace( " ms", "") );
            if( roundTripDelay != callState.RoundTripDelay )
                callChanges.Add( new CallPropertyChange( callState, PROPERTY_CALL_ROUNDTRIPDELAY, callState.RoundTripDelay, roundTripDelay ) );
            callState.RoundTripDelay = roundTripDelay;
        }
Beispiel #8
0
 public Line( String name, Call[] calls )
 {
     mName = name;
     mCalls = calls;
 }
 protected abstract void AnalyseCall( String page, Call call, Line line, IList<CallPropertyChange> callChanges );