chenqiyang
2021-08-27 6a63c4281fbe7e17103115320cd276397d733081
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
//
//  LinphoneManager.h
//  VoipTest
//
//  Created by StevStark on 2020/11/11.
//
 
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
//#import "AudioHelper.h"
#include "linphone/lpconfig.h"
#include "linphone/factory.h"
#include "linphone/linphonecore_utils.h"
#include "linphone/linphonecore.h"
#include "mediastreamer2/mscommon.h"
//#import "HDLLinPhoneSDK-Swift.h"
//#import  "AppDelegate.h"
#import <UIKit/UIKit.h>
#import <CoreTelephony/CTCallCenter.h>
#define LINPHONE_SDK_VERSION  "4.4.0"
#define FRONT_CAM_NAME                            \
"AV Capture: com.apple.avfoundation.avcapturedevice.built-in_video:1" /*"AV Capture: Front Camera"*/
#define BACK_CAM_NAME                            \
"AV Capture: com.apple.avfoundation.avcapturedevice.built-in_video:0" /*"AV Capture: Back Camera"*/
 
NS_ASSUME_NONNULL_BEGIN
 
 
typedef struct _LinphoneManagerSounds {
    SystemSoundID vibrate;
} LinphoneManagerSounds;
 
typedef struct _CallContext {
    LinphoneCall* call;
    bool_t cameraIsEnabled;
} CallContext;
 
@interface HDLLinphoneManager : NSObject{
@public
    CallContext currentCallContextBeforeGoingBackground;
}
- (void)launchLinphoneCore;
+ (HDLLinphoneManager*)instance;
+ (NSString*)bundleFile:(NSString*)file;
+ (LinphoneCore*)getLc;
 
- (void)login:(NSString*)username password:(NSString*)pwd domain:(NSString*) domain;
- (void)startCall:(NSString*)phoneNum;
- (void)endCall;
-(void)acceptCall;
- (void)fetchVideo;
- (void)closeCamera;
-(void)initalLinPhonal;
-(void)snapShot;//视频截图
-(void)snapShotWithView:(UIView *)view;//视频截图
-(void)removeAllAccounts;//注销登录
-(void)clearConfigs;//清除配置表
- (BOOL)enterBackgroundMode;
-(void)willResignActive;
- (void)becomeActive ;
@property (readonly) const char*  frontCamId;
@property (readonly) const char*  backCamId;
@property (readonly) LinphoneManagerSounds sounds;
@property (readonly) LpConfig *configDb;
@property (nonatomic, assign) BOOL bluetoothAvailable;
@property (readonly) NSString* contactSipField;
@end
 
 
static LinphoneCore *theLinphoneCore;
static HDLLinphoneManager *theLinphoneManager;
 
 
NS_ASSUME_NONNULL_END