IT. Expert System.

Android Reference

SipAudioCall


android.net.sip

Class SipAudioCall



  • public class SipAudioCall
    extends Object
    Handles an Internet audio call over SIP. You can instantiate this class with SipManager, using makeAudioCall() and takeAudioCall().

    Note: Using this class require the android.Manifest.permission#INTERNET and android.Manifest.permission#USE_SIP permissions. In addition, startAudio() requires the android.Manifest.permission#RECORD_AUDIO, android.Manifest.permission#ACCESS_WIFI_STATE, and android.Manifest.permission#WAKE_LOCK permissions; and setSpeakerMode() requires the android.Manifest.permission#MODIFY_AUDIO_SETTINGS permission.

    Developer Guides

    For more information about using SIP, read the Session Initiation Protocol developer guide.

    • Constructor Detail

      • SipAudioCall

        public SipAudioCall(Context context,
                    SipProfile localProfile)
        Creates a call object with the local SIP profile.
        Parameters:
        context - the context for accessing system services such as ringtone, audio, WIFI etc
    • Method Detail

      • setListener

        public void setListener(SipAudioCall.Listener listener,
                       boolean callbackImmediately)
        Sets the listener to listen to the audio call events. A SipAudioCall can only hold one listener at a time. Subsequent calls to this method override the previous listener.
        Parameters:
        listener - to listen to the audio call events of this object
        callbackImmediately - set to true if the caller wants to be called back immediately on the current state
      • isInCall

        public boolean isInCall()
        Checks if the call is established.
        Returns:
        true if the call is established
      • isOnHold

        public boolean isOnHold()
        Checks if the call is on hold.
        Returns:
        true if the call is on hold
      • close

        public void close()
        Closes this object. This object is not usable after being closed.
      • getLocalProfile

        public SipProfile getLocalProfile()
        Gets the local SIP profile.
        Returns:
        the local SIP profile
      • getPeerProfile

        public SipProfile getPeerProfile()
        Gets the peer's SIP profile.
        Returns:
        the peer's SIP profile
      • getState

        public int getState()
        Gets the state of the SipSession that carries this call. The value returned must be one of the states in SipSession.State.
        Returns:
        the session state
      • getSipSession

        public SipSession getSipSession()
        Gets the SipSession that carries this call.
        Returns:
        the session object that carries this call
      • attachCall

        public void attachCall(SipSession session,
                      String sessionDescription)
                        throws SipException
        Attaches an incoming call to this call object.
        Parameters:
        session - the session that receives the incoming call
        sessionDescription - the session description of the incoming call
        Throws:
        SipException - if the SIP service fails to attach this object to the session or VOIP API is not supported by the device
        See Also:
        SipManager.isVoipSupported(android.content.Context)
      • endCall

        public void endCall()
                     throws SipException
        Ends a call.
        Throws:
        SipException - if the SIP service fails to end the call
      • toggleMute

        public void toggleMute()
        Toggles mute.
      • isMuted

        public boolean isMuted()
        Checks if the call is muted.
        Returns:
        true if the call is muted
      • setSpeakerMode

        public void setSpeakerMode(boolean speakerMode)
        Puts the device to speaker mode.

        Note: Requires the android.Manifest.permission#MODIFY_AUDIO_SETTINGS permission.

        Parameters:
        speakerMode - set true to enable speaker mode; false to disable
      • sendDtmf

        public void sendDtmf(int code)
        Sends a DTMF code. According to RFC 2883, event 0--9 maps to decimal value 0--9, '*' to 10, '#' to 11, event 'A'--'D' to 12--15, and event flash to 16. Currently, event flash is not supported.
        Parameters:
        code - the DTMF code to send. Value 0 to 15 (inclusive) are valid inputs.
      • sendDtmf

        public void sendDtmf(int code,
                    Message result)
        Sends a DTMF code. According to RFC 2883, event 0--9 maps to decimal value 0--9, '*' to 10, '#' to 11, event 'A'--'D' to 12--15, and event flash to 16. Currently, event flash is not supported.
        Parameters:
        code - the DTMF code to send. Value 0 to 15 (inclusive) are valid inputs.
        result - the result message to send when done
      • getAudioStream

        public AudioStream getAudioStream()
        Gets the AudioStream object used in this call. The object represents the RTP stream that carries the audio data to and from the peer. The object may not be created before the call is established. And it is undefined after the call ends or the close() method is called.
        Returns:
        the AudioStream object or null if the RTP stream has not yet been set up
      • getAudioGroup

        public AudioGroup getAudioGroup()
        Gets the AudioGroup object which the AudioStream object joins. The group object may not exist before the call is established. Also, the AudioStream may change its group during a call (e.g., after the call is held/un-held). Finally, the AudioGroup object returned by this method is undefined after the call ends or the close() method is called. If a group object is set by setAudioGroup(AudioGroup), then this method returns that object.
        Returns:
        the AudioGroup object or null if the RTP stream has not yet been set up
        See Also:
        getAudioStream()
      • setAudioGroup

        public void setAudioGroup(AudioGroup group)
        Sets the AudioGroup object which the AudioStream object joins. If audioGroup is null, then the AudioGroup object will be dynamically created when needed. Note that the mode of the AudioGroup is not changed according to the audio settings (i.e., hold, mute, speaker phone) of this object. This is mainly used to merge multiple SipAudioCall objects to form a conference call. The settings of the first object (that merges others) override others'.
        See Also:
        getAudioStream()
      • startAudio

        public void startAudio()
        Starts the audio for the established call. This method should be called after SipAudioCall.Listener.onCallEstablished(android.net.sip.SipAudioCall) is called.

        Note: Requires the android.Manifest.permission#RECORD_AUDIO, android.Manifest.permission#ACCESS_WIFI_STATE and android.Manifest.permission#WAKE_LOCK permissions.



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 295 / 158777407. Delta: 0.09256 с