| | |
| | | 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]; |
| | |
| | | } |
| | | |
| | | -(void)viewWillDisappear:(BOOL)animated{ |
| | | NSLog(@"viewWillDisappear"); |
| | | [super viewWillDisappear:animated]; |
| | | [self stopPlaySystemSound]; |
| | | //防止用户不按挂断,或者不等收到对方的挂断,点击返回按钮。 |
| | |
| | | _countdownTimer = nil; // OK |
| | | |
| | | } |
| | | |
| | | [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| | | |
| | | } |
| | | |
| | |
| | | #pragma 震动实现貌似和SDK冲突 不能实现震动 |
| | | //开始播放的时候调用 |
| | | -(void)startPlaySystemSound{ |
| | | return; |
| | | // return; |
| | | // //震动的提示文件名放到资源目录下 |
| | | // NSString *path = [[NSBundle mainBundle] pathForResource:@"ring" ofType:@"wav"]; |
| | | // AudioServicesCreateSystemSoundID((__bridge CFURLRef)[NSURL fileURLWithPath:path], &sound); |
| | |
| | | |
| | | //手动停止播放的时候调用 |
| | | - (void)stopPlaySystemSound{ |
| | | return; |
| | | // return; |
| | | NSLog(@"stop PlaySystemSound"); |
| | | stopRingAndVibration(); |
| | | HDLLPStopRingAndVibration(); |
| | | } |
| | | |
| | | //停止响铃和震动,移除回调并处理掉铃声和震动 |
| | | void stopRingAndVibration() { |
| | | void HDLLPStopRingAndVibration() { |
| | | AudioServicesRemoveSystemSoundCompletion(kSystemSoundID_Vibrate); |
| | | // AudioServicesRemoveSystemSoundCompletion(sound); |
| | | AudioServicesDisposeSystemSoundID(kSystemSoundID_Vibrate); |