464027401@qq.com
2021-09-27 b469805b2d0c9b23ca020cf9356ff137205f856c
HDLLinPhoneSDK£¨OC£©/HDLLinPhoneSDK/HDLLinphoneIntercomVC.m
@@ -35,6 +35,9 @@
@property (nonatomic,strong) dispatch_source_t openDoorTimer;
@property (nonatomic, assign) int openDoorTimeout;
@property (nonatomic, assign) int callTimeout;
@property (nonatomic, assign)  BOOL isHangUpByRemote;//是否对方远程挂断
@end
@implementation HDLLinphoneIntercomVC{
@@ -90,11 +93,15 @@
}
- (void)linphoneCallUpdate:(NSNotification *)notif {
    int state = [[notif.userInfo objectForKey:@"state"] intValue];
    if ((state == LinphoneCallEnd || state == LinphoneCallError)) {//挂断了
    if ((state == LinphoneCallEnd || state == LinphoneCallError)) {//挂断了(虽然自己挂断也会走LinphoneCallUpdate通知,但自己挂断的话页面已销毁,不会触发该方法)
        NSLog(@"挂断或出错了");
        [self stopPlaySystemSound];
        self.isHangUpByRemote=YES;
        [self showUIAlertViewWithBack:@"通话结束"];
        
    }
}
@@ -331,6 +338,7 @@
    }
    return _hangUpTextBtn;
}
//接听 å›¾æ ‡æŒ‰é’®
- (UIButton *)answerImgBtn{
    if (_answerImgBtn == nil) {
@@ -653,7 +661,9 @@
    [self stopPlaySystemSound];
    //防止用户不按挂断,或者不等收到对方的挂断,点击返回按钮。
    //1.暂停SDK相关播放
    [self stopPlay];
    if (!self.isHangUpByRemote) {
        [self stopPlay];
    }
    //2.Delegate释放
    self.hdlLinphoneCallDelegate = nil;
    //3.定时器释放
@@ -672,8 +682,8 @@
}
-(void)dealloc{
    NSLog(@"==============dealloc  1");
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    NSLog(@"==============dealloc å¯¹è±¡é”€æ¯äº†");
//    [[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)willEnterForeground:(NSNotification*)notification{
    NSLog(@"willEnterForeground");