Can't invoke DLL function without debug point - c#

I have created a DLL in C# which creates message queue and object and send that object
to message queue. I added the reference of the created DLL to another application. Application
runs successfully when debug point is applied to DLL invoking function. But without debug point, it doesn't send object to message queue.
DLL Function as follows :
public void Enqueue()
{
try
{
this.CreateQueue(); //function that creates queue
Message msg = new Message();
DataTable dtOrd;
if (IsSingleOrder)
{
dtOrd = objDBTrans.funcGetNewOrdSingleDetails(this.DefaultSecurityCode, this.OrderCode, this.CreatedDate);
}
else
{
dtOrd = objDBTrans.funcGetBasketOrdDetails(this.DefaultSecurityCode, this.CreatedDate);
}
for (int iRows = 0; iRows < dtOrd.Rows.Count; iRows++)
{
DataRow drOrd;
drOrd = dtOrd.Rows[iRows];
objEMSOrdMap.funcAssignMapping(drOrd);
msg.Body = objEms;
msg.Label = strFileNamq + "_" + objEms.ClOrdID + " " + DateTime.Now.ToString();
queue.Send(msg);
}
}
catch (Exception ex)
{
}
}
DLL function that creates queue :
public void CreateQueue()
{
try
{
MessageQueue queue;
queue = new MessageQueue(msgQueue, false); //msgQueue = String containing queue name
}
catch (Exception)
{
}
}
Application function that invoke DLL function :
using EMSMsmqDll;
class EMSMSMQDemo : clsDBConnection
{
public void funcDemo()
{
MSMQService objSer = new MSMQService(); //Class from EMSMsmqDll that creates message queue and object and send that object to message queue
objSer.Enqueue();
}
}

Related

How can I get rid of a memory leak in my Android app involving a BroadcastReceiver

Here is the code for my initializer:
public void Initialize(MainActivity activity)
{
context = activity;
store = activity.store;
gui = activity.gui;
store.Initialize(activity);
initialized = true; // note the this is initialized to TRUE
}
Here is the code for my class constructor:
public TextReceiver()
{
Android.Util.Log.Debug("DEBUG", "CREATED a receiver :" + counter.ToString());
toKill = counter++;
}
Here is the code for my work-around:
public void Refresh()
{
initialized = true;
store = context.store;
gui = context.gui;
}
Here is the code for my callback:
public override void OnReceive(Context contextPass, Intent intent)
{
Android.Util.Log.Debug("DEBUG", "receiving a text message: initialized - [" + initialized.ToString() + "]");
if (initialized == false) { Refresh(); } // this is my current work-around
// but I fear this leaks memory
if (intent.HasExtra("pdus") && (ContextCompat.CheckSelfPermission(context, Manifest.Permission.ReadSms) == Permission.Granted))
{
Bundle MessageInfo = intent.Extras;
Java.Lang.Object[] pdus = (Java.Lang.Object[])MessageInfo.Get("pdus");
SmsMessage[] messages = new SmsMessage[pdus.Length];
for (int i = 0; i < messages.Length; i++)
{
SmsMessage toSend = null;
// Verizon phones use the string "3gpp2"
// Some other carriers use the sting
// "3gpp". If the version is not correct,
// this section will throw an exeception
try { toSend = SmsMessage.CreateFromPdu((byte[])(pdus[i]), "3gpp2"); }
catch { toSend = SmsMessage.CreateFromPdu((byte[])(pdus[i]), "3gpp"); }
if (store.Push(toSend) == true) // checks for duplicates
{
gui.TextsReceived();
}
}
}
}
The log file is large, but here is the significant section:
11-13 14:10:50.984 Google Pixel 3 Error 26765 Bugle zdt: Jibe SDK Service not available. Is the Jibe SDK service running? Did you call connect() and wait for the notification before calling an API function?
Note that the bug report mentions a service which is not running:
Is the Jibe SDK service running?
Did you call connect() and wait for the notification before calling an API function?
Is this a result of the way I am using the callback? Am I calling the callback improperly somehow?
My work-around works, but I fear it leaks memory because it instantiates a new BroadcastReciever with each callback and doesn't ever free the instance as far as I can tell.
Some more details:

TcpClient exceptions when calling EndReceive and BeginReceive

