| | |
| | | BOOL isBackGround; |
| | | BOOL iSVideoNotDetermined; |
| | | BOOL iSAudioNotDetermined; |
| | | BOOL isAnswer;//是否已经点击接听过了 |
| | | |
| | | NSString * tipStr; |
| | | NSString * okStr; |
| | |
| | | NSString * unlockSuccessfullyStr; |
| | | NSString * callingStr; |
| | | NSString * hangUpStr; |
| | | NSString * hasBeenHungUpStr; |
| | | // int openDoorTimeout; |
| | | //全局变量 |
| | | SystemSoundID sound; |
| | |
| | | hangUpStr = @"挂断"; |
| | | unlockSuccessfullyStr = @"开锁成功"; |
| | | callingStr = @"来电中..."; |
| | | hasBeenHungUpStr = @"已挂断"; |
| | | }else{ |
| | | tipStr = @"Prompt"; |
| | | okStr = @"OK"; |
| | |
| | | hangUpStr = @"Hang up"; |
| | | unlockSuccessfullyStr = @"Unlock successfully"; |
| | | callingStr = @"Incoming call"; |
| | | hasBeenHungUpStr = @"Has been hung up"; |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | //挂断按钮事件 |
| | | -(void)hangUpAction{ |
| | | //1.回调事件 |
| | | if(self.mESCallDelegate != NULL){ |
| | | if(isAnswer){ |
| | | //如果之前已经接听了,回调是挂断 |
| | | [self.mESCallDelegate onHangUpAction:_callTimeout]; |
| | | }else{ |
| | | //如果之前没接听了,回调是拒接 |
| | | [self.mESCallDelegate onRejectCallAction]; |
| | | } |
| | | } |
| | | //2.页面关闭 |
| | | [self backAction]; |
| | | } |
| | | |
| | |
| | | //开始计时 |
| | | _callTimeout = 0; |
| | | [self startCountdown]; |
| | | isAnswer = YES; |
| | | |
| | | if(self.mESCallDelegate != NULL){ |
| | | [self.mESCallDelegate onAnswerAction]; |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | _openDoorTimeout = 0; |
| | | [self startOpenDoorCountdown]; |
| | | [self showUIAlertView:unlockSuccessfullyStr]; |
| | | |
| | | |
| | | // 开锁成功回调 |
| | | if(self.mESCallDelegate != NULL){ |
| | | [self.mESCallDelegate onUnlockAction]; |
| | | } |
| | | } |
| | | |
| | | -(void)setUnlock:(BOOL)ISEnable{ |
| | |
| | | |
| | | // [_mCallOrAccept setTitle:@"通话中..." forState:UIControlStateNormal]; |
| | | }else if([phoneEventStr isEqual:@"EVT_HangUp"]){ |
| | | [self showUIAlertViewWithBack:@"已挂断"]; |
| | | [self showUIAlertViewWithBack:hasBeenHungUpStr]; |
| | | // [_mCallOrAccept setTitle:@"反呼" forState:UIControlStateNormal]; |
| | | }else if([phoneEventStr isEqual:@"EVT_P2POnlineStatusChanged"]){ |
| | | //EVT_P2PStarted(p2p初始化OK,可以连接),EVT_P2POnlineStatusChangedonline=1 |
| | |
| | | NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil]; |
| | | NSInteger status = [[dic valueForKey:@"status"]integerValue]; |
| | | if(status && status == 1){ |
| | | NSLog(@"开门成功"); |
| | | // NSLog(@"开门成功"); |
| | | [self setOpenDoorSuccess]; |
| | | }else{ |
| | | NSLog(@"开门失败"); |
| | |
| | | NSString *message = nil; |
| | | if (!error) { |
| | | message = saveToTheAlbumsStr; |
| | | // 截图成功回调 |
| | | if(self.mESCallDelegate != NULL){ |
| | | [self.mESCallDelegate onScreenshotSuccessfulAction:image]; |
| | | } |
| | | } |
| | | else |
| | | { |