//
|
// ViewController.m
|
// HDLLinPhoneDemo
|
//
|
// Created by 陈启扬 on 2021/8/3.
|
// Copyright © 2021 陈启扬. All rights reserved.
|
//
|
|
#import "ViewController.h"
|
#import "HDLLinPhoneSDK.h"
|
@interface ViewController ()<HDLLinphoneCallDelegate>
|
|
@end
|
|
@implementation ViewController
|
|
- (void)viewDidLoad {
|
[super viewDidLoad];
|
// [NSNotificationCenter.defaultCenter addObserver:self
|
// selector:@selector(registrationUpdate:)
|
// name:@"LinphoneRegistrationUpdate"
|
// object:nil];
|
// Do any additional setup after loading the view.
|
}
|
|
//- (void)registrationUpdate:(NSNotification *)notif {
|
// LinphoneRegistrationState state = [[notif.userInfo objectForKey:@"state"] intValue];
|
// if (state == LinphoneRegistrationFailed){
|
//// [self.logView setText:@"登录失败"];
|
//
|
// } else if (state == LinphoneRegistrationOk) {
|
//// UIStoryboard *board = [UIStoryboard storyboardWithName: @"Main" bundle: nil];
|
//
|
//// ViewController *vc = [board instantiateViewControllerWithIdentifier: @"ViewController"];
|
//// [self presentViewController:vc animated:true completion:nil];
|
////
|
//// UIWindow *window = ((AppDelegate*)([UIApplication sharedApplication].delegate)).window;
|
//// [window setRootViewController:vc];
|
// HDLLinphoneIntercomVC *vc=[[HDLLinphoneIntercomVC alloc]init];
|
// [self.navigationController pushViewController:vc animated:YES];
|
// }
|
//}
|
|
- (IBAction)call:(id)sender {
|
NSLog(@"点击了");
|
// [HDLLinPhoneSDK.instance callWithUserName:@"1432549994628308993" title:@"门口机"];
|
// [HDLLinPhoneSDK.instance callWithUserName:@"6666" title:@"门口机"];
|
// [HDLLinPhoneSDK.instance callWithUserName:@"1684889786171437057" title:@"门口机"];
|
[HDLLinPhoneSDK.instance callHDLSRWithUserName:@"1684889786171437057" title:@"门口机"];
|
|
// [HDLLinPhoneSDK.instance callWithUserName:@"7777" title:@"门口机"];
|
|
|
}
|
|
- (IBAction)logOut:(id)sender {
|
NSLog(@"登出");
|
[HDLLinPhoneSDK.instance logoutAllLinphoneUser];
|
}
|
|
- (IBAction)LinPhoneCall:(id)sender {
|
NSLog(@"点击了");
|
// HDLLinphoneIntercomVC *vc=[[HDLLinphoneIntercomVC alloc]init];
|
// [self.navigationController pushViewController:vc animated:YES];
|
|
// [LinphoneManager.instance login:@"1111" password:@"85521566" domain:@"116.62.26.215:5060"];
|
// [HDLLinPhoneSDK.instance login:@"4444" password:@"85521566" domain:@"116.62.26.215:5060"];
|
// [HDLLinPhoneSDK.instance login:@"6666" password:@"85521566" domain:@"116.62.26.215:35060" ];
|
// [HDLLinPhoneSDK.instance login:@"7777" password:@"85521566" domain:@"116.62.26.215:35060"];
|
// [HDLLinPhoneSDK.instance login:@"7777" password:@"85521566" domain:@"47.96.88.250:35060"];
|
// [HDLLinPhoneSDK.instance login:@"1523530877409157121" password:@"Yrxha0sq8YwmzuN7kRpGD7pdx" domain:@"116.62.26.215:35060"];
|
// [HDLLinPhoneSDK.instance login:@"1833380707801464833" password:@"KD5L2GOIZ5Mxqv78ModXvPBRX" domain:@"47.96.88.250:25060" ];
|
[HDLLinPhoneSDK.instance login:@"1833380707801464833" password:@"KD5L2GOIZ5Mxqv78ModXvPBRX" domain:@"47.96.88.250:25060" ];
|
// [HDLLinPhoneSDK.instance udpLogin:@"1833380707801464833" password:@"KD5L2GOIZ5Mxqv78ModXvPBRX" domain:@"47.96.88.250:25060" ];
|
|
|
// [HDLLinPhoneSDK.instance login:@"5555" password:@"85521566" domain:@"116.62.26.215:35060"];
|
|
HDLLinPhoneSDK.instance.hdlLinphoneCallDelegate=self;
|
|
}
|
|
-(void)onHangUpAction:(int)callDuration{
|
NSLog(@"挂了");
|
}
|
//接听回调
|
-(void)onAnswerAction{
|
NSLog(@"接了");
|
}
|
|
//开锁回调
|
-(void)onUnlockAction{
|
NSLog(@"开锁了");
|
}
|
|
-(void)onScreenshotSuccessfulAction:(UIImage *)image{
|
NSLog(@"截屏了");
|
}
|
-(void)onRejectCallAction;{
|
NSLog(@"拒接了");
|
}
|
-(void)onIncomingCall:(NSString *)userName{
|
NSLog(@"来电了:%@",userName);
|
}
|
@end
|