Flutter Agora Video call participants Connection Problem

1.4k Views Asked by At

I have a collection of consultations where I have a doctor and patient IDs as well I have a consultation start time and end time.

I am generating an agora token with buildTokenWithAccount(), token is generated Successful and stored in Firebase. But problem is that it's working when I am starting a video call, I am unable to connect with another participant. I am using this example: https://github.com/AgoraIO/Agora-Flutter-SDK/tree/master/example/lib.

> Note: Channel is successful join but not able to connect video call.

This is my cloud Function for generating an agora token.

    function generateToken(channelName: string, userAccount: string, expirationTime:     FirebaseFirestore.Timestamp): string | null {
        const appId = "my-app-id";
        const appCertificate = "my-certificate-id";
        const role = Agora.RtcRole.isPublisher ? Agora.RtcRole.PUBLISHER : Agora.RtcRole.SUBSCRIBER;
        // const role = Agora.RtcRole.PUBLISHER;
    
        const expirationTimeInSeconds = 3600;
        const currentTimestamp = Math.floor(expirationTime.toDate().getTime() / 1000);
    
        // This token will be Expire After 1 hours of current Time
        const privilegeExpiredTs = currentTimestamp + expirationTimeInSeconds;
    
        try {
            const token = Agora.RtcTokenBuilder.buildTokenWithAccount(appId, appCertificate,  channelName, userAccount, role, privilegeExpiredTs);
            console.log("Got RTC token: " + token);
          return token;
        } catch (error) {
            console.log(privilegeExpiredTs);
            console.log("Error caught while generating token: ß" + error);
            return null;
    
        }
    }

Logs:

I/AudioManager(19872): In isBluetoothScoOn(), calling application: com.example.antonx_telemedicine
D/BluetoothHeadset(19872): Binding service...
D/agora-jni(19872): android bridge create done...
E/libc    (19872): Access denied finding property "net.dns1"
E/libc    (19872): Access denied finding property "net.dns2"
E/libc    (19872): Access denied finding property "net.dns3"
E/libc    (19872): Access denied finding property "net.dns4"
E/libc    (19872): Access denied finding property "net.dns1"
E/libc    (19872): Access denied finding property "net.dns2"
E/libc    (19872): Access denied finding property "net.dns3"
E/libc    (19872): Access denied finding property "net.dns4"
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In setSpeakerphoneOn(), on: false, calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In setSpeakerphoneOn(), on: false, calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isBluetoothScoOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isBluetoothScoOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isBluetoothScoOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isBluetoothScoOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isBluetoothScoOn(), calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In setSpeakerphoneOn(), on: false, calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In setSpeakerphoneOn(), on: true, calling application: com.example.antonx_telemedicine
I/AudioManager(19872): In isSpeakerphoneOn(), calling application: com.example.antonx_telemedicine
E/libc    (19872): Access denied finding property "net.dns1"
E/libc    (19872): Access denied finding property "net.dns2"
E/libc    (19872): Access denied finding property "net.dns3"
E/libc    (19872): Access denied finding property "net.dns4"


----------
0

There are 0 best solutions below