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 merge or mix 3 audiostream like conference call? #481

Open
dmagic99 opened this issue Sep 30, 2024 · 4 comments
Open

How to merge or mix 3 audiostream like conference call? #481

dmagic99 opened this issue Sep 30, 2024 · 4 comments

Comments

@dmagic99
Copy link

No description provided.

@dmagic99 dmagic99 changed the title How to merge 3 audio stream like conference call? How to merge or mix 3 audiostream like conference call? Sep 30, 2024
@Yukari-Tryhard
Copy link

So first of all you need a media server to mix audio. For example Asterisk. And then you first make a call to Asterisk then refer all related call to that specific call

@Yukari-Tryhard
Copy link

This is my working code. Assume you have extension for Conference inside your asterisk:

  @override
  void callStateChanged(Call call, CallState callState) {
    callProvider.addCurrentCall(call);
    callProvider.updateCurrentCall(call);
    if (callState.state == CallStateEnum.CALL_INITIATION) {
      if (call.remote_identity!.contains("Conference")) {
        callProvider.addConferenceCall(call);
        // Refer each held call to the conference call
        for (var heldCall in callProvider.heldCalls) {
          heldCall.refer(call.remote_identity!);
        }
        callProvider.clearHeldCalls();
        callProvider.lastActiveCall!.refer(call.remote_identity!);
      }
      _navigationService.navigateTo(Routes.call, {"call": call});
    }
    if (callState.state == CallStateEnum.ENDED) {
      callProvider.removeCurrentCall(call);
    }
  }

@dmagic99
Copy link
Author

dmagic99 commented Oct 2, 2024

Could you please clarify what callProvider is? Is it part of this library? Could you explain it briefly

@Tin-Primas
Copy link

Could you please clarify what callProvider is? Is it part of this library? Could you explain it briefly

callProvider is just like it name imply. It's a provider for holding data and sharing it between components. Here is an example code:

class CallProvider with ChangeNotifier {
  List<Call> heldCalls = [];
  List<Call> currentCalls = [];
  Set<String> heldCallIds = {};
  Set<String> currentCallIds = {};
  String lastDialedNumber = '';
  Call? lastActiveCall;
  Call? activeConferenceCall;
  }

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