Browse Source

界面优化,修改sip重登录时间,去掉sip日志输出文件,更新sip sdk版本等

weizhengliang 1 year ago
parent
commit
dac2fa2787

+ 4 - 0
callingbed/src/main/java/com/wdkl/app/ncs/callingbed/activity/CallingbedActivity.kt

@@ -548,6 +548,8 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
         //配置sip账户
         if (WdklSipService.getCore() != null) {
             mAccountCreator = WdklSipService.getCore().createAccountCreator(null)
+            WdklSipService.getCore().clearAllAuthInfo()
+            WdklSipService.getCore().clearProxyConfig()
             // 以下三项必须
             if (!TextUtils.isEmpty(Constant.TCP_SERVER_URL) && !TextUtils.isEmpty(Constant.SIP_ID)) {
                 Log.e(TAG, "sip connect: ${Constant.SIP_ID}")
@@ -559,6 +561,8 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
 
                 // 这里会自动创建代理配置、认证信息到 SIP核心
                 val cfg = mAccountCreator!!.createProxyConfig()
+                cfg.expires = 12000
+                Log.e(TAG, "sip login time: " + cfg.expires)
                 // 确保新创建的是最新
                 WdklSipService.getCore().defaultProxyConfig = cfg
             }

+ 1 - 1
callingbed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/QrCodeFragment.kt

@@ -64,7 +64,7 @@ class QrCodeFragment : BaseFragment<QrCodeFragmentPresenter, QrcodeViewBinding>(
             builder.append(Constant.DEVICE_TYPE)
             builder.append("&device_name=")
             builder.append(Constant.DEVICE_NAME)
-            val code = EcodeHelper().createQRImage(builder.toString(),180, null)
+            val code = EcodeHelper().createQRImage(builder.toString(),160, null)
             activity.runOnUiThread {
                 view_qr_code?.setImageBitmap(code)
             }

+ 1 - 1
callingbed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/SipCallFragment.kt

@@ -54,7 +54,7 @@ class SipCallFragment: BaseCallFragment() {
             message: String
         ) {
             Log.e(TAG, "received call state: $state, ${call.remoteAddress.displayName}, $message")
-            if (state == Call.State.IncomingReceived) {
+            if (state == Call.State.IncomingReceived || state == Call.State.IncomingEarlyMedia) {
                 //来电时将自动接听
                 if (sipCore != null) {
                     val params = sipCore!!.createCallParams(call)

+ 1 - 1
callingbed/src/main/java/com/wdkl/app/ncs/callingbed/sip/WdklSipService.java

@@ -72,7 +72,7 @@ public class WdklSipService extends Service {
         //这里开户调试日志及设置路径
         String basePath = getFilesDir().getAbsolutePath();
         Factory.instance().setLogCollectionPath(basePath);
-        Factory.instance().enableLogCollection(LogCollectionState.Enabled);
+        Factory.instance().enableLogCollection(LogCollectionState.Disabled);
         Factory.instance().setDebugMode(true, getString(R.string.app_name));
 
         //收集一些设备信息

+ 2 - 2
callingbed/src/main/res/layout/qrcode_view.xml

@@ -19,8 +19,8 @@
             android:orientation="vertical">
             <ImageView
                 android:id="@+id/view_qr_code"
-                android:layout_width="180dp"
-                android:layout_height="180dp"
+                android:layout_width="170dp"
+                android:layout_height="170dp"
                 android:layout_gravity="center_horizontal"/>
 
             <TextView

+ 16 - 13
callingbed/src/main/res/layout/view_bed_name.xml

@@ -5,22 +5,25 @@
     android:layout_height="114dp"
     android:background="@color/white">
 
-    <com.wdkl.ncs.android.lib.widget.MarqueeTextView
-        android:id="@+id/tv_bed_name"
+    <LinearLayout
         android:layout_width="0dp"
         android:layout_height="match_parent"
-        android:layout_weight="1"
         android:layout_marginTop="-16dp"
-        android:paddingLeft="24dp"
-        android:gravity="center"
-        android:textColor="@color/black"
-        android:textSize="112sp"
-        android:textStyle="bold"
-        android:text="--"
-        android:singleLine="true"
-        android:ellipsize="marquee"
-        android:focusable="true"
-        android:focusableInTouchMode="true"/>
+        android:layout_weight="1">
+        <com.wdkl.ncs.android.lib.widget.MarqueeTextView
+            android:id="@+id/tv_bed_name"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:gravity="center_horizontal"
+            android:textColor="@color/black"
+            android:textSize="110sp"
+            android:textStyle="bold"
+            android:text="--"
+            android:singleLine="true"
+            android:ellipsize="marquee"
+            android:focusable="true"
+            android:focusableInTouchMode="true"/>
+    </LinearLayout>
 
     <TextView
         android:id="@+id/tv_version"

+ 1 - 1
common/build.gradle

@@ -249,7 +249,7 @@ dependencies {
     compile 'com.github.pinguo-zhouwei:MZBannerView:v2.0.2'
 
     //linphone sdk
-    compile files('libs/linphone-sdk-android-4.3.3.aar')
+    compile files('libs/linphone-sdk-android-4.4.33.aar')
 }
 
 //tasks.withType(JavaCompile) {

BIN
common/libs/linphone-sdk-android-4.3.3.aar


+ 1 - 1
common/src/main/code/com/wdkl/ncs/android/lib/utils/EcodeHelper.kt

@@ -33,7 +33,7 @@ class EcodeHelper {
             //容错级别
             hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H)
             //设置空白边距的宽度
-            hints.put(EncodeHintType.MARGIN, 1) //default is 4
+            hints.put(EncodeHintType.MARGIN, 0) //default is 4
 
             // 图像数据转换,使用了矩阵转换
             val bitMatrix = QRCodeWriter().encode(content, BarcodeFormat.QR_CODE, heightPix, heightPix, hints)

+ 1 - 0
middleware/src/main/code/com/wdkl/ncs/android/middleware/utils/CommonUtils.java

@@ -18,6 +18,7 @@ public class CommonUtils {
     //private static final String DEFAULT_URL = "8.129.220.143";
     //private static final String DEFAULT_URL = "172.28.100.100";
     //private static final String DEFAULT_URL = "192.168.8.5";
+    //private static final String DEFAULT_URL = "47.106.137.131";
     private static final String DEFAULT_URL = "111.111.0.34";  //祁阳
     private static final String DEFAULT_URL_PORT = "8006";
     private static final String DEFAULT_SIP_PORT = "8188";