There are various ways to do this.
The basic way is to send a UserEvent from the Agents DN.
To send a UserEvent have a look at the RequestSendEvent request.
Platform SDK 8.5 API Reference
RequestSendEvent Class
Namespaces ► Genesyslab.Platform.Voice.Protocols.TServer.Requests.Special ► RequestSendEvent
In the UserEvent need to add the required fields to the UserData for either a UpdateCallCompletionStats or a RecordProcessed request (see the Outbound Contact Reference Manual)..
For example a RecordProcessed request would be something like:
private void btnRecordProcess_Click(object sender, EventArgs e)
{
KeyValueCollection kvp = new KeyValueCollection();
kvp.Add("GSW_AGENT_REQ_TYPE", "RecordProcessed");
kvp.Add("GSW_CALL_RESULT", 9);//AnswerMachine Detected
gc.ProcessRecord(prot_name, dn, kvp);
}
internal void ProcessRecord(string prot_name, string dn, KeyValueCollection kvp)
{
DNState state = DNStateHolder.Instance.getDNState(dn);
if(state ==null)
return;
Dictionary<String, CallState> calls = state.Calls;
foreach(String key in calls.Keys)
{
CallState call = calls[key];
KeyValueCollection call_data = call.UserData;
if (call_data.ContainsKey("GSW_RECORD_HANDLE"))
{
kvp.Add("GSW_RECORD_HANDLE", call_data.GetAsInt("GSW_RECORD_HANDLE"));
}
if (call_data.ContainsKey("GSW_APPLICATION_ID"))
{
kvp.Add("GSW_APPLICATION_ID", call_data.GetAsInt("GSW_APPLICATION_ID"));
}
if (call_data.ContainsKey("GSW_CALLING_LIST"))
{
kvp.Add("GSW_CALLING_LIST", call_data.GetAsString("GSW_CALLING_LIST"));
}
if (call_data.ContainsKey("GSW_CAMPAIGN_NAME"))
{
kvp.Add("GSW_CAMPAIGN_NAME", call_data.GetAsString("GSW_CAMPAIGN_NAME"));
}
if (call_data.ContainsKey("GSW_CAMPAIGN_NAME"))
{
kvp.Add("GSW_CAMPAIGN_NAME", call_data.GetAsString("GSW_CAMPAIGN_NAME"));
}
}
SendUserEvent(prot_name, dn, kvp);
}
internal void SendUserEvent(string prot_name, string dn, KeyValueCollection kvp)
{
RequestSendEvent req = RequestSendEvent.Create();
CommonProperties comm = CommonProperties.Create();
comm.ThisDN = dn;
comm.UserData = kvp;
comm.UserEvent = EventUserEvent.MessageId;
req.UserEvent = comm;
sendRequest(prot_name, req);
}