From cb9232b3ab413fae7bcc2b94abd70f18ca02b263 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期二, 03 十二月 2024 11:20:32 +0800
Subject: [PATCH] 增加铃声;增加TCP/UDP连接选择

---
 HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m b/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m
index ad92e58..33682da 100644
--- a/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m
+++ b/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m
@@ -50,6 +50,10 @@
     NSString * callingStr;
     NSString * hangUpStr;
     NSString * endOfCallStr;
+    
+    NSString * cancelStr;
+    NSString * tipMsgStr;
+
     //    int openDoorTimeout;
     //鍏ㄥ眬鍙橀噺
     SystemSoundID sound;
@@ -109,6 +113,8 @@
         unlockSuccessfullyStr = @"寮�閿佹垚鍔�";
         callingStr = @"鏉ョ數涓�...";
         endOfCallStr = @"閫氳瘽缁撴潫";
+        cancelStr = @"鍙栨秷";
+        tipMsgStr = @"纭畾寮�閿佸悧?";
     }else{
         tipStr = @"Prompt";
         okStr = @"OK";
@@ -120,6 +126,8 @@
         unlockSuccessfullyStr = @"Unlock successfully";
         callingStr = @"Incoming call";
         endOfCallStr = @"End of call";
+        cancelStr = @"Cancel";
+        tipMsgStr = @"Are you sure to unlock?";
         
     }
 }
@@ -279,7 +287,26 @@
     [_unlockImgBtn setImage:[UIImage imageNamed:@"ic_esvideo_on_unlock_unselect"] forState:UIControlStateNormal];
     //寮�閿�
     if(self.hdlLinphoneCallDelegate != NULL){
-        [self.hdlLinphoneCallDelegate onUnlockAction];
+        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:tipStr message:tipMsgStr preferredStyle:UIAlertControllerStyleAlert];
+
+        // 娣诲姞鍙栨秷鎸夐挳
+        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:cancelStr style:UIAlertActionStyleCancel handler:nil];
+        [alertController addAction:cancelAction];
+
+        // 娣诲姞纭鎸夐挳
+        WEAKSELF_AT
+        UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:okStr  style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            
+            [weakSelf_AT.hdlLinphoneCallDelegate onUnlockAction];
+        }];
+        [alertController addAction:confirmAction];
+
+        // 鑾峰彇褰撳墠瑙嗗浘鎺у埗鍣�
+        UIViewController *currentViewController = [UIApplication sharedApplication].keyWindow.rootViewController;
+
+        // 鏄剧ず寮圭獥
+        [currentViewController presentViewController:alertController animated:YES completion:nil];
+
     }
 }
 

--
Gitblit v1.8.0