I don't have the sample code that Genesys provides, but here is the sample of my code of how I do it.
For the keywords and what they are used to, please refer to Genesys outbound manual.
Here is the function that can do everything ( sorry for the sloppy writing

):
Basics:
since OCS can be controlled via CommDN using user-data, all you have to do is populate User-Data with the the command, OCS DBID, AppID and so on, and then send it to T-Server. You will need to refer to OCS manuals on to what keyword means what.
Here is the code that will allow you to start/stop/load/unload the campaigns.
First there is a generic function used to populate the user-data. Then you will see a sample of how to use it.
(note that index is refering to the array I have in my program which stores dbid for each Campaign, so you will need to create it on your own or modify it to suit your needs. To quick test it, just look up dbid in cme db)
[color=Green] [size=8pt][font=Verdana] private void controlCampaign(int index, int msgtype, int mode,int optimize_by, int optimize_goal)
{
// Defining KVPair & KVList
offset=index;
DesktopToolkitX.CTKVPair myPair;
DesktopToolkitX.CTKVList myList;
DesktopToolkitX.TEventInfo teventInfo = new DesktopToolkitX.TEventInfoClass();
myList=new DesktopToolkitX.CTKVListClass();
this.Info.Text="Campaign Load request sent for "+conf.campaignArray[index].name;
//add Load Message
myPair=new DesktopToolkitX.CTKVPairClass(); //new kv_pair();
myPair.Key="GSW_CM_MessageType";
myPair.Type=DesktopToolkitX.CTKVType.CKVTypeNum;
myPair.NumValue = msgtype; // "CM_ReqLoadCampaign";
myList.AddHead(myPair);
myPair=null;
myPair=new DesktopToolkitX.CTKVPairClass(); //new kv_pair();
myPair.Key = "GSW_CM_AttrOriginAppID";
myPair.Type=DesktopToolkitX.CTKVType.CKVTypeNum;
myPair.NumValue=this.TServer.AppDBID; // DBID of Application
myList.AddHead(myPair);
myPair = new DesktopToolkitX.CTKVPairClass(); //new kv_pair();
myPair.Key = "GSW_CM_AttrTargetAppID";
myPair.Type = DesktopToolkitX.CTKVType.CKVTypeNum;
myPair.NumValue = this.TServer.OCSDBID; // DBID of Application
myList.AddHead(myPair);
myPair=null;
myPair=new DesktopToolkitX.CTKVPairClass(); //new kv_pair();
myPair.Key = "GSW_CM_AttrCampaignID";
myPair.Type=DesktopToolkitX.CTKVType.CKVTypeNum;
myPair.NumValue=conf.campaignArray[index].Id; // DBID of Campaign
myList.AddHead(myPair);
myPair=null;
myPair=new DesktopToolkitX.CTKVPairClass(); //new kv_pair();
myPair.Key="GSW_CM_AttrGroupID";
myPair.Type=DesktopToolkitX.CTKVType.CKVTypeNum;
myPair.NumValue=conf.campaignArray[index].agentGroupDBID; // DBID of Campaign
myList.AddHead(myPair);
myPair=null;
myPair=new DesktopToolkitX.CTKVPairClass(); //new kv_pair();
myPair.Key="GSW_CM_AttrDialMode";
myPair.Type=DesktopToolkitX.CTKVType.CKVTypeNum;
myPair.NumValue=mode; // DBID of Campaign
myList.AddHead(myPair);
myPair=null;
myPair=new DesktopToolkitX.CTKVPairClass(); //new kv_pair();
myPair.Key="GSW_CM_AttrOptimizeBy";
myPair.Type=DesktopToolkitX.CTKVType.CKVTypeNum;
myPair.NumValue = conf.campaignArray[index].optimizeBy; //optimize_by; // Optimize by
myList.AddHead(myPair);
myPair=null;
myPair=new DesktopToolkitX.CTKVPairClass(); //new kv_pair();
myPair.Key="GSW_CM_AttrOptimizeGoal";
myPair.Type=DesktopToolkitX.CTKVType.CKVTypeNum;
myPair.NumValue = conf.campaignArray[index].settingValue; // optimize_goal; // Optimize goal
myList.AddHead(myPair);
teventInfo.UserData = myList;
TExtension.TSendUserEvent(teventInfo);
}
[/font][/size][/color]
all you need now is to call this function with the parameters for start, stop, etc.
to start campaign, you just do this:
(note: you will need to replace this.conf.campaignArray[index].dialMode and this.conf.campaignArray[index].settingValue with dialMode and value for the campaign. Also, index here refers to a place in the campaign array that stores the information about the campaign.)
[color=Green]
[size=8pt][font=Verdana] private void startCampaign(int index, int Mode)
{
controlCampaign(index,7,this.conf.campaignArray[index].dialMode,1,this.conf.campaignArray[index].settingValue); // load
controlCampaign(index, 9, this.conf.campaignArray[index].dialMode, 1, this.conf.campaignArray[index].settingValue); //start
return;
}[/font][/size][/color]
I hope it gives you a better insight of how to do it. It is also useful to ask Genesys support. Sometimes they are nice enough to actually modify the code part that does not work or explain why it does not work.
Tell me if you need more help,
Vic