" /> campaign control via attch data - Genesys CTI User Forum

Author Topic: campaign control via attch data  (Read 3664 times)

vic

  • Guest
campaign control via attch data
« on: January 01, 1970, 12:00:00 AM »
Advertisement
hello
can someone please tell me if i can load/start campaign in ocs WITHOUT Interaction SDK and OCM.
I thought we could just use user_data to load:start campaigns using ThisDN=CommunicationDN
thanks,
vic

LeszekM

  • Guest
campaign control via attch data
« Reply #1 on: January 01, 1970, 12:00:00 AM »
  • Best Answer
  • Yes, you can start / stop / load etc. campaigns using your own application. You simply need TLibrary. All you have to do is to use TSendUserEvent function which makes TServer to send EventUserEvent.
    The details of the protocol (KVpairs you have to attach to these UserEvents) known as Communication DN API and other requirements (the application sending events to OCS should be defined in CME) is described in the reference guide for OCS.

    Regards,
    Leszek

    ugur

    • Guest
    Re: campaign control via attch data
    « Reply #2 on: August 14, 2006, 02:38:40 PM »
  • Best Answer


  • do you have a sample code?

    thank you.

    Offline victor

    • Administrator
    • Hero Member
    • *****
    • Posts: 1419
    • Karma: 18
    Re: campaign control via attch data
    « Reply #3 on: August 15, 2006, 02:04:48 AM »
  • Best Answer
  • 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