Commit 3dd0c3e8 authored by garciay's avatar garciay
Browse files

Add/modify User Equipment message

Add setting for frame title
parent 4579bd2d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -17,7 +17,8 @@
  </log4net>
  <appSettings>
    <add key="IpAddress" value="127.0.0.1" />
    <add key="IpPort" value="6610" />
    <add key="IpPort" value="6610" /> <!-- 6611 -->
    <add key="Title" value="User A" /> <!-- User B -->
    <add key="MessagesFile" value="FILE://D:/cygwin/home/yann/dev/g++/STF 370/adapter/src/UEUserGuide/UserGuidesMessages.xml" />
  </appSettings>
</configuration>
 No newline at end of file
+25 −14
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ namespace UEUserGuide
                _address = appSettings.Settings["IpAddress"].Value;
                _port = int.Parse(appSettings.Settings["IpPort"].Value);
                _messagesFilePath = new Uri(appSettings.Settings["MessagesFile"].Value);
                Text = appSettings.Settings["Title"].Value;
                // Sanity check.
                if (!System.IO.File.Exists(_messagesFilePath.LocalPath))
                {
@@ -128,8 +129,6 @@ namespace UEUserGuide
                return;
            }

            // Initialize button map.

            // Start TCP/IP listener.
            try
            {
@@ -308,7 +307,7 @@ namespace UEUserGuide
            // Sanity check.
            if (!(parms is ProcessNewConnectionArgs))
            {
                // TODO: Add logs.
                Logger.Instance.ErrorLogger("ProcessNewConnection: Wrong parameters.");
                return;
            }
            ProcessNewConnectionArgs args = parms as ProcessNewConnectionArgs;
@@ -319,9 +318,8 @@ namespace UEUserGuide
            {
                // Buffer for reading data.
                string readBytes;
                //byte[] buffer = null;
                // Read data.
                int length = args.Client.Receive(out readBytes/*buffer*/);
                int length = args.Client.Receive(out readBytes);
                byte[] buffer = System.Text.Encoding.ASCII.GetBytes(readBytes.ToCharArray(), 0, length);
                if (length == -1)
                {
@@ -357,7 +355,7 @@ namespace UEUserGuide
                        index += str.Length;
                        parmsList.Add(str);
                    }
                    if (!string.IsNullOrEmpty(trigger) && (_parms.ContainsKey(trigger)))
                    if (!string.IsNullOrEmpty(trigger))
                    {
                        // Update UI in multi-threaded mode.
                        IAsyncResult result = this.BeginInvoke(new UpdateUICallBack(UpdateUI), trigger, parmsList);
@@ -366,6 +364,10 @@ namespace UEUserGuide
                        // Wait for user action done.
                        _userActionCompleted.WaitOne(30000);
                    }
                    else
                    {
                        _userResponse = DialogResult.Cancel;
                    }
                    // Send response message
                    byte[] response = new byte[1] { (byte)_userResponse };
                    args.Client.Send(BitConverter.ToString(response));
@@ -389,6 +391,9 @@ namespace UEUserGuide
        {
            _message.Focus();
            _userActionCompleted.Reset();
            string action = "OkCancel";
            if (_parms.ContainsKey(trigger))
            {
                string message = _parms[trigger].Text;
                if (!((paramsList.Count == 0) || ((paramsList.Count == 1) && (paramsList[0] == "*"))))
                {
@@ -399,7 +404,13 @@ namespace UEUserGuide
                    }
                }
                _message.Text = message;
            switch (_parms[trigger].Action)
                action = _parms[trigger].Action;
            }
            else
            {
                _message.Text = trigger;
            }
            switch (action)
            {
                case "OkCancel":
                    _btOK.Enabled = true;
+6 −3
Original line number Diff line number Diff line
@@ -7,8 +7,11 @@
  <Lannion>
    <UE_REGISTRATION Text="Please register a SIP session" Actions="OkCancel" />
    <UE_CHECK_IS_REGISTER Text="Please check that you are currently registered" Actions="OkCancel" />
    <UE_CHECK_MESSAGE_RECEIPT Text="If you received the message '123', please click on button Yes, otherwise, click on No" Actions="YesNo" />
    <UE_SEND_MESSAGE Text="Please send the message '123'" Actions="OkCancel" />
    <UE_DEREGISTRATION Text="Please de-register your current SIP session" Actions="OkCancel" />
    <UE_CHECK_IS_NOT_REGISTERED Text="Please check that you are not currently registered" Actions="OkCancel" />
    <UE_CHECK_CALL_IS_INITIALIZED Text="Please check that the call is in progress" Actions="OkCancel" />
    <UE_CHECK_CALL_IS_ANSWERED Text="Please check that the call was answered" Actions="OkCancel" />
    <UE_CHECK_CALL_IS_ENDED Text="Please check that the call was ended" Actions="OkCancel" />
    <UE_CHECK_NEW_MEDIA_STREAM_IS_ADDED Text="Please click on button Yes if a new media stream was added, otherwise, click on No" Actions="YesNo" />
    <UE_CHECK_NEW_MEDIA_STREAM_IS_REMOVED Text="Please click on button Yes if a new media stream was removed, otherwise, click on No" Actions="YesNo" />
  </Lannion>
</UserGuideMessages>