JLChen
2021-08-02 38f4fb064df09f344fc3237409c76a9fba2a8a9e
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
//
//  ESSipManager.h
//  EasySip
//
//  Created by Weller Zhao on 2018/7/27.
//  Copyright © 2018 weller. All rights reserved.
//
 
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
//#import "linphone/linphonecore.h"
 
typedef struct LinphoneCall ESCall;
 
extern NSString *const ES_ON_REMOTE_OPEN_CEMERA;
extern NSString *const ES_ON_CALL_COMMING;
extern NSString *const ES_ON_CALL_END;
extern NSString *const ES_ON_CALL_STREAM_UPDATE;
 
@interface ESSipManager : NSObject
 
/**
 单例
 
 @return 返回实例
 */
+ (instancetype) instance;
 
 
/**
 登录sip服务器
 
 @param username 用户名
 @param password 密码
 @param displayName 显示名
 @param domain ip/域名
 @param port 端口
 @param transport 传输协议 UDP | TCP | TLS
 */
- (void) login: (NSString*) username password: (NSString*) password displayName: (NSString*) displayName domain: (NSString*) domain port: (NSString *) port withTransport: (NSString*) transport;
 
 
/**
 退出登录,注销账户
 */
- (void) logout;
 
 
/**
 拨打电话
 
 @param username 用户名
 @param displayName 显示名
 */
- (void) call: (NSString*) username displayName: (NSString*) displayName;
 
- (void) callWithPhoneNumber:(NSString *)phone withVideo:(BOOL)video;
 
///**
// 接听电话
//
// @param call 电话
// */
//- (void) acceptCall: (ESCall*) call;
 
 
- (void) acceptCall;
 
 
/**
 配置视频播放流
 
 @param videoView 视频播放界面
 @param cameraView 当前摄像头显示界面
 */
- (void) configVideo: (UIView*) videoView cameraView: (UIView*) cameraView;
 
/**
 挂断
 */
- (void) hangUpCall;
 
/**
 请求对方打开摄像头
 */
- (void) requestOpenCamera;
 
/**
 关闭摄像头
 */
- (void) closeCamera;
 
/**
 判断当前通话是否开启视频
 
 @param call 通话
 @return bool
 */
- (BOOL) isVideoEnabled: (ESCall*) call;
 
/**
 同意打开摄像头
 
 @param call 通话
 */
-(void) allowToOpenCameraByRemote: (ESCall*)call;
 
/**
 拒绝打开摄像头
 
 @param call 通话
 */
-(void) refuseToOpenCameraByRemote: (ESCall*)call;
 
 
///**
// 获取联系人名
// 
// @param call 通话
// @return 名字
// */
//-(NSString*) getCallName: (ESCall*)call;
 
@end