// // LinphoneManager.h // VoipTest // // Created by StevStark on 2020/11/11. // #import #import //#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 #import #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