wxr
2024-12-03 cb9232b3ab413fae7bcc2b94abd70f18ca02b263
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//
//  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