Skip to content

ice4j 3.0 cannot support video content-add when initial call starts with audio only #263

@cmeng-git

Description

@cmeng-git

In an audio call only session, adding the video (content-add) is not working.

Please refer to ConnectivityCheckClient.java source:
After an audio call setup is completed, Agent proceeds to execute ConnectivityCheckClient#stop(), setting the flag stopped = true;
When a video content-add is initiated, startChecks() does not proceed due to stopped == true. This is fixed with the following source changed.

    /**
     * Starts client connectivity checks for the first {@link IceMediaStream}
     * in our parent {@link Agent}. This method should only be called by
     * the parent {@link Agent} when connectivity establishment starts for a
     * particular check list.
     */
    public void startChecks()
    {
        List<IceMediaStream> streamsWithPendingConnectivityEstablishment
                = parentAgent.getStreamsWithPendingConnectivityEstablishment();

        if (streamsWithPendingConnectivityEstablishment.size() > 0) {
            // cmeng (20220613): must init to false to re-active startChecks(), previously stop() when terminated.
            // Otherwise content-add not working with init with audio call
            stopped = false;
            logger.info("Start connectivity checks. Local ufrag " + parentAgent.getLocalUfrag());
            startChecks(streamsWithPendingConnectivityEstablishment.get(0).getCheckList());
        }
        else {
            logger.info("Not starting any checks, because there are no pending streams.");
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions