Testing conference call on Android

一世执手 提交于 2019-12-23 19:41:20

问题


I'm trying to set up a conference call using the sample app. Basically what I did was replace the

mSinchClient.getCallClient().callUser(userId) 

directive with

mSinchClient.getCallClient().callConference(confId) 

in the SinchService.java file. I thought that would set up a conference but it fails giving me an error:

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}]]

According to the documentation (https://www.sinch.com/docs/voice/android/#setupaconferencecall) that's pretty much all I have to do:

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

Edit: After trying a few things here and there I got it working. The code would look something like this:

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

There's not much to it. That's probably the only difference with the sample code you get from the Sinch people.

You can find the source of my MainActivity here: MainActivity.java


回答1:


If you have a conference ID set in place I would invoke the following method in order to use the Conference ID, or in this case the Call 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");

}


来源:https://stackoverflow.com/questions/34281090/testing-conference-call-on-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!