I'm trying to implement wrapper class which will simply connect to TCP server and wait for data. Once data submitted from server - I will receive this data and pass it onto subscribers of my class.
All this works. Now I want to add external functionality to "reset" this class on a timer (force reconnect every so often) to keep connection alive. My idea is that Init method can be called as many times as needed to get socket reset. However, I do get various exceptions with this.
Class code:
namespace Ditat.GateControl.Service.InputListener
{
using System;
using System.ComponentModel;
using System.Net;
using System.Net.Sockets;
using System.Text;
public class BaseTCPSocketListener : IInputListener
{
#region Events/Properties
public event EventHandler<Exception> OnError;
public event EventHandler<string> OnDataReceived;
private string host;
private int port;
private int delayToClearBufferSeconds = 5;
private TcpClient client;
private readonly byte[] buffer = new byte[1024];
/// <summary>
/// Will accumulate data as it's received
/// </summary>
private string DataBuffer { get; set; }
/// <summary>
/// Store time of last data receipt. Need this in order to purge data after delay
/// </summary>
private DateTime LastDataReceivedOn { get; set; }
#endregion
public BaseTCPSocketListener()
{
// Preset all entries
this.LastDataReceivedOn = DateTime.UtcNow;
this.DataBuffer = string.Empty;
}
public void Init(string config)
{
// Parse info
var bits = config.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
this.host = bits[0];
var hostBytes = this.host.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
var hostIp = new IPAddress(new[] { byte.Parse(hostBytes[0]), byte.Parse(hostBytes[1]), byte.Parse(hostBytes[2]), byte.Parse(hostBytes[3]) });
this.port = int.Parse(bits[1]);
this.delayToClearBufferSeconds = int.Parse(bits[2]);
// Close open client
if (this.client?.Client != null)
{
this.client.Client.Disconnect(true);
this.client = null;
}
// Connect to client
this.client = new TcpClient();
if (!this.client.ConnectAsync(hostIp, this.port).Wait(2500))
throw new Exception($"Failed to connect to {this.host}:{this.port} in allotted time");
this.EstablishReceiver();
}
protected void DataReceived(IAsyncResult result)
{
// End the data receiving that the socket has done and get the number of bytes read.
var bytesCount = 0;
try
{
bytesCount = this.client.Client.EndReceive(result);
}
catch (Exception ex)
{
this.RaiseOnErrorToClient(new Exception(nameof(this.DataReceived)));
this.RaiseOnErrorToClient(ex);
}
// No data received, establish receiver and return
if (bytesCount == 0)
{
this.EstablishReceiver();
return;
}
// Convert the data we have to a string.
this.DataBuffer += Encoding.UTF8.GetString(this.buffer, 0, bytesCount);
// Record last time data received
this.LastDataReceivedOn = DateTime.UtcNow;
this.RaiseOnDataReceivedToClient(this.DataBuffer);
this.DataBuffer = string.Empty;
this.EstablishReceiver();
}
private void EstablishReceiver()
{
try
{
// Set up again to get the next chunk of data.
this.client.Client.BeginReceive(this.buffer, 0, this.buffer.Length, SocketFlags.None, this.DataReceived, this.buffer);
}
catch (Exception ex)
{
this.RaiseOnErrorToClient(new Exception(nameof(this.EstablishReceiver)));
this.RaiseOnErrorToClient(ex);
}
}
private void RaiseOnErrorToClient(Exception ex)
{
if (this.OnError == null) return;
foreach (Delegate d in this.OnError.GetInvocationList())
{
var syncer = d.Target as ISynchronizeInvoke;
if (syncer == null)
{
d.DynamicInvoke(this, ex);
}
else
{
syncer.BeginInvoke(d, new object[] { this, ex });
}
}
}
private void RaiseOnDataReceivedToClient(string data)
{
if (this.OnDataReceived == null) return;
foreach (Delegate d in this.OnDataReceived.GetInvocationList())
{
var syncer = d.Target as ISynchronizeInvoke;
if (syncer == null)
{
d.DynamicInvoke(this, data);
}
else
{
syncer.BeginInvoke(d, new object[] { this, data });
}
}
}
}
}
Client code (under button click on form)
private void ListenBaseButton_Click(object sender, EventArgs e)
{
if (this.bsl == null)
{
this.bsl = new BaseTCPSocketListener();
this.bsl.OnDataReceived += delegate (object o, string s)
{
this.DataTextBox.Text += $"Base: {DateTime.Now} - {s}" + Environment.NewLine;
};
this.bsl.OnError += delegate (object o, Exception x)
{
this.DataTextBox.Text += $"Base TCP receiver error: {DateTime.Now} - {x.Message}" + Environment.NewLine;
};
}
try
{
this.bsl.Init("192.168.33.70|10001|10");
this.DataTextBox.Text += "BEGIN RECEIVING BSL data --------------------------" + Environment.NewLine;
}
catch (Exception exception)
{
this.DataTextBox.Text += $"ERROR CONNECTING TO BSL ------------{exception.Message}" + Environment.NewLine;
}
}
Exceptions I get. First exception when button clicked 2nd time in from handler in DataReceived
The IAsyncResult object was not returned from the corresponding
asynchronous method on this class.
On following clicks I get exception from handler in EstablishReceiver
A request to send or receive data was disallowed because the socket is
not connected and (when sending on a datagram socket using a sendto
call) no address was supplied
How do I properly ensure socket closed and re-opened?
The IAsyncResult object was not returned from the corresponding
asynchronous method on this class.
This is a well known problem that happens when data callback (DataReceived()) is called for previous socket. In this case you will call Socket.EndReceive() with incorrect instance of IAsyncResult which throws above exception.
Asynchronous Client Socket Example contains possible workaround for this problem: store socket on which BeginReceive() was called in state object which is then passed to DataReceived callback:
StateObject class
public class StateObject
{
public Socket Socket { get; set; }
public byte[] Buffer { get; } = new byte[1024];
public StateObject(Socket socket)
{
Socket = socket;
}
}
EstablishReceiver() method:
private void EstablishReceiver()
{
try
{
var state = new StateObject(client.Client);
// Set up again to get the next chunk of data.
this.client.Client.BeginReceive(state.Buffer, 0, state.Buffer.Length, SocketFlags.None, this.DataReceived, state);
}
catch (Exception ex)
{
this.RaiseOnErrorToClient(new Exception(nameof(this.EstablishReceiver)));
this.RaiseOnErrorToClient(ex);
}
}
DataReceived() method:
protected void DataReceived(IAsyncResult result)
{
var state = (StateObject) result.AsyncState;
// End the data receiving that the socket has done and get the number of bytes read.
var bytesCount = 0;
try
{
SocketError errorCode;
bytesCount = state.Socket.EndReceive(result, out errorCode);
if (errorCode != SocketError.Success)
{
bytesCount = 0;
}
}
catch (Exception ex)
{
this.RaiseOnErrorToClient(new Exception(nameof(this.DataReceived)));
this.RaiseOnErrorToClient(ex);
}
if (bytesCount > 0)
{
// Convert the data we have to a string.
this.DataBuffer += Encoding.UTF8.GetString(state.Buffer, 0, bytesCount);
// Record last time data received
this.LastDataReceivedOn = DateTime.UtcNow;
this.RaiseOnDataReceivedToClient(this.DataBuffer);
this.DataBuffer = string.Empty;
this.EstablishReceiver();
}
}
A request to send or receive data was disallowed because the socket is
not connected and (when sending on a datagram socket using a sendto
call) no address was supplied
Above DataReceived() method also contains the fix for the second exception. Exception is caused by calling BeginReceive() (from EstablishReceiver()) on disconnected socket. You should not call BeginReceive() on a socket if previous read brought 0 bytes.
First of all, you're closing the socket being held by the TcpClient, but not disposing the client itself. Try the following:
// Close open client
this.client?.Close(); // Disposes and releases resources
this.client = null;
The issue is that DataReceived will be called when you close the client. You simply need to identify to the method that it should not do anything because you have deliberately ended the process. You could just add a bool:
private bool ignoreCallback;
public void Init(string config)
{
// Parse info
var bits = config.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
this.host = bits[0];
var hostBytes = this.host.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
var hostIp = new IPAddress(new[] { byte.Parse(hostBytes[0]), byte.Parse(hostBytes[1]), byte.Parse(hostBytes[2]), byte.Parse(hostBytes[3]) });
this.port = int.Parse(bits[1]);
this.delayToClearBufferSeconds = int.Parse(bits[2]);
// Close open client
if (this.client?.Client != null)
{
ignoreCallback = true;
this.client.Client.Disconnect(true);
this.client = null;
}
// Connect to client
this.client = new TcpClient();
if (!this.client.ConnectAsync(hostIp, this.port).Wait(2500))
throw new Exception($"Failed to connect to {this.host}:{this.port} in allotted time");
this.EstablishReceiver();
}
protected void DataReceived(IAsyncResult result)
{
if (ignoreCallback)
{
ignoreCallback = false;
return;
}
...

Queue problems across multiple threads

There are many questions and articles on the subject of using a .NET Queue properly within a multi threaded application, however I can't find subject on our specific problem.
We have a Windows Service that receives messages onto a queue via one thread and is then dequeued and processed within another.
We're using lock when queuing and dequeuing, and the service had run fine for around 2 years without any problems. One day we noticed that thousands of messages had been logged (and so had been queued) but were never dequeued/processed, they seem to have been skipped somehow, which shouldn't be possible for a queue.
We can't replicate the circumstances that caused it as we have no real idea what caused it considering that day was no different from any of the others as far as we're aware.
The only idea we have is to do with the concurrency of the queue. We're not using the ConcurrentQueue data-type, which we plan on using in the hope it is a remedy.
One idea, looking at the source of the Queue type, is that it uses arrays internally, which have to be resized once these buffers have reached a certain length. We hypothesised that when this is being done some of the messages were lost.
Another idea from our development manager is that using multiple threads on a multicore processor setup means that even though locks are used, the individual cores are working on the data in their local registers, which can cause them to be working on different data. He said they don't work on the same memory and seems to think lock only works as expected one a single core processor using multiple threads.
Reading more about ConcurrentQueue's use of volatile I'm not sure that this would help, as I've read that using lock provides a stronger guarantee of threads using the most up-to-date state of memory.
I don't have much knowledge on this specific subject, so my question is whether the manager's idea sounds plausible, and whether we might have missed something that's required for the queue to be used properly.
Code snippet for reference (forgive the messy code, it does need refactoring):
public sealed class Message
{
public void QueueMessage(long messageId, Message msg)
{
lock (_queueLock)
{
_queue.Enqueue(new QueuedMessage() { Id = messageId, Message = msg });
}
}
public static void QueueMessage(string queueProcessorName, long messageId, Message msg)
{
lock (_messageProcessors[queueProcessorName]._queueLock)
{
_messageProcessors[queueProcessorName].QueueMessage(messageId, msg);
_messageProcessors[queueProcessorName].WakeUp(); // Ensure the thread is awake
}
}
public void WakeUp()
{
lock(_monitor)
{
Monitor.Pulse(_monitor);
}
}
public void Process()
{
while (!_stop)
{
QueuedMessage currentMessage = null;
try
{
lock (_queueLock)
{
currentMessage = _queue.Dequeue();
}
}
catch(InvalidOperationException i)
{
// Nothing in the queue
}
while(currentMessage != null)
{
IContext context = new Context();
DAL.Message msg = null;
try
{
msg = context.Messages.SingleOrDefault(x => x.Id == currentMessage.Id);
}
catch (Exception e)
{
// TODO: Handle these exceptions better. Possible infinite loop.
continue; // Keep retrying until it works
}
if (msg == null) {
// TODO: Log missing message
continue;
}
try
{
msg.Status = DAL.Message.ProcessingState.Processing;
context.Commit();
}
catch (Exception e)
{
// TODO: Handle these exceptions better. Possible infinite loop.
continue; // Keep retrying until it works
}
bool result = false;
try {
Transformation.TransformManager mgr = Transformation.TransformManager.Instance();
Transformation.ITransform transform = mgr.GetTransform(currentMessage.Message.Type.Name, currentMessage.Message.Get("EVN:EventReasonCode"));
if (transform != null){
msg.BeginProcessing = DateTime.Now;
result = transform.Transform(currentMessage.Message);
msg.EndProcessing = DateTime.Now;
msg.Status = DAL.Message.ProcessingState.Complete;
}
else {
msg.Status = DAL.Message.ProcessingState.Failed;
}
context.Commit();
}
catch (Exception e)
{
try
{
context = new Context();
// TODO: Handle these exceptions better
Error err = context.Errors.Add(context.Errors.Create());
err.MessageId = currentMessage.Id;
if (currentMessage.Message != null)
{
err.EventReasonCode = currentMessage.Message.Get("EVN:EventReasonCode");
err.MessageType = currentMessage.Message.Type.Name;
}
else {
err.EventReasonCode = "Unknown";
err.MessageType = "Unknown";
}
StringBuilder sb = new StringBuilder("Exception occured\n");
int level = 0;
while (e != null && level < 10)
{
sb.Append("Message: ");
sb.Append(e.Message);
sb.Append("\nStack Trace: ");
sb.Append(e.StackTrace);
sb.Append("\n");
e = e.InnerException;
level++;
}
err.Text = sb.ToString();
}
catch (Exception ne) {
StringBuilder sb = new StringBuilder("Exception occured\n");
int level = 0;
while (ne != null && level < 10)
{
sb.Append("Message: ");
sb.Append(ne.Message);
sb.Append("\nStack Trace: ");
sb.Append(ne.StackTrace);
sb.Append("\n");
ne = ne.InnerException;
level++;
}
EventLog.WriteEntry("Service", sb.ToString(), EventLogEntryType.Error);
}
}
try
{
context.Commit();
lock (_queueLock)
{
currentMessage = _queue.Dequeue();
}
}
catch (InvalidOperationException e)
{
currentMessage = null; // No more messages in the queue
}
catch (Exception ne)
{
StringBuilder sb = new StringBuilder("Exception occured\n");
int level = 0;
while (ne != null && level < 10)
{
sb.Append("Message: ");
sb.Append(ne.Message);
sb.Append("\nStack Trace: ");
sb.Append(ne.StackTrace);
sb.Append("\n");
ne = ne.InnerException;
level++;
}
EventLog.WriteEntry("Service", sb.ToString(), EventLogEntryType.Error);
}
}
lock (_monitor)
{
if (_stop) break;
Monitor.Wait(_monitor, TimeSpan.FromMinutes(_pollingInterval));
if (_stop) break;
}
}
}
private object _monitor = new object();
private int _pollingInterval = 10;
private volatile bool _stop = false;
private object _queueLock = new object();
private Queue<QueuedMessage> _queue = new Queue<QueuedMessage>();
private static IDictionary<string, Message> _messageProcessors = new Dictionary<string, Message>();
}
so my question is whether the manager's idea sounds plausible
Uhm. No. If all those synchronization measures would only work on single core machines, the world would have ended in complete Chaos decades ago.
and whether we might have missed something that's required for the queue to be used properly.
As far as your description goes, you should be fine. I would look at how you found out that you have that problem. logs coming in but then vanishing without being properly dequeued, wouldn't that be the default case if I simply turned off the service or rebooted the machine? Are you sure you lost them while your application was actually running?
You declare the object to be used for the lock as private object.
If you try this:
class Program
{
static void Main(string[] args)
{
Test test1 = new Test();
Task Scan1 = Task.Run(() => test1.Run("1"));
Test test2 = new Test();
Task Scan2 = Task.Run(() => test2.Run("2"));
while(!Scan1.IsCompleted || !Scan2.IsCompleted)
{
Thread.Sleep(1000);
}
}
}
public class Test
{
private object _queueLock = new object();
public async Task Run(string val)
{
lock (_queueLock)
{
Console.WriteLine($"{val} locked");
Thread.Sleep(10000);
Console.WriteLine($"{val} unlocked");
}
}
}
You will notice that the code that lies under the lock is executed even if another thread is running inside.
But if you change
private object _queueLock = new object();
To
private static object _queueLock = new object();
It changes how your lock works.
Now, this being your issue depends on if you have multiple instances that class or everything is running withing that same class.

Invoke a method with parameters

I'm developing a Windows Form app with C# and .NET Framework 4.0.
I'm using Task to run a long running task and I need to update UI with some log messages every time my task process a code.
There is a Queue processing that code, I need to show that a code has been processed.
private Task taskReadCodeAuto;
private delegate void RefreshTextBox();
private Queue CodesReceived;
public MainForm()
{
InitializeComponent();
logMessages = new List<string>();
CodesReceived = new Queue();
taskReadCodeAuto = new Task(() => ProcessCodesReceived());
}
private void ProcessCodesReceived()
{
int result;
try
{
while (CodesReceived.Count > 0)
{
string code = CodesReceived.Dequeue().ToString();
InsertProfileMessage(DateTime.Now.ToString("HH:mm:ss.fff"), string.Format("Sending code {0} to ReadCodeAuto...", code));
if (trzic == null)
{
result =
TRZIC.ReadCodeAuto(
ConnStringTextBox.Text,
byte.Parse(AggregationNumeric.Value.ToString()),
code);
}
else
{
result =
trzic.ReadCodeAuto(
byte.Parse(AggregationNumeric.Value.ToString()),
code);
}
InsertProfileMessage(DateTime.Now.ToString("HH:mm:ss.fff"), string.Format("Code sent {0}. Result: {1}", code, result));
}
}
catch (Exception ex)
{
InsertProfileMessage(DateTime.Now.ToString("HH:mm:ss.fff"), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
InsertProfileMessage(DateTime.Now.ToString("HH:mm:ss.fff"), "Error: " + ex.Message);
InsertProfileMessage(DateTime.Now.ToString("HH:mm:ss.fff"), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}
finally
{
InsertProfileMessage(DateTime.Now.ToString("HH:mm:ss.fff"), "END BG-WORKER");
}
}
private void InsertProfileMessage(string time, string message)
{
string profileString =
string.Format("{0} - {1}", time, message);
logMessages.Add(profileString);
if (this.InvokeRequired)
{
RefreshTextBox d = new RefreshTextBox(RefreshTextBoxResults);
Invoke(d);
}
else
{
RefreshTextBoxResults(profileString + "\n");
}
}
private void RefreshTextBoxResults(string text)
{
LogTextBox.AppendText(text);
}
My problem is that I don't know how to pass the text to show on LogTextBox using Invoke.
How can I do it?
Use the overload of Invoke which takes an Object[] as a parameter for the arguments to be supplied to your method.
You can add the parameters after the invoke:
Action<string> d = RefreshTextBoxResults;
this.Invoke(d, profileString + "\n");
Or invoke an action where the parameter is already included (which is this case is suitable regarding re usability)
Action d= () =>RefreshTextBoxResults(profileString + "\n");
if (this.InvokeRequired)
{
Invoke(d);
}
else
{
d();
}
PS, if you want to use your RefreshTextBox delegate instead of an Action, the RefreshTextBox delegate should be altered to include a string parameter
You would have to use the overload of Invoke which uses an array:
MSDN documentation
Pass the text value like below.
RefreshTextBox d = new RefreshTextBox(RefreshTextBoxResults);
Invoke(d,new object[] {“Pass value here”});

Setup & Deployment Project different then Source

I created this program that works fine in VS12 and compiles and runs fines. However I created a setup and deployment project for it using the InstallShield wizard. The installation is successfull on my test machine however I can not get my EventHandler working it is a service instance that i parse the events on.
class EventHandler : EventHandlerService.EventHandlerCCServicePortType
{
public EventHandlerService.handleEventResponse1 handleEvent(EventHandlerService.handleEventRequest eventMsg)
{
EventHandlerService.handleEventResponse1 resp = new EventHandlerService.handleEventResponse1();
EventHandlerService.handleEventResponse respInfo = new EventHandlerService.handleEventResponse();
resp.handleEventResponse = respInfo;
respInfo.#return = true;
Main instance = Main.getFormInstance();
instance.setPhoneStatus(eventMsg.handleEvent.#event);
return (resp);
}
}
static public Main getFormInstance()
{
return (instance);
}
delegate void setPhoneStatusCB(EventHandlerService.standardEventMsg eventMsg);
public void setPhoneStatus(EventHandlerService.standardEventMsg eventMsg)
{
DisplayEvent(eventMsg);
if (eventMsg.eventType == EventHandlerService.standardEventMsgEventType.CALL_EVENT)
{
if (eventMsg.callEvent.objectId == Int64.Parse(Peridot.Properties.Settings.Default.OIGPhoneObjID.ToString()))
{
Peridot.Properties.Settings.Default.OIGPhoneLastEvent = eventMsg.callEvent.type.ToString();
if (eventMsg.callEvent.callState.ToString().Length > 0)
{
Peridot.Properties.Settings.Default.OIGPhoneState = eventMsg.callEvent.callState.ToString();
}
if (eventMsg.callEvent.localCallId.ToString().Length > 0)
{
Peridot.Properties.Settings.Default.OIGPhoneCallId = eventMsg.callEvent.localCallId.ToString();
writeToLogFile("Getting OIG Phone Call ID EventMsg: " + eventMsg.callEvent.localCallId.ToString(), "SYSTEM");
}
else
{
Peridot.Properties.Settings.Default.OIGPhoneCallId = "";
writeToLogFile("Getting OIG Phone Call ID Failied! EventMsg: " + eventMsg.callEvent.localCallId.ToString(), "SYSTEM");
}
}
}
}
}
Seems like setPhoneStatus never gets called and the Instance is never sent, this only happens on the deployed program and not in the development. Any Ideas?

Categories