com.voximplant.sdk.call

Interface ICall



  • public interface ICall
    Interface that may be used for call operations like answer, reject, hang up and mid-call operations like hold, start/stop video and others.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void addCallListener(ICallListener listener)
      Add ICallListener listener to handle call events.
      void answer(java.util.Map<java.lang.String,java.lang.String> headers)
      Answer the call.
      long getCallDuration()
      Get the call duration
      java.lang.String getCallId()
      Get the call id.
      CallStatistic getCallStatistic()
      Get the call statistics
      java.util.List<IEndpoint> getEndpoints()
      Get list of the endpoints associated with the call.
      void hangup(java.util.Map<java.lang.String,java.lang.String> headers)
      Hang up the call.
      void hold(boolean enable, ICallCompletionHandler handler)
      Hold or unhold the call
      boolean isVideoEnabled()
      Check if video is enabled in the call.
      void reject(java.util.Map<java.lang.String,java.lang.String> headers)
      Reject the call.
      void removeCallListener(ICallListener listener)
      Remove previously added ICallListener
      void sendAudio(boolean enable)
      Enables or disables audio transfer from microphone into the call.
      void sendDTMF(java.lang.String tone)
      Send DTMF in the call
      void sendInfo(java.lang.String mimeType, java.lang.String content, java.util.Map<java.lang.String,java.lang.String> headers)
      Send INFO message within the call
      void sendMessage(java.lang.String text)
      Send message within the call.
      void sendVideo(boolean enable, ICallCompletionHandler handler)
      Start or stop sending video for the call
      void start(java.util.Map<java.lang.String,java.lang.String> headers)
      Start the call.
    • Method Detail

      • addCallListener

        void addCallListener(ICallListener listener)
        Add ICallListener listener to handle call events.
        Parameters:
        listener - ICallListener listener
      • removeCallListener

        void removeCallListener(ICallListener listener)
        Remove previously added ICallListener
        Parameters:
        listener - ICallListener listener
      • getCallId

        java.lang.String getCallId()
        Get the call id.
        Returns:
        The call id
      • getEndpoints

        java.util.List<IEndpoint> getEndpoints()
        Get list of the endpoints associated with the call.
        Returns:
        List of the endpoints associated with the call
      • isVideoEnabled

        boolean isVideoEnabled()
        Check if video is enabled in the call.
        Returns:
        True if video is enabled, false otherwise
      • start

        void start(java.util.Map<java.lang.String,java.lang.String> headers)
        Start the call.
        Parameters:
        headers - Optional set of headers to be sent to VoxImplant Cloud. Names must begin with "X-" to be processed by SDK
      • answer

        void answer(java.util.Map<java.lang.String,java.lang.String> headers) throws CallException
        Answer the call. Should be used only for incoming call.
        Parameters:
        headers - Optional set of headers to be sent to VoxImplant Cloud. Names must begin with "X-" to be processed by SDK
        Throws:
        CallException - exception
      • reject

        void reject(java.util.Map<java.lang.String,java.lang.String> headers) throws CallException
        Reject the call. Should be used only for incoming call.
        Parameters:
        headers - Optional set of headers to be sent to VoxImplant Cloud. Names must begin with "X-" to be processed by SDK
        Throws:
        CallException - exception
      • hangup

        void hangup(java.util.Map<java.lang.String,java.lang.String> headers)
        Hang up the call.
        Parameters:
        headers - Optional set of headers to be sent to VoxImplant Cloud. Names must begin with "X-" to be processed by SDK
      • sendAudio

        void sendAudio(boolean enable)
        Enables or disables audio transfer from microphone into the call.
        Parameters:
        enable - True if audio should be sent, false otherwise
      • sendVideo

        void sendVideo(boolean enable, ICallCompletionHandler handler)
        Start or stop sending video for the call
        Parameters:
        enable - True if video should be sent, false otherwise
        handler - Object to receive the result of this operation
      • hold

        void hold(boolean enable, ICallCompletionHandler handler)
        Hold or unhold the call
        Parameters:
        enable - True if the call should be put on hold, false for unhold
        handler - Object to receive the result of this operation
      • sendDTMF

        void sendDTMF(java.lang.String tone)
        Send DTMF in the call
        Parameters:
        tone - DTMFs
      • sendInfo

        void sendInfo(java.lang.String mimeType, java.lang.String content, java.util.Map<java.lang.String,java.lang.String> headers)
        Send INFO message within the call
        Parameters:
        mimeType - MIME type of info
        content - Custom string data
        headers - Optional set of headers to be sent with message. Names must begin with "X-" to be processed by SDK
      • sendMessage

        void sendMessage(java.lang.String text)
        Send message within the call. Implemented atop SIP INFO for communication between call endpoint and Voximplant cloud, and is separated from Voximplant messaging API.
        Parameters:
        text - Message text
      • getCallDuration

        long getCallDuration()
        Get the call duration
        Returns:
        the call duration in milliseconds
      • getCallStatistic

        CallStatistic getCallStatistic()
        Get the call statistics
        Returns:
        CallStatistic instance