Introduction to the event flow of video call conference on Android platform

Range

adopt Interpretation of RFC4575 protocol In this paper, we understand that the conference status information is notified to the mobile terminal through the NOTIFY message, usually in the format of xml. Chip manufacturers have implemented this part of functions when providing the source code. This paper mainly introduces the event reporting process of conference call based on Android AOSP platform.

content

Because the chip manufacturer has implemented the status message content parsing function of conference call, this part of code is usually included in the private APK. This paper mainly introduces how the chip manufacturer's APK reports this part of information through the Android public interface.

How to report conference information to APK

Chip manufacturers implement the parsing function in their own private apk. After the parsing is completed, they report through the Android public interface. On the Android platform, we focus on the following categories:

  1. ImsConferenceState.java
  2. ImsCallSessionListener.java
  3. ImsCallSession.java
  4. ImsCall.java

After parsing the even t content of the conference, the chip manufacturer's private apk is encapsulated as an ImsConferenceState object. Let's see how ImsConferenceState.java is defined.

public final class ImsConferenceState implements Parcelable {
    /**
     * conference-info : user
     */
    // user (String) : Tel or SIP URI
    public static final String USER = "user";
    // user > display text (String)
    public static final String DISPLAY_TEXT = "display-text";
    // user > endpoint (String) : URI or GRUU or Phone number
    public static final String DISPLAY_TEXT= "endpoint";
    // user > endpoint > status
    public static final String STATUS = "status";

ImsConferenceState defines four contents that we need to pay attention to, namely USER, display text, display text and STATUS, which correspond to the USER node and the contents of several sub nodes. From here, we can see that the android native platform does not support obtaining the · media state of conference members.
After the ImsConferenceState object is built, it will notify the listener that the current conference state has been updated. Please refer to the callSessionConferenceStateUpdated method. Finally, in the notifyConferenceStateUpdated method of imsacall, we can see the following:

 private void notifyConferenceStateUpdated(ImsConferenceState state) {
        if (state == null || state.mParticipants == null) {
            return;
        }

        Set<Entry<String, Bundle>> participants = state.mParticipants.entrySet();

        if (participants == null) {
            return;
        }

        Iterator<Entry<String, Bundle>> iterator = participants.iterator();
        mConferenceParticipants = new ArrayList<>(participants.size());
        while (iterator.hasNext()) {
            Entry<String, Bundle> entry = iterator.next();

            String key = entry.getKey();
            Bundle confInfo = entry.getValue();
            String status = confInfo.getString(ImsConferenceState.STATUS);
            String user = confInfo.getString(ImsConferenceState.USER);
            String displayName = confInfo.getString(ImsConferenceState.DISPLAY_TEXT);
            String endpoint = confInfo.getString(ImsConferenceState.ENDPOINT);

            if (CONF_DBG) {
                logi("notifyConferenceStateUpdated :: key=" + Rlog.pii(TAG, key) +
                        ", status=" + status +
                        ", user=" + Rlog.pii(TAG, user) +
                        ", displayName= " + Rlog.pii(TAG, displayName) +
                        ", endpoint=" + endpoint);
            }

            Uri handle = Uri.parse(user);
            if (endpoint == null) {
                endpoint = "";
            }
            Uri endpointUri = Uri.parse(endpoint);
            int connectionState = ImsConferenceState.getConnectionStateForStatus(status);

            if (connectionState != Connection.STATE_DISCONNECTED) {
                ConferenceParticipant conferenceParticipant = new ConferenceParticipant(handle,
                        displayName, endpointUri, connectionState);
                mConferenceParticipants.add(conferenceParticipant);
            }
        }

        if (mConferenceParticipants != null && mListener != null) {
            try {
                mListener.onConferenceParticipantsStateChanged(this, mConferenceParticipants);
            } catch (Throwable t) {
                loge("notifyConferenceStateUpdated :: ", t);
            }
        }
    }

Here we see that Android will create a conference participant object according to the content in ImsConferenceState, which is the conference member object of Android, and then continue to report the status information through onConferenceParticipantsStateChanged. Finally, in TeleService and Telecom, corresponding objects will be created according to the status. For applications, each will The discussion members are an android.telecom.Call object. Judge whether it is a video through the videostate. However, from the above analysis process, we can't get the media (video) status of each meeting member last time.

Published 6 original articles, won praise 3, visited 5890
Private letter follow

Keywords: Android Java Mobile xml

Added by Stille on Sun, 16 Feb 2020 10:17:22 +0200