Package org.freeswitch.esl.client.inbound

Examples of org.freeswitch.esl.client.inbound.Client


    }

    @Test
    public void do_multi_connects() throws InterruptedException
    {
        Client client = new Client();
       
        log.info( "Client connecting .." );
        try
        {
            client.connect( host, port, password, 2 );
        }
        catch ( InboundConnectionFailure e )
        {
            log.error( "Connect failed", e );
            return;
        }
        log.info( "Client connected .." );
       
        log.info( "Client connecting .." );
        try
        {
            client.connect( host, port, password, 2 );
        }
        catch ( InboundConnectionFailure e )
        {
            log.error( "Connect failed", e );
            return;
        }
        log.info( "Client connected .." );
       
        client.close();
    }
View Full Code Here


    }
   
    @Test
    public void sofia_contact()
    {
        Client client = new Client();
        try
        {
            client.connect( host, port, password, 2 );
        }
        catch ( InboundConnectionFailure e )
        {
            log.error( "Connect failed", e );
            return;
        }
       
        EslMessage response = client.sendSyncApiCommand( "sofia_contact", "internal/102@192.168.100.201" );

        log.info( "Response to 'sofia_contact': [{}]", response );
        for ( Entry<Name, String> header : response.getHeaders().entrySet() )
        {
            log.info( " * header [{}]", header );
        }
        for ( String bodyLine : response.getBodyLines() )
        {
            log.info( " * body [{}]", bodyLine );
        }
        client.close();
    }
View Full Code Here

    private ConferenceEventListener conferenceEventListener;
    private ESLEventListener eslEventListener;
   
    private void connect() {
      try {
        Client c = manager.getESLClient();
        if (! c.canSend()) {
        log.info("Attempting to connect to FreeSWITCH ESL");
          subscribed = false;
          manager.connect();
        } else {
          if (!subscribed) {
            log.info("Subscribing for ESL events.");
                  c.cancelEventSubscriptions();
                  c.addEventListener(eslEventListener);
                  c.setEventSubscriptions( "plain", "all" );
                  c.addEventFilter( EVENT_NAME, "heartbeat" );
                  c.addEventFilter( EVENT_NAME, "custom" );
                  c.addEventFilter( EVENT_NAME, "background_job" );
                  subscribed = true;
          }
        }       
    } catch (InboundConnectionFailure e) {
      System.out.println("Failed to connect to ESL");
View Full Code Here

    }
  }
 
 
  public void broadcast(BroadcastConferenceCommand rcc) {
    Client c = manager.getESLClient();
    if (c.canSend()) {
        EslMessage response = c.sendSyncApiCommand(rcc.getCommand(), rcc.getCommandArgs());
          rcc.handleResponse(response, conferenceEventListener);  
    }
  }
View Full Code Here

          rcc.handleResponse(response, conferenceEventListener);  
    }
  }
 
  public void getUsers(PopulateRoomCommand prc) {
    Client c = manager.getESLClient();
    if (c.canSend()) {
          EslMessage response = c.sendSyncApiCommand(prc.getCommand(), prc.getCommandArgs());
          prc.handleResponse(response, conferenceEventListener);      
    }
  }
View Full Code Here

    }
  }
 
  public void mute(MuteParticipantCommand mpc) {
    System.out.println("Got mute request from FSApplication.");
    Client c = manager.getESLClient();
    if (c.canSend()) {
      System.out.println("Issuing command to FS ESL.");
          c.sendAsyncApiCommand( mpc.getCommand(), mpc.getCommandArgs());     
    }
  }
View Full Code Here

          c.sendAsyncApiCommand( mpc.getCommand(), mpc.getCommandArgs());     
    }
  }
 
  public void eject(EjectParticipantCommand mpc) {
    Client c = manager.getESLClient();
    if (c.canSend()) {
      c.sendAsyncApiCommand( mpc.getCommand(), mpc.getCommandArgs());
    }      
  }
View Full Code Here

      c.sendAsyncApiCommand( mpc.getCommand(), mpc.getCommandArgs());
    }      
  }
 
  public void ejectAll(EjectAllUsersCommand mpc) {
    Client c = manager.getESLClient();
    if (c.canSend()) {
          c.sendAsyncApiCommand( mpc.getCommand(), mpc.getCommandArgs())
    }
  }
View Full Code Here

          c.sendAsyncApiCommand( mpc.getCommand(), mpc.getCommandArgs())
    }
  }
 
  public void record(RecordConferenceCommand rcc) {
    Client c = manager.getESLClient();
    if (c.canSend()) {
        EslMessage response = c.sendSyncApiCommand(rcc.getCommand(), rcc.getCommandArgs());
          rcc.handleResponse(response, conferenceEventListener);      
    }
  }
View Full Code Here

    private Client client;
    private HeartbeatThread hbThread;
   
    public void do_connect() throws InterruptedException
    {
        client = new Client();
        client.addEventListener( new EslEventListener() );

        log.info( "Client connecting .." );
        try
        {
View Full Code Here

TOP

Related Classes of org.freeswitch.esl.client.inbound.Client

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.