Author Topic: start campaign  (Read 7474 times)

Offline K.Palyanichka

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
start campaign
« on: August 28, 2014, 09:44:57 AM »
HI

Guys Please tell me how I can run a specific campaign using java do not use OCM.
I would be grateful for a simple example. :)

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: start campaign
« Reply #1 on: August 28, 2014, 10:13:34 AM »
Just check namespace/assembly com.genesyslab.platform.outbound.protocol.outboundserver.requests

Offline K.Palyanichka

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: start campaign
« Reply #2 on: August 28, 2014, 11:15:44 AM »
I am very sorry, but no one could help me with an example so that I was able to implement the idea by analogy.
I will be very grateful as it is for me very important question

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: start campaign
« Reply #3 on: August 28, 2014, 11:42:43 AM »
In what part of developement have you a problem? Are you able to connect to the OCS? If yes, just send a request for load (RequestLoadCampaign) and start (RequestStartDialing) campaign. How to send request or messages in general to the specific server is described very clear on site with docs.

Offline K.Palyanichka

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: start campaign
« Reply #4 on: August 29, 2014, 07:46:33 AM »
please tell me where I need to write the identity of a particular campaign to start it and what line to change.
Thanks in advance.

package com.genesyslab.platform.outbound.protocol.outboundserver.requests;
public abstract class RequestLoadCampaign extends com.genesyslab.platform.commons.protocol.Message {
    public static final int ID = 7;
    public static final java.lang.String NAME = "RequestLoadCampaign";

    private RequestLoadCampaign() { /* compiled code */ }

    public static com.genesyslab.platform.outbound.protocol.outboundserver.requests.RequestLoadCampaign create() { /* compiled code */ }

    public static com.genesyslab.platform.outbound.protocol.outboundserver.requests.RequestLoadCampaign create(java.lang.Integer campaignId, java.lang.Integer groupId, java.lang.Integer sessionId, com.genesyslab.platform.commons.collections.KeyValueCollection requestProperties) { /* compiled code */ }

    public abstract java.lang.Integer getReferenceId();

    public abstract void setReferenceId(java.lang.Integer integer);

    public abstract void setReferenceId(int i);

    public abstract java.lang.Integer getCampaignId();

    public abstract void setCampaignId(java.lang.Integer integer);

    public abstract void setCampaignId(int i);

    public abstract java.lang.Integer getGroupId();

    public abstract void setGroupId(java.lang.Integer integer);

    public abstract void setGroupId(int i);

    public abstract java.lang.Integer getSessionId();

    public abstract void setSessionId(java.lang.Integer integer);

    public abstract void setSessionId(int i);

    public abstract com.genesyslab.platform.commons.collections.KeyValueCollection getRequestProperties();

    public abstract void setRequestProperties(com.genesyslab.platform.commons.collections.KeyValueCollection keyValueCollection);

    private static class Data extends com.genesyslab.platform.outbound.protocol.outboundserver.requests.RequestLoadCampaign implements com.genesyslab.platform.commons.protocol.runtime.DataSupport, com.genesyslab.platform.commons.protocol.EndpointSupport, com.genesyslab.platform.commons.protocol.runtime.UpdatableProtocolId, com.genesyslab.platform.commons.protocol.Referenceable {
        private static java.util.Map compoundData;
        private static java.util.Map attrDescriptions;
        private static java.util.Map tagMapping;
        private static com.genesyslab.platform.commons.protocol.runtime.MetaData metaData;
        private java.util.Map attributes;
        private java.util.Map compounds;
        private final com.genesyslab.platform.commons.protocol.runtime.CodecLazyParser lazyParser;
        private com.genesyslab.platform.commons.protocol.Endpoint endpoint;
        private int protocolId;
        private java.util.List packagers;

        private Data() { /* compiled code */ }

        public com.genesyslab.platform.commons.protocol.Endpoint getEndpoint() { /* compiled code */ }

        public void setEndpoint(com.genesyslab.platform.commons.protocol.Endpoint endpoint) { /* compiled code */ }

        public void setProtocolId(int id) { /* compiled code */ }

        public int getProtocolId() { /* compiled code */ }

        public java.lang.Object getMessageAttribute(java.lang.String index) { /* compiled code */ }

        public com.genesyslab.platform.commons.protocol.runtime.MetaData getMetaData() { /* compiled code */ }

        public java.util.Map attributes() { /* compiled code */ }

        public java.util.Map getCompounds() { /* compiled code */ }

        public com.genesyslab.platform.commons.protocol.runtime.DataSupport createClone(com.genesyslab.platform.commons.protocol.runtime.DataSupport sample) { /* compiled code */ }

