From 7960485054f37eb60d63a98231686cef41302a8b Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期三, 11 五月 2022 09:13:56 +0800
Subject: [PATCH] 修改部分方法

---
 HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m |   34 ++++++++++++++++++++++++++--------
 1 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m b/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m
index 136009d..ad92e58 100644
--- a/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m
+++ b/HDLLinPhoneSDK/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m
@@ -67,7 +67,7 @@
     [self initCentetView];
     [self initData];
     [self initESVideo];
-    //寮�濮嬪弽鍛�
+    //寮�濮嬮渿鍔�
     [self StartReverseCall];
     [self ShowCalltimeBtn:callingStr];
     //娉ㄥ唽寮�閿佹垚鍔熺洃鍚�
@@ -77,8 +77,22 @@
         self.titleUILabel.text=self.titleName;
     }
 //    self.titleUILabel.text=self.titleName;
+    
+    [NSNotificationCenter.defaultCenter addObserver:self
+                                           selector:@selector(registrationUpdate:)
+                                               name:@"LinphoneRegistrationUpdate"
+                                             object:nil];
+
 }
 
+- (void)registrationUpdate:(NSNotification *)notif {
+    int state = [[notif.userInfo objectForKey:@"state"] intValue];
+    if(state==11){//鎸傛柇浜�
+        NSLog(@"鎸傛柇鎴栧嚭閿欎簡");
+        [self showUIAlertViewWithBack:@"閫氳瘽缁撴潫"];
+        
+    }
+}
 
 -(void)initLlanguage{
     NSString *languageName = [[[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"] objectAtIndex:0];
@@ -238,6 +252,7 @@
     [_screenshotImgBtn setImage:[UIImage imageNamed:@"ic_esvideo_on_takephoto_unselect"] forState:UIControlStateNormal];
     
     //鎴浘
+    [HDLLinphoneManager.instance snapShotWithView:self.videoView];
     
 }
 
@@ -332,7 +347,7 @@
 //    [[HDLCallManager instance] acceptCallByCallID:self.CallId hasVideo:self.hasVideo];
     [[HDLLinphoneManager instance] acceptCall];
     /// 寮�鍚璁�
-    [self startTalk];
+//    [self startTalk];
     
     _answerImgBtn.hidden = YES;
     _answerTextBtn.hidden = YES;
@@ -505,7 +520,7 @@
 /** 寮�鍚�掕鏃� */
 - (void)startOpenDoorCountdown {
     
-    if (_openDoorTimeout > 20) {
+    if (_openDoorTimeout > 10) {
         return;
     }
     
@@ -520,7 +535,7 @@
     
     dispatch_source_set_event_handler(_openDoorTimer, ^{
         WEAKSELF_AT
-        if(weakSelf_AT.openDoorTimeout >= 20 ){// 璁℃椂缁撴潫
+        if(weakSelf_AT.openDoorTimeout >= 10 ){// 璁℃椂缁撴潫
             // 鍏抽棴瀹氭椂鍣�
             dispatch_source_cancel(weakSelf_AT.openDoorTimer);
             
@@ -629,6 +644,7 @@
 }
 
 -(void)viewWillDisappear:(BOOL)animated{
+    NSLog(@"viewWillDisappear");
     [super viewWillDisappear:animated];
     [self stopPlaySystemSound];
     //闃叉鐢ㄦ埛涓嶆寜鎸傛柇锛屾垨鑰呬笉绛夋敹鍒板鏂圭殑鎸傛柇锛岀偣鍑昏繑鍥炴寜閽��
@@ -646,6 +662,8 @@
         _countdownTimer = nil; // OK
         
     }
+    
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
     
 }
 
@@ -711,7 +729,7 @@
 #pragma 闇囧姩瀹炵幇璨屼技鍜孲DK鍐茬獊 涓嶈兘瀹炵幇闇囧姩
 //寮�濮嬫挱鏀剧殑鏃跺�欒皟鐢�
 -(void)startPlaySystemSound{
-    return;
+//    return;
     //    //闇囧姩鐨勬彁绀烘枃浠跺悕鏀惧埌璧勬簮鐩綍涓�
     //    NSString *path = [[NSBundle mainBundle] pathForResource:@"ring" ofType:@"wav"];
     //    AudioServicesCreateSystemSoundID((__bridge CFURLRef)[NSURL fileURLWithPath:path], &sound);
@@ -724,13 +742,13 @@
 
 //鎵嬪姩鍋滄鎾斁鐨勬椂鍊欒皟鐢�
 - (void)stopPlaySystemSound{
-    return;
+//    return;
     NSLog(@"stop PlaySystemSound");
-    stopRingAndVibration();
+    HDLLPStopRingAndVibration();
 }
 
 //鍋滄鍝嶉搩鍜岄渿鍔紝绉婚櫎鍥炶皟骞跺鐞嗘帀閾冨0鍜岄渿鍔�
-void stopRingAndVibration() {
+void HDLLPStopRingAndVibration() {
     AudioServicesRemoveSystemSoundCompletion(kSystemSoundID_Vibrate);
     //    AudioServicesRemoveSystemSoundCompletion(sound);
     AudioServicesDisposeSystemSoundID(kSystemSoundID_Vibrate);

--
Gitblit v1.8.0