bug fix
This commit is contained in:
@@ -4,6 +4,7 @@ package com.tianrun.sipcall;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
|
||||||
import com.tianrun.sipcall.call.CallMediaUtils;
|
import com.tianrun.sipcall.call.CallMediaUtils;
|
||||||
import com.tianrun.sipcall.call.InCallActivity;
|
import com.tianrun.sipcall.call.InCallActivity;
|
||||||
@@ -220,8 +221,13 @@ public class SipEngine implements BluetelInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void NotifyCallMediaState(int callid, int r, int l, int payload) {
|
public void NotifyCallMediaState(int callid, int r, int l, int payload) {
|
||||||
logmy.e("NotifyCallMediaState" + callid + "<>" + r + "<>" + l + "<>" + payload);
|
logmy.e("NotifyCallMediaState=========" + callid + "<>" + r + "<>" + l + "<>" + payload);
|
||||||
ActivityMgr.sendMsg(CONS.MEDIASTATE, new CallMediaUtils(callid, payload, r, l));
|
ActivityMgr.topActivity.handler.postDelayed(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
ActivityMgr.sendMsg(CONS.MEDIASTATE, new CallMediaUtils(callid, payload, r, l));
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -266,9 +272,10 @@ public class SipEngine implements BluetelInterface {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public int CallNumber(String number, boolean isVideo) {
|
public int CallNumber(String number, boolean isVideo) {
|
||||||
int callid = myBluetelEngine.CallNumber(number, ip, port, isVideo);
|
|
||||||
int calltype = isVideo ? 0 : 1;
|
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);
|
||||||
|
|
||||||
callPagesConfig.add(new InCallUtils(number, false, isVideo, 0, 0, number, "呼叫中", false, 0, callid));
|
callPagesConfig.add(new InCallUtils(number, false, isVideo, 0, 0, number, "呼叫中", false, 0, callid));
|
||||||
return callid;
|
return callid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ public class CreateGroupActivity extends TrBaseActivity {
|
|||||||
for (DBUser u : DBUser.allUser) {
|
for (DBUser u : DBUser.allUser) {
|
||||||
if (mapUsers.get(u.phone) == null) {
|
if (mapUsers.get(u.phone) == null) {
|
||||||
listPhone.add(u.phone);
|
listPhone.add(u.phone);
|
||||||
list.add(u.phone + " | " + u.name);
|
list.add(u.phone + " " + u.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(list.size() == 0) {
|
if(list.size() == 0) {
|
||||||
@@ -218,6 +218,9 @@ public class CreateGroupActivity extends TrBaseActivity {
|
|||||||
str = str + us.phone + ",";
|
str = str + us.phone + ",";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(str.length() > 0) {
|
||||||
|
str = str.substring(0, str.length() - 1);
|
||||||
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ public class CreateMeetingActivity extends TrBaseActivity {
|
|||||||
for (DBUser u : DBUser.allUser) {
|
for (DBUser u : DBUser.allUser) {
|
||||||
if (mapUsers.get(u.phone) == null && u.isOnline()) { // 只有空闲的才加入
|
if (mapUsers.get(u.phone) == null && u.isOnline()) { // 只有空闲的才加入
|
||||||
listPhone.add(u.phone);
|
listPhone.add(u.phone);
|
||||||
list.add(u.phone + " | " + u.name);
|
list.add(u.phone + " " + u.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(list.size() == 0) {
|
if(list.size() == 0) {
|
||||||
@@ -236,6 +236,9 @@ public class CreateMeetingActivity extends TrBaseActivity {
|
|||||||
str = str + us.phone + ",";
|
str = str + us.phone + ",";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(str.length() > 0) {
|
||||||
|
str = str.substring(0, str.length() - 1);
|
||||||
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -240,6 +240,9 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handleMessage(Message m) {
|
public boolean handleMessage(Message m) {
|
||||||
switch (m.what) {
|
switch (m.what) {
|
||||||
|
case CONS.ONGETCALLID:
|
||||||
|
callid = (int)m.obj;
|
||||||
|
break;
|
||||||
case CONS.CALLSTATE:
|
case CONS.CALLSTATE:
|
||||||
callstate = (String) m.obj;
|
callstate = (String) m.obj;
|
||||||
show.setText(callnumber + callstate);
|
show.setText(callnumber + callstate);
|
||||||
|
|||||||
@@ -149,11 +149,14 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
getMembers();
|
getMembers();
|
||||||
getMemberTimer();
|
getMemberTimer();
|
||||||
initTabAndPager();
|
initTabAndPager();
|
||||||
|
mTabSegment.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void getMemberTimer() {
|
static void getMemberTimer() {
|
||||||
CONS.SENDMESSAGETO(handler_CallActivity, -1, null);
|
if(handler_CallActivity != null) {
|
||||||
handler_CallActivity.postDelayed(getMemberRunner, 2000);
|
CONS.SENDMESSAGETO(handler_CallActivity, -1, null);
|
||||||
|
handler_CallActivity.postDelayed(getMemberRunner, 2000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
static Runnable getMemberRunner = new Runnable() {
|
static Runnable getMemberRunner = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -316,6 +319,9 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DBUser d = (DBUser) data;
|
DBUser d = (DBUser) data;
|
||||||
|
if(d.isOffline()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
QMUIQuickAction qa = QMUIPopups.quickAction(InCallMeetingActivity.this,
|
QMUIQuickAction qa = QMUIPopups.quickAction(InCallMeetingActivity.this,
|
||||||
QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 56),
|
QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 56),
|
||||||
QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 56))
|
QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 56))
|
||||||
@@ -564,6 +570,9 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
@Override
|
@Override
|
||||||
public boolean handleMessage(Message m) {
|
public boolean handleMessage(Message m) {
|
||||||
switch (m.what) {
|
switch (m.what) {
|
||||||
|
case CONS.ONGETCALLID:
|
||||||
|
callid = (int)m.obj;
|
||||||
|
break;
|
||||||
case CONS.CALLSTATE:
|
case CONS.CALLSTATE:
|
||||||
callstate = (String) m.obj;
|
callstate = (String) m.obj;
|
||||||
show.setText(callnumber + callstate);
|
show.setText(callnumber + callstate);
|
||||||
@@ -578,10 +587,12 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
int l = utils.getL();
|
int l = utils.getL();
|
||||||
int payload = utils.getPayload();
|
int payload = utils.getPayload();
|
||||||
if (r != 0 || l != 0) {
|
if (r != 0 || l != 0) {
|
||||||
|
mTabSegment.setVisibility(View.VISIBLE);
|
||||||
//开始视频
|
//开始视频
|
||||||
ShowVideoView(true);
|
ShowVideoView(true);
|
||||||
startVideoStream(SipEngine.getInstance().getip(), r, l, payload);
|
startVideoStream(SipEngine.getInstance().getip(), r, l, payload);
|
||||||
} else {
|
} else {
|
||||||
|
mTabSegment.setVisibility(View.INVISIBLE);
|
||||||
//开始音频
|
//开始音频
|
||||||
stopVideoStream(false);
|
stopVideoStream(false);
|
||||||
ShowVideoView(false);
|
ShowVideoView(false);
|
||||||
@@ -620,7 +631,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
c = 0;
|
c = 0;
|
||||||
logmy.e(callnumber + "--" + server + "--" + rport + "--" + lport);
|
logmy.e("startVideoStream=============="+ callnumber + "--" + server + "--" + rport + "--" + lport);
|
||||||
if (engineServer != null) {
|
if (engineServer != null) {
|
||||||
ShowVideoView(true);
|
ShowVideoView(true);
|
||||||
/*
|
/*
|
||||||
@@ -799,7 +810,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
for (DBUser u : DBUser.allUser) {
|
for (DBUser u : DBUser.allUser) {
|
||||||
if (!containMember(u.phone) || u.isOnline()) {
|
if (!containMember(u.phone) || u.isOnline()) {
|
||||||
listPhone.add(u.phone);
|
listPhone.add(u.phone);
|
||||||
list.add(u.phone + " | " + u.name);
|
list.add(u.phone + " " + u.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (list.size() == 0) {
|
if (list.size() == 0) {
|
||||||
@@ -836,6 +847,9 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
String phNum = listPhone.get(selectIndexs[i]);
|
String phNum = listPhone.get(selectIndexs[i]);
|
||||||
members = members + phNum + ",";
|
members = members + phNum + ",";
|
||||||
}
|
}
|
||||||
|
if(members.length() > 0) {
|
||||||
|
members = members.substring(0, members.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
Net.addMember2Group(callnumber, members, new HttpUtl.CallBack() {
|
Net.addMember2Group(callnumber, members, new HttpUtl.CallBack() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
package com.tianrun.sipcall.db;
|
package com.tianrun.sipcall.db;
|
||||||
|
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class DBGroup {
|
public class DBGroup {
|
||||||
public DBHead head;
|
public DBHead head;
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
package com.tianrun.sipcall.db;
|
package com.tianrun.sipcall.db;
|
||||||
|
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.tianrun.sipcall.net.Net;
|
import com.tianrun.sipcall.net.Net;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
AudioManager audioManager;
|
AudioManager audioManager;
|
||||||
ImageView buttonAddVol;
|
ImageView buttonAddVol;
|
||||||
ImageView buttonDelVol;
|
ImageView buttonDelVol;
|
||||||
DBHead currSelectData;
|
public static DBHead currSelectData;
|
||||||
ImageView imageViewSelfStatus;
|
ImageView imageViewSelfStatus;
|
||||||
TextView textViewSelfStatus;
|
TextView textViewSelfStatus;
|
||||||
|
|
||||||
@@ -346,7 +346,11 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void getUsersData() {
|
public static void getUsersData() {
|
||||||
Net.getUsers(null, null);
|
if(currSelectData != null && !currSelectData.isAll()) {
|
||||||
|
Net.getGroupMenbers(currSelectData.id, null, currSelectData.id);
|
||||||
|
} else {
|
||||||
|
Net.getUsers(null, null);
|
||||||
|
}
|
||||||
mainHandler.postDelayed(runGetUsers, 3000);
|
mainHandler.postDelayed(runGetUsers, 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,7 +468,7 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
for (DBUser u : DBUser.allUser) {
|
for (DBUser u : DBUser.allUser) {
|
||||||
if (!group.containsUser(u.phone)) {
|
if (!group.containsUser(u.phone)) {
|
||||||
listPhone.add(u.phone);
|
listPhone.add(u.phone);
|
||||||
list.add(u.phone + " | " + u.name);
|
list.add(u.phone + " " + u.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (list.size() == 0) {
|
if (list.size() == 0) {
|
||||||
@@ -501,6 +505,9 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
String phNum = listPhone.get(selectIndexs[i]);
|
String phNum = listPhone.get(selectIndexs[i]);
|
||||||
members = members + phNum + ",";
|
members = members + phNum + ",";
|
||||||
}
|
}
|
||||||
|
if(members.length() > 0) {
|
||||||
|
members = members.substring(0, members.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
Net.addMember2Group(currSelectData.audio_code, members, new HttpUtl.CallBack() {
|
Net.addMember2Group(currSelectData.audio_code, members, new HttpUtl.CallBack() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public class TrBaseActivity extends AppCompatActivity implements Handler.Callbac
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
ActivityMgr.onShowActivity(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ public class CONS {
|
|||||||
public static final int INCOMINGMESSAGE = 208;//来短信了
|
public static final int INCOMINGMESSAGE = 208;//来短信了
|
||||||
public static final int showpic = 209;
|
public static final int showpic = 209;
|
||||||
public static final int LOGINFAILED = 210;
|
public static final int LOGINFAILED = 210;
|
||||||
|
public static final int ONGETCALLID = 211;
|
||||||
|
|
||||||
public static void SENDMESSAGETO(Handler handler, int menu, Object object) {
|
public static void SENDMESSAGETO(Handler handler, int menu, Object object) {
|
||||||
if (handler != null) {
|
if (handler != null) {
|
||||||
|
|||||||
@@ -240,7 +240,9 @@ public class HttpUtl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int retCode = conn.getResponseCode();
|
int retCode = conn.getResponseCode();
|
||||||
if(retCode == 401) {
|
|
||||||
|
if (retCode == 200) {
|
||||||
|
} else if(retCode == 401) {
|
||||||
checkTokenFailed(retCode);
|
checkTokenFailed(retCode);
|
||||||
} else {
|
} else {
|
||||||
UIUtl.toastI("内部错误");
|
UIUtl.toastI("内部错误");
|
||||||
|
|||||||
@@ -269,7 +269,7 @@
|
|||||||
android:text="退出"
|
android:text="退出"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:visibility="visible" />
|
android:visibility="invisible" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|||||||
@@ -4,7 +4,9 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/IncallMeetingRoot"
|
android:id="@+id/IncallMeetingRoot"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent">
|
android:layout_height="fill_parent"
|
||||||
|
android:background="@drawable/callbackground"
|
||||||
|
android:visibility="visible">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView3"
|
android:id="@+id/imageView3"
|
||||||
@@ -56,7 +58,7 @@
|
|||||||
android:id="@+id/remote_video_layout"
|
android:id="@+id/remote_video_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:visibility="visible">
|
android:visibility="invisible">
|
||||||
|
|
||||||
<blue.view.SMSurfaceViewRenderer
|
<blue.view.SMSurfaceViewRenderer
|
||||||
android:id="@+id/remote_video_view"
|
android:id="@+id/remote_video_view"
|
||||||
@@ -69,7 +71,7 @@
|
|||||||
android:id="@+id/local_video_layout"
|
android:id="@+id/local_video_layout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="visible">
|
android:visibility="invisible">
|
||||||
|
|
||||||
<blue.view.SMSurfaceViewRenderer
|
<blue.view.SMSurfaceViewRenderer
|
||||||
android:id="@+id/local_video_view"
|
android:id="@+id/local_video_view"
|
||||||
|
|||||||
Reference in New Issue
Block a user