public final class

MultimediaSessionService

extends RcsService
java.lang.Object
   ↳ com.gsma.services.rcs.RcsService
     ↳ com.gsma.services.rcs.extension.MultimediaSessionService

Class Overview

This class offers the main entry point to initiate and to manage multimedia sessions. Several applications may connect/disconnect to the API.

Summary

[Expand]
Inherited Constants
From class com.gsma.services.rcs.RcsService
Public Constructors
MultimediaSessionService(Context ctx, RcsServiceListener listener)
Constructor
Public Methods
void addEventListener(MultimediaStreamingSessionListener listener)
Adds a listener on multimedia streaming session events
void addEventListener(MultimediaMessagingSessionListener listener)
Adds a listener on multimedia messaging session events
final void connect()
Connects to the API
void disconnect()
Disconnects from the API
MultimediaSessionServiceConfiguration getConfiguration()
Returns the configuration of the multimedia session service
MultimediaMessagingSession getMessagingSession(String sessionId)
Returns a current messaging session from its unique session ID
Set<MultimediaMessagingSession> getMessagingSessions(String serviceId)
Returns the list of messaging sessions associated to a given service ID
MultimediaStreamingSession getStreamingSession(String sessionId)
Returns a current streaming session from its unique session ID
Set<MultimediaStreamingSession> getStreamingSessions(String serviceId)
Returns the list of streaming sessions associated to a given service ID
MultimediaMessagingSession initiateMessagingSession(String serviceId, ContactId contact, String[] acceptTypes, String[] acceptWrappedTypes)
Initiates a new session for real time messaging with a remote contact and for a given service extension.
MultimediaMessagingSession initiateMessagingSession(String serviceId, ContactId contact)
Initiates a new session for real time messaging with a remote contact and for a given service extension.
MultimediaStreamingSession initiateStreamingSession(String serviceId, ContactId contact)
This method is deprecated. Use initiateStreamingSession(String, ContactId, String) instead.
MultimediaStreamingSession initiateStreamingSession(String serviceId, ContactId contact, String encoding)
Initiates a new session for real time streaming with a remote contact for a given service extension and encoding (ie.
void removeEventListener(MultimediaMessagingSessionListener listener)
Removes a listener on multimedia messaging session events
void removeEventListener(MultimediaStreamingSessionListener listener)
Removes a listener on multimedia streaming session events
void sendInstantMultimediaMessage(String serviceId, ContactId contact, byte[] content, String contentType)
Sends an instant multimedia message to a remote contact and for a given service extension.
[Expand]
Inherited Methods
From class com.gsma.services.rcs.RcsService
From class java.lang.Object

Public Constructors

public MultimediaSessionService (Context ctx, RcsServiceListener listener)

Since: API Level 1.5

Constructor

Parameters
ctx Application context
listener Service listener

Public Methods

public void addEventListener (MultimediaStreamingSessionListener listener)

Since: API Level 1.5

Adds a listener on multimedia streaming session events

Parameters
listener Session event listener
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public void addEventListener (MultimediaMessagingSessionListener listener)

Since: API Level 1.5

Adds a listener on multimedia messaging session events

Parameters
listener Session event listener
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public final void connect ()

Since: API Level 1.5

Connects to the API

public void disconnect ()

Since: API Level 1.5

Disconnects from the API

public MultimediaSessionServiceConfiguration getConfiguration ()

Since: API Level 1.5

Returns the configuration of the multimedia session service

Returns
  • MultimediaSessionServiceConfiguration
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public MultimediaMessagingSession getMessagingSession (String sessionId)

Since: API Level 1.5

Returns a current messaging session from its unique session ID

Parameters
sessionId the session ID
Returns
  • MultimediaMessagingSession Multimedia messaging session or null if not found
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public Set<MultimediaMessagingSession> getMessagingSessions (String serviceId)

Since: API Level 1.5

Returns the list of messaging sessions associated to a given service ID

Parameters
serviceId Service ID
Returns
  • Set<MultimediaMessagingSession> List of messaging sessions
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public MultimediaStreamingSession getStreamingSession (String sessionId)

Since: API Level 1.5

Returns a current streaming session from its unique session ID

Parameters
sessionId the session ID
Returns
  • MultimediaStreamingSession Multimedia streaming session or null if not found
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public Set<MultimediaStreamingSession> getStreamingSessions (String serviceId)

Since: API Level 1.5

Returns the list of streaming sessions associated to a given service ID

Parameters
serviceId Service ID
Returns
  • Set<MultimediaStreamingSession> List of streaming sessions
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public MultimediaMessagingSession initiateMessagingSession (String serviceId, ContactId contact, String[] acceptTypes, String[] acceptWrappedTypes)

Since: API Level 1.6

Initiates a new session for real time messaging with a remote contact and for a given service extension. The messages exchanged in real time during the session are specified by parameters accept-types and accept-wrapped-types. The parameter contact supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI. If the format of the contact is not supported an exception is thrown.

Parameters
serviceId Service ID
contact Contact identifier
acceptTypes Accept-types related to exchanged messages (may be null or empty)
acceptWrappedTypes Accept-wrapped-types related to exchanged messages (may be null or empty)
Returns
  • MultimediaMessagingSession
Throws
RcsServiceNotRegisteredException
RcsPermissionDeniedException
RcsServiceNotAvailableException
RcsGenericException
RcsPermissionDeniedException
RcsServiceNotAvailableException
RcsServiceNotRegisteredException

public MultimediaMessagingSession initiateMessagingSession (String serviceId, ContactId contact)

Since: API Level 1.5

Initiates a new session for real time messaging with a remote contact and for a given service extension. The messages are exchanged in real time during the session may be from any type. The parameter contact supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI. If the format of the contact is not supported an exception is thrown.

Parameters
serviceId Service ID
contact Contact identifier
Returns
  • MultimediaMessagingSession
Throws
RcsServiceNotRegisteredException
RcsPermissionDeniedException
RcsServiceNotAvailableException
RcsGenericException
RcsPermissionDeniedException
RcsServiceNotAvailableException
RcsServiceNotRegisteredException

public MultimediaStreamingSession initiateStreamingSession (String serviceId, ContactId contact)

Since: API Level 1.5

This method is deprecated.
Use initiateStreamingSession(String, ContactId, String) instead.

Initiates a new session for real time streaming with a remote contact and for a given service extension. The payload are exchanged in real time during the session and may be from any type. The parameter contact supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI. If the format of the contact is not supported an exception is thrown.

Parameters
serviceId Service ID
contact Contact ID
Returns
  • MultimediaStreamingSession
Throws
RcsServiceNotRegisteredException
RcsPermissionDeniedException
RcsServiceNotAvailableException
RcsGenericException
RcsPermissionDeniedException
RcsServiceNotAvailableException
RcsServiceNotRegisteredException

public MultimediaStreamingSession initiateStreamingSession (String serviceId, ContactId contact, String encoding)

Since: API Level 1.6

Initiates a new session for real time streaming with a remote contact for a given service extension and encoding (ie. rtpmap format containing / and optional parameters if needed. The payload are exchanged in real time during the session and may be from any type. The parameter contact supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI. If the format of the contact is not supported an exception is thrown.

Parameters
serviceId Service ID
contact Contact ID
encoding Encoding payload format
Returns
  • MultimediaStreamingSession
Throws
RcsServiceNotRegisteredException
RcsPermissionDeniedException
RcsServiceNotAvailableException
RcsGenericException
RcsPermissionDeniedException
RcsServiceNotAvailableException
RcsServiceNotRegisteredException

public void removeEventListener (MultimediaMessagingSessionListener listener)

Since: API Level 1.5

Removes a listener on multimedia messaging session events

Parameters
listener Session event listener
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public void removeEventListener (MultimediaStreamingSessionListener listener)

Since: API Level 1.5

Removes a listener on multimedia streaming session events

Parameters
listener Session event listener
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public void sendInstantMultimediaMessage (String serviceId, ContactId contact, byte[] content, String contentType)

Since: API Level 1.6

Sends an instant multimedia message to a remote contact and for a given service extension. The content takes part of the message, so any multimedia session is needed to exchange content here. The parameter contact supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI. If the format of the contact is not supported an exception is thrown.

Parameters
serviceId Service ID
contact Contact identifier
content Content of the message
contentType Content type of the the message
Throws
RcsServiceNotRegisteredException
RcsPermissionDeniedException
RcsServiceNotAvailableException
RcsGenericException
RcsPermissionDeniedException
RcsServiceNotAvailableException
RcsServiceNotRegisteredException