We had working code which used to get preview record when agent logs in. Below is the source code for preview record request.
[color=green]
public void Connect()
{
axTConnection1.THost = "ValidHostIP";
axTConnection1.TPort = "ValidPortNo";
bool isConnected = axTConnection1.TConnect();
axTExtension1.TDN = "ValidExtn";
axTExtension1.ConnectionName = "axTConnection1";
TStatus IsRegistered = axTExtension1.TRegister();
axTExtension1.TAgentID = "ValidID";
axTExtension1.TAgentPassword = "";
TStatus IsLoggedIn = axTExtension1.TLogin();
axTLine1.ExtensionName = "axTExtension1";
TStatus IsReconnect = axTLine1.TReconnect();
axTExtension1.TReady();
}
public void StartPreviewDialling()
{
try
{
TEventInfo objEvent = new TEventInfo();
CTKVPair newPair = new CTKVPair();
CTKVList KVList = new CTKVList();
newPair.Key = "GSW_AGENT_REQ_TYPE";
newPair.Type = CTKVType.CKVTypeString;
newPair.StringValue = "PreviewDialingModeStart";
KVList.AddTail(newPair);
newPair.Key = "GSW_APPLICATION_ID";
newPair.Type = CTKVType.CKVTypeNum;
newPair.NumValue = 123;
KVList.AddTail(newPair);
newPair.Key = "GSW_CAMPAIGN_NAME";
newPair.Type = CTKVType.CKVTypeString;
newPair.StringValue = "AmPreview";
KVList.AddTail(newPair);
objEvent.EventType = TMessageType.EventUserEvent;
objEvent.UserData = KVList;
axTExtension1.TSendUserEvent(objEvent);
}
catch (Exception ex)
{
throw new Exception("Exception in Dialer.StartPreviewDialling /r/n " + ex.Message, ex);
}
}
public void GetPreviewCallListData()
{
try
{
TEventInfo objEvent = new TEventInfo();
CTKVPair newPair = new CTKVPair();
CTKVList KVList = new CTKVList();
newPair.Key = "GSW_APPLICATION_ID";
newPair.Type = CTKVType.CKVTypeNum;
newPair.NumValue = 123;
KVList.AddTail(newPair);
newPair.Key = "GSW_CAMPAIGN_NAME";
newPair.Type = CTKVType.CKVTypeString;
newPair.StringValue = "AmPreview";
KVList.AddTail(newPair);
newPair.Key = "GSW_AGENT_REQ_TYPE";
newPair.Type = CTKVType.CKVTypeString;
newPair.StringValue = "PreviewRecordRequest";
KVList.AddTail(newPair);
objEvent.EventType = TMessageType.EventUserEvent;
objEvent.UserData = KVList;
axTExtension1.TSendUserEvent(objEvent);
}
catch (Exception ex)
{
throw new Exception("Exception in Dialer.GetPreviewCallListData /r/n " + ex.Message, ex);
}
}[/color]
Earlier when i used to call above 3 methods in one button click event, I used to get record. But now its not working, I have found one work around but still confused why this work around is working. Work around is, I am calling method "GetPreviewCallListData()" from different method and its working fine. Sorry I cannot post OCS log as I don't have access to it but I came to know from our support team that when I call "GetPreviewCallListData()" in my old code that time dialer is sending record to application but in my code there os no event fire or any thing. Any idea guys why this is happening suddenly?