Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to implement call busy logic? #48

Closed
ShyamKrishna122 opened this issue Dec 11, 2020 · 5 comments
Closed

how to implement call busy logic? #48

ShyamKrishna122 opened this issue Dec 11, 2020 · 5 comments

Comments

@ShyamKrishna122
Copy link

No description provided.

@wrteam-priyansh
Copy link

@ShyamKrishna122 you can store call details in database when call is in process and when call finish delete the call related data.so before making call you check for call details for other user and if you find call details in database that means user is busy in call..
hope i am making sense

@TatankaConCube
Copy link
Contributor

additionally to @wrteam-priyansh solution you can use additional parameters when you reject the call, it can looks like callSession.reject({"reason": "BUSY"}); and on the caller side in the callback onCallRejectedByUser you can check this parameter like:

_callSession.onCallRejectedByUser = _onCallRejectedByUser;

void _onCallRejectedByUser(P2PSession session, int userId, Map<String, String> userInfo) {
    if (userInfo.isNotEmpty && userInfo.containsKey("reason")) {
        String reason = userInfo["reason"];

        if (reason == "BUSY") {
            // user is busy, do needed actions
        }
    }
}

@ShyamKrishna122
Copy link
Author

Thank you guys but what will userInfo contains?

@TatankaConCube
Copy link
Contributor

it will cantains data which you send in callSession.reject({"reason": "BUSY"}); when busy user does reject

@ShyamKrishna122
Copy link
Author

Thank you I will try implementing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants