【问题标题】:Testing conference call on Android在 Android 上测试电话会议
【发布时间】:2019-04-08 17:33:01
【问题描述】:

我正在尝试使用示例应用设置电话会议。基本上我所做的就是替换

mSinchClient.getCallClient().callUser(userId) 

带有

的指令
mSinchClient.getCallClient().callConference(confId) 

在 SinchService.java 文件中。我认为这会建立一个会议,但它没有给我一个错误:

com.sinch.android.rtc.sample.calling D/Call: onSessionTerminated: 94250e95-5a55-4f0f-97c0-ac85ed4f7bca: SessionDetails [startTime=1450151944, endTime=1450151946, progressTime=0, establishTime=0, terminationCause=FAILURE, packetsSent=0, packetsReceived=0, error=SinchError[errorType=OTHER, code=4000, message='DomainParameterInvalid (2228301)', data={serverCode=2228301, serverMessage=DomainParameterInvalid}]]

根据文档 (https://www.sinch.com/docs/voice/android/#setupaconferencecall),这几乎是我要做的所有事情:

CallClient callClient = sinchClient.getCallClient();
Call call = callClient.callConference("<conferenceId>");
call.addCallListener(...);

编辑: 在这里和那里尝试了一些事情之后,我得到了它的工作。代码看起来像这样:

confToCall = etCallConf.getText().toString();
call = sinchClient.getCallClient().callConference(confToCall);

没什么大不了的。这可能是您从 Sinch 人那里获得的示例代码的唯一区别。

您可以在这里找到我的 MainActivity 的来源: MainActivity.java

【问题讨论】:

  • 我从零开始构建了自己的应用程序,并让电话会议开始工作。如果有人有兴趣,我可以告诉你怎么做。
  • 可以分享一下代码吗?
  • @YasirTahir 是的,我会用我的代码更新我的问题
  • 那么,userToCall 应该是唯一的吗?如何将其他用户连接到同一个呼叫?
  • @YasirTahir 是的。我实际上犯了一个错误,混淆了用户名和配置名。我会更新我的帖子。用户应该是唯一标识符。如果您希望人们连接到同一个会议,他们只需共享会议名称即可。

标签: android sinch


【解决方案1】:

如果您设置了会议 ID,我将调用以下方法以使用会议 ID,或者在本例中为呼叫 ID

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.callscreen);

    mAudioPlayer = new AudioPlayer(this);
    mCallDuration = (TextView) findViewById(R.id.callDuration);
    mCallerName = (TextView) findViewById(R.id.remoteUser);
    mCallState = (TextView) findViewById(R.id.callState);
    Button endCallButton = (Button) findViewById(R.id.hangupButton);

    endCallButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            endCall();
        }
    });
    mCallStart = System.currentTimeMillis();
    mCallId = getIntent().getStringExtra(SinchService.CALL_ID);
    mPin = getIntent().getStringExtra("PIN");

}

【讨论】:

  • 我没有 conf ID,因为电话会议没有进行。我构建了自己的应用程序并让它工作。谢谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多