Author Topic: Chat Desktop - Help  (Read 722 times)

Offline persmen

  • Newbie
  • *
  • Posts: 18
  • Karma: 1
  • Kemal KUCUKTASCI
Chat Desktop - Help
« on: August 20, 2010, 05:55:27 PM »
Hi;

    I'm using Platform SDK for development and im new for this SDK. I need some information about chat desktop development. I wrote some code, and test Connection, login, ready and invite. Everythings fine in ccpulse and log files. But desktop cannot take any event. EventAgentLogin or EventInvite. I think, i'm doing right thing explained in documents. But i dont understand what is problem.

    In application i'm craete a QueueMessageReceiver receiver;
                            create a BrokerServicefactory.CreateEventBrokerService(receiver);
                            create an InteractionServerProtocol(receiver)
                            craete a BasicChatProtocol(receiver)

    also i have some handler for event and request management. My BaseClass implements Subscriber<Message>
                           BaseClass include getFilter method

    All handler contains self success and failure filter.

    Can you help what i'm doing wrong. I'm wait the eventBroker must be invoke events like EventAgentLogin, EventAgentReady or EventInvite.

    Some small sample for my codes ;

Platform manager class

        private QueueMessageReceiver receiver=new QueueMessageReceiver(1024, true);
        .........
        private void initializeChatServerProtocol(QueueMessageReceiver receiver) throws URISyntaxException{
                String userNick=getNickname();
                URI serveruri=new URI("tcp://"+mcrChatServer+":"+String.valueOf(mcrChatPort));
                chatProtocol=new BasicChatProtocol(new Endpoint(serveruri));
                chatProtocol.setUserNickname(userNick);
                chatProtocol.setReceiver(receiver);
                chatProtocol.setUserType(UserType.Agent);
                chatProtocol.setPersonId(getAgentId());
        }


        private void initializeInteractionServerProtocol(QueueMessageReceiver receiver) throws URISyntaxException{
                URI serveruri=new URI("tcp://"+mcrInteractionServer+":"+String.valueOf(mcrInteractionPort));
                isProtocol=new InteractionServerProtocol(new Endpoint(serveruri));
                isProtocol.setReceiver(receiver);
                isProtocol.setClientName("CCDesktop");
                isProtocol.setClientType(InteractionClient.AgentApplication);
        }

        private void initializeEventBrokerService(QueueMessageReceiver receiver){
                if (eventBroker==null){
                        eventBroker= BrokerServiceFactory.CreateEventBroker(receiver);
                }
        }

        private void initialize() throws URISyntaxException, ProtocolException, IllegalStateException, InterruptedException{
                initializeChatServerProtocol(receiver);
                initializeInteractionServerProtocol(receiver);
                initializeEventBrokerService(receiver);
                ......
                eventBroker.register(new RequestAgenrtLogin(protocol));
                eventBroker.register(new OpenMediaInviteAction(protocol));
                ......
        }


My base action class

        public class BaseCTIAction implements Subscriber<Message> {
        ......
        public Predicate<Message> getFilter(){
                if ((successFilter!=null)&&(failureFilter!=null)){
                        return new OrPredicate(successFilter, failureFilter);
                }
                if (successFilter!=null){
                        return successFilter;
                }
                if (failureFilter!=null){
                        return failureFilter;
                }
                return null;
        }
        @Override
        public void handle(Message message) {
                if (successFilter==null || message==null)
                        return;
                event=message;
                if (successFilter.invoke(event)){
                        HandleSuccess(event);
                }
                else{
                        HandleFailure(event);
                }
        }
        public void Execute(){
                if(request==null){
                        throw new InvalidActivityException("Request must be set for this action.");
                }
                Message msg=protocol.request(request);
                handle(msg);
        }
        }


My sample Requestlogin action

        public class OpenMediaLoginAction extends BaseCTIAction {

                RequestAgentLogin reqagentlogin;

                private Predicate<Message> getOpenMediaLoginFilter(){
                        return new OrPredicate<Message>(new MessageIdFilter(EventAck.ID), new MessageIdFilter(EventAgentLogin.ID));
                }
   
        public OpenMediaLoginAction(Protocol protocol, int tenantid, String placeid, String agentid) {
                super(protocol);
                super.setSuccessFilter(getOpenMediaLoginFilter());
                super.setFailureFilter(new MessageIdFilter(EventError.ID));

                reqagentlogin=RequestAgentLogin.create(tenantid, placeid, null);
      
                reqagentlogin.setAgentId(agentid);
                reqagentlogin.setMediaList(new KeyValueCollection());
                reqagentlogin.getMediaList().addInt("chat", 1);
               
                super.setRequest(reqagentlogin);
   }
}


My sample Invite action class

     public class OpenMediaInviteAction extends BaseCTIAction {

          public OpenMediaInviteAction(Protocol protocol) {
               super(protocol);
               super.setSuccessFilter(new MessageIdFilter(EventInvite.ID)); //127
               super.setFailureFilter(new MessageIdFilter(EventError.ID));
          }
     }

   
Kemal KÜÇÜKTAŞÇI
YapıKredi A.Ş. Information Technology
Project Engineer

Offline backup

  • Newbie
  • *
  • Posts: 11
  • Karma: -3
Re: Chat Desktop - Help
« Reply #1 on: October 13, 2010, 04:24:03 PM »
mpg to avi

AVI  is the most frequently used format for video/audio on the PC. Quite commonly, when you download some videos from the internet, you find that they are in the name of "avi." It is also widely supported by various diveces. Therefore, we often need to transfer other formats to avi, such as to convert mpg to avi mac,convert mpeg to avi mac or convert avi to mpg mac to burn to DVDs and for other devices. mpg to avi converter mac,mpeg to avi converter mac (oravi to mpg converter mac)can convert any mpg to avi mac,mpeg to avi mac or avi to mpg mac.  Download mpg to avi converter mac,mpg to avi converter mac and install it. It only require you few steps. Import vdieos.  Select AVI as the output format.  Edit video with mac mpg to avi,mpeg to avi mac converter.   Click “Start” converting mpg to avi mac on Mac OS X. With mac mpg to avi converter you can also edit the video effect, resolution, bite rate and perform other  functions within mpg to avi mac converter such as trimming, cropping, changing effect and so on.
mpg to avi mac
convert mpg to avi mac
mpg to avi mac converter

avi to imovie
avi to apple tv
mpg to avi mac
avi to itunes
mac avi to mp4
avi to quicktime converter
mac avi converter
imovie converter
vob to avi mac