        public java.util.List getCustomPackagers() { /* compiled code */ }

        public com.genesyslab.platform.commons.protocol.runtime.CodecLazyParser getLazyParser() { /* compiled code */ }

        public java.lang.Integer getReferenceId() { /* compiled code */ }

        public void setReferenceId(java.lang.Integer referenceId) { /* compiled code */ }

        public void setReferenceId(int referenceId) { /* compiled code */ }

        public java.lang.Integer getCampaignId() { /* compiled code */ }

        public void setCampaignId(java.lang.Integer campaignId) { /* compiled code */ }

        public void setCampaignId(int campaignId) { /* compiled code */ }

        public java.lang.Integer getGroupId() { /* compiled code */ }

        public void setGroupId(java.lang.Integer groupId) { /* compiled code */ }

        public void setGroupId(int groupId) { /* compiled code */ }

        public java.lang.Integer getSessionId() { /* compiled code */ }

        public void setSessionId(java.lang.Integer sessionId) { /* compiled code */ }

        public void setSessionId(int sessionId) { /* compiled code */ }

        public com.genesyslab.platform.commons.collections.KeyValueCollection getRequestProperties() { /* compiled code */ }

        public void setRequestProperties(com.genesyslab.platform.commons.collections.KeyValueCollection requestProperties) { /* compiled code */ }

        public void updateReference(java.lang.Object reference) { /* compiled code */ }

        public java.lang.Object retreiveReference() { /* compiled code */ }

        public java.lang.String toString(boolean hideAllowed, boolean truncateLargeData) { /* compiled code */ }
    }
}


Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: start campaign
« Reply #5 on: August 29, 2014, 09:44:45 AM »
I still do not understand and see in what part of integration/development is the main problem - as I have asked before - are you able to connect to the OC server? Are you able to send a message in general and consume the event?

Offline K.Palyanichka

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: start campaign
« Reply #6 on: August 29, 2014, 09:58:42 AM »
exactly how to connect I do not know, I find the script, but has no idea how to use it. This applies to the message.

At the momment I'm beginning to learn java.

I will be very grateful if you give a short lesson with an example run a specific campaign in steps.

I think that this mini-training will be very useful for all residents

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: start campaign
« Reply #7 on: August 29, 2014, 12:05:13 PM »
Option 1:
First you need to connect to TServer (PSDK guide has working samples and forum does too) then you send commands via OCS API (OCS Deployment, Reference guide|Samples everywhere on forum).


Offline K.Palyanichka

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: start campaign
« Reply #8 on: September 04, 2014, 04:48:03 AM »
Good morning.
could you give me an example of a simple code that will serve as the connection to the server.
At the momment my acquaintance with java is just beginning, but the problem must vyplnyat.

Here is an example of how I tried to bridge the OCS, but alas I have failed.

package pack;


import java.net.URISyntaxException;

import com.genesyslab.platform.commons.protocol.Endpoint;
import com.genesyslab.platform.commons.protocol.ProtocolException;
import com.genesyslab.platform.commons.protocol.RegistrationException;
import com.genesyslab.platform.configuration.protocol.ConfServerProtocol;
import com.genesyslab.platform.configuration.protocol.types.CfgAppType;
import com.genesyslab.platform.outbound.protocol.outboundserver.requests.RequestStartDialing;

public class OutboundServerProtocol {
    public static void main(String[] args) throws RegistrationException, ProtocolException, IllegalStateException, InterruptedException, URISyntaxException {
        Endpoint cfgServerEndpoint = new Endpoint("cfg_proxy", "eostvgen11", 2020);
        ConfServerProtocol protocol = new ConfServerProtocol(cfgServerEndpoint);
        protocol.setClientName("cfg_proxy");
        protocol.open();
        RequestStartDialing req = RequestStartDialing.creare();
        req.setCampaignId(113);
        req.setGroupId(135);
        protocol.close();
    }

}

Proceeding from this, I'm asking you a simple example of code. If possible, with little description.
« Last Edit: September 04, 2014, 04:52:23 AM by K.Palyanichka »

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: start campaign
« Reply #9 on: September 04, 2014, 02:02:38 PM »
There are samples given on the help files of the PSDK, why would we copy/paste the same thing??
Read the help files please, all is there.

Offline K.Palyanichka

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: start campaign
« Reply #10 on: September 26, 2014, 12:49:56 PM »
Thank you.

I have everything worked out

Offline K.Palyanichka

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: start campaign
« Reply #11 on: September 29, 2014, 12:34:12 PM »
Good afternoon.
Help please.
When you try to execute this code produces an error

package snippet;

