This commit is contained in:
2021-04-20 22:05:07 +08:00
parent a90f8bf59c
commit 38b701a4ea
8 changed files with 17 additions and 8 deletions

View File

@@ -173,7 +173,7 @@ public class SipEngine implements BluetelInterface {
int calltype = isVideo == false ? 0 : 1;
String state = isVideo == true ? "视频来电" : "音频来电";
callPagesConfig.add(new InCallUtils(incomingNumber, isHolder, isVideo, rPort, lPort, incomingNumber, state, false, 0, callid));
GoToInCall(App.getContext(), incomingNumber, "来电", calltype, callid);
GoToInCall(App.getContext(), incomingNumber, "来电", calltype, callid, false);
}
@Override
@@ -247,7 +247,7 @@ public class SipEngine implements BluetelInterface {
* @param calltype
* @param callid
*/
public void GoToInCall(Context context, String callnumber, String callstate, int calltype, int callid) {
public void GoToInCall(Context context, String callnumber, String callstate, int calltype, int callid, boolean selfCall) {
Intent intent = null;
logmy.e("GoToInCall==============" + isMeetingCall(callnumber) +"==="+ System.currentTimeMillis());
@@ -261,6 +261,7 @@ public class SipEngine implements BluetelInterface {
bundle.putString("callnumber", callnumber);
bundle.putString("callstate", callstate);
bundle.putInt("calltype", calltype);
bundle.putBoolean("selfCall", selfCall);
intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
@@ -276,7 +277,7 @@ public class SipEngine implements BluetelInterface {
public int CallNumber(String number, boolean isVideo) {
int calltype = isVideo ? 0 : 1;
int callid = myBluetelEngine.CallNumber(number, ip, port, isVideo);
GoToInCall(App.getContext(), number, "呼叫中", calltype, callid);
GoToInCall(App.getContext(), number, "呼叫中", calltype, callid, true);
callPagesConfig.add(new InCallUtils(number, false, isVideo, 0, 0, number, "呼叫中", false, 0, callid));
return callid;

View File

@@ -60,6 +60,7 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
private String callnumber = "未知";
private String callstate = "未知";
private int calltype = 0; //0音频1视频
private boolean selfCall = false;
private boolean VIDEOSTATE = false;
public static Intent incallIntent;
@@ -189,7 +190,7 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
incall_answer.setVisibility(View.GONE);
}
show.setText(callnumber + callstate);
if (incall_answer.getVisibility() == View.VISIBLE) {
if (incall_answer.getVisibility() == View.VISIBLE && selfCall) {
incall_answer.setVisibility(View.GONE);
SipEngine.getInstance().answer(callid);
}
@@ -223,6 +224,7 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
callnumber = bundle.getString("callnumber");
callstate = bundle.getString("callstate");
calltype = bundle.getInt("calltype");
selfCall = bundle.getBoolean("selfCall");
}
/**

View File

@@ -82,6 +82,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
private String callnumber = "未知";
private String callstate = "未知";
private int calltype = 0; //0音频1视频
private boolean selfCall = false;
private boolean VIDEOSTATE = false;
public static Intent incallIntent;
@@ -524,7 +525,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
}
show.setText(callnumber + callstate);
//控件显示号码,来电,去电,通话中...
if (incall_answer.getVisibility() == View.VISIBLE) {
if (incall_answer.getVisibility() == View.VISIBLE && selfCall) {
incall_answer.setVisibility(View.GONE);
SipEngine.getInstance().answer(callid);
}
@@ -560,6 +561,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
callnumber = bundle.getString("callnumber");
callstate = bundle.getString("callstate");
calltype = bundle.getInt("calltype");
selfCall = bundle.getBoolean("selfCall");
}
/**

View File

@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/callbackground" >
<blue.view.SMPercentFrameLayout
@@ -35,7 +36,7 @@
android:layout_height="wrap_content"
android:visibility="visible" />
</blue.view.SMPercentFrameLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="60dp"