Examples of EslMessage


Examples of org.freeswitch.esl.client.transport.message.EslMessage

        log.info( "Job id [{}] for [status]", jobId );
        client.sendSyncApiCommand( "version", "" );
//        client.sendAsyncApiCommand( "status", "" );
//        client.sendSyncApiCommand( "sofia status", "" );
//        client.sendAsyncApiCommand( "status", "" );
        EslMessage response = client.sendSyncApiCommand( "sofia status", "" );
        log.info( "sofia status = [{}]", response.getBodyLines().get( 3 ) );
       
        // wait to see the heartbeat events arrive
        Thread.sleep( 25000 );
        client.close();
    }
View Full Code Here

Examples of org.freeswitch.esl.client.transport.message.EslMessage

        {
            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

Examples of org.freeswitch.esl.client.transport.message.EslMessage

    @Override
    public void messageReceived( ChannelHandlerContext ctx, MessageEvent e ) throws Exception
    {
        if ( e.getMessage() instanceof EslMessage )
        {
            EslMessage message = (EslMessage)e.getMessage();
            String contentType = message.getContentType();
            if ( contentType.equals( Value.TEXT_EVENT_PLAIN ) ||
                    contentType.equals( Value.TEXT_EVENT_XML ) )
            {
                //  transform into an event
                EslEvent eslEvent = new EslEvent( message );
View Full Code Here

Examples of org.freeswitch.esl.client.transport.message.EslMessage

    {
        /*
         * Send synchronously to get the Job-UUID to return, the results of the actual
         * job request will be returned by the server as an async event.
         */
        EslMessage response = sendSyncSingleLineCommand( channel, command );
        if ( response.hasHeader( Name.JOB_UUID ) )
        {
            return response.getHeaderValue( Name.JOB_UUID );
        }
        else
        {
            throw new IllegalStateException( "Missing Job-UUID header in bgapi response" );
        }
View Full Code Here

Examples of org.freeswitch.esl.client.transport.message.EslMessage

    public void channelConnected( ChannelHandlerContext ctx, ChannelStateEvent e ) throws Exception
    {
        // Have received a connection from FreeSWITCH server, send connect response
        log.debug( "Received new connection from server, sending connect message" );
       
        EslMessage response = sendSyncSingleLineCommand( ctx.getChannel(), "connect" );
        // The message decoder for outbound, treats most of this incoming message as an 'event' in
        // message body, so it parse now
        EslEvent channelDataEvent = new EslEvent( response, true );
        // Let implementing sub classes choose what to do next
        handleConnectResponse( ctx, channelDataEvent );
View Full Code Here

Examples of org.freeswitch.esl.client.transport.message.EslMessage

    {
        SendMsg hangupMsg = new SendMsg();
        hangupMsg.addCallCommand( "execute" );
        hangupMsg.addExecuteAppName( "hangup" );
       
        EslMessage response = sendSyncMultiLineCommand( channel, hangupMsg.getMsgLines() );
       
        if ( response.getHeaderValue( Name.REPLY_TEXT ).startsWith( "+OK" ) )
        {
            log.info( "Call hangup successful" );
        }
        else
        {
            log.error( "Call hangup failed: [{}}", response.getHeaderValue( Name.REPLY_TEXT ) );
        }
    }
View Full Code Here

Examples of org.freeswitch.esl.client.transport.message.EslMessage

 
 
  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

Examples of org.freeswitch.esl.client.transport.message.EslMessage

  }
 
  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

Examples of org.freeswitch.esl.client.transport.message.EslMessage

  }
 
  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

Examples of org.freeswitch.esl.client.transport.message.EslMessage

    }

    protected void handleAuthRequest( ChannelHandlerContext ctx )
    {
        log.debug( "Auth requested, sending [auth {}]", "*****" );
        EslMessage response = sendSyncSingleLineCommand( ctx.getChannel(), "auth " + password );
        log.debug( "Auth response [{}]", response );
        if ( response.getContentType().equals( Value.COMMAND_REPLY ) )
        {
            CommandResponse commandResponse = new CommandResponse( "auth " + password, response );
            listener.authResponseReceived( commandResponse );
        }
        else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.