import javax.swing.*;

import java.awt.*;
import java.awt.event.*;
import java.beans.EventHandler;
import java.lang.reflect.InvocationTargetException;

import com.genesyslab.platform.commons.protocol.Endpoint;
import com.genesyslab.platform.commons.protocol.ProtocolException;
import com.genesyslab.platform.commons.protocol.RegistrationException;
import com.genesyslab.platform.outbound.protocol.OutboundServerProtocol;
import com.genesyslab.platform.outbound.protocol.outbounddesktop.UpdateCallCompletionStats;
import com.genesyslab.platform.outbound.protocol.outboundserver.requests.RequestLoadCampaign;
import com.genesyslab.platform.outbound.protocol.outboundserver.requests.RequestStartDialing;
import com.genesyslab.platform.outbound.protocol.outboundserver.requests.RequestUnloadCampaign;

public class T1 extends JFrame {

    private JButton b1, b2,b3, b4 ;
    public int x ;
  public  int  y;
    private eHandler handler = new eHandler();

    public T1(String s){
        super(s);
        setLayout(new FlowLayout());
        b1 = new JButton("Kiev Diler");
        b2 = new JButton("Kiev Diler 2");
        b3 = new JButton("Kiev Diler 1  ");
        b4 = new JButton("Вывод переменной Y ");

        add(b1);
        add(b2);
        add(b3);
        //add(b4);

        b1.addActionListener(handler);
        b2.addActionListener(handler);
        b3.addActionListener(handler);
        b4.addActionListener(handler);}
 


    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

class eHandler implements ActionListener {
       
        private Outbound outbound = new Outbound();

        public void actionPerformed(ActionEvent e) {
            try {
                if (e.getSource() ==b1 ){
                    x =135;
                    y=149;
                    JOptionPane.showMessageDialog(null, "Kiev Diler Load " + x + " " + y);
                }
                if (e.getSource() ==b2 ){
                    x= 147;
                    y= 169;
                    JOptionPane.showMessageDialog(null, "Kiev Diler 2 Load " + x + " " + y);
                }
                if (e.getSource() ==b3 ){
                    x=146;
                    y=168;
                    JOptionPane.showMessageDialog(null, "Kiev Diler 1 Load " + x + " " + y);
                }
                outbound.Outb(new int[]{x, y});
            } catch (Exception ex){
                JOptionPane.showMessageDialog(null, "Ошибка ");
            }           
        }
    }

    class Outbound {
    public void Outb (int [] args) throws RegistrationException, ProtocolException, IllegalStateException, InterruptedException{
    Endpoint outboundserverEndpoint = new Endpoint ("default", "eostvgen14", 7060);
    OutboundServerProtocol outboundserverProtocol = new OutboundServerProtocol(outboundserverEndpoint);
    outboundserverProtocol.open();
   
   
    /*RequestLoadCampaign req = RequestLoadCampaign.create();
    req.setCampaignId(args[0]);
    req.setGroupId(args[1]);
    req.setReferenceId(0);
    outboundserverProtocol.send(req);*/
   
    RequestStartDialing req1 = RequestStartDialing.create();
    req1.setCampaignId(args[0]);
    req1.setGroupId(args[1]);
    req1.setReferenceId(0);
    req1.setDialMode(1);
    req1.setOptimizeBy(1);
    req1.setOptimizeGoal(80)  ;
   
   
   
    outboundserverProtocol.send(req1);
   
   
        outboundserverProtocol.close();
    }
    }
   
 
    public static void main(String[] args) throws InvocationTargetException, InterruptedException{
             
    EventQueue.invokeLater(new Runnable() {
   
   
            @Override
            public void run() {
                T1 t1 = new T1("LoadCampaign");
                t1.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
                t1.pack();
                t1.setVisible(true);
            }
        });
   
   
    }

}


Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problems:
The method setDialMode(DialMode) in the type RequestStartDialing is not applicable for the arguments (String)
The method setOptimizeBy(OptimizationMethod) in the type RequestStartDialing is not applicable for the arguments (int)

at snippet.T1$Outbound.Outb(T1.java:99)
at snippet.T1$eHandler.actionPerformed(T1.java:75)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Offline Timur Karimov

  • Sr. Member
  • ****
  • Posts: 415
  • Karma: 2
Re: start campaign
« Reply #12 on: October 02, 2014, 05:13:49 AM »
Hi Konstantin
You just need more carefully read the specification of called function. You use a simple string and numbers as DialMode and OptimizationMethod type. However is not an auto conversion method. You need to use existing type enum like DialMode.Predict and OptimizationMethod.NoOptimizationMethod
WBR Tim