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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
//
//  LinPhoneWraper.h
//  HDLLinPhoneSDK
//
//  Created by 陈启扬 on 2021/8/12.
//  Copyright © 2021 陈启扬. All rights reserved.
//
 
#import <Foundation/Foundation.h>
#import <belle-sip/object.h>
#import <linphone/core.h>
NS_ASSUME_NONNULL_BEGIN
 
typedef enum _AVPFMode {
 
    Default = -1,
/// AVPF is disabled.
    Disabled = 0,
/// AVPF is enabled.
     Enabled = 1
    
} AVPFMode;
 
///Enum algorithm checking.
typedef enum _AccountCreatorAlgoStatus {
 
    Ok = 0,
    /// Algorithm not supported.
    NotSupported = 1
    
} AccountCreatorAlgoStatus;
///Enum describing Ip family.
typedef enum _AddressFamily {
 
    Inet = 0,
    /// IpV6.
    Inet6 = 1,
    /// Unknown.
    Unspec = 2
    
} AddressFamily;
 
///Enum describing type of audio route.
typedef enum _AudioRoute {
 
    Earpiece = 0,
    Speaker = 1
} AudioRoute;
///Enum describing the authentication methods.
typedef enum _AuthMethod {
 
    /// Digest authentication requested.
    HttpDigest = 0,
    /// Client certificate requested.
    Tls = 1
} AuthMethod;
 
///LinphoneChatRoomBackend is used to indicate the backend implementation of a
///chat room.
//typedef enum _ChatRoomBackend{
//
//   Basic = 0x01 << 0,
//   FlexisipChat = 0x01 << 1
//}ChatRoomBackend;
//
//typedef enum _ChatRoomCapabilities{
//
//   None = 0x1 << 0,
//   Basic = 0x01 << 1
//}ChatRoomCapabilities;
typedef NS_OPTIONS(NSUInteger, ChatRoomBackend) {
 
    ChatRoomBackend_Basic = 0x01 << 0,
    ChatRoomBackend_FlexisipChat = 0x01 << 1
 
};
typedef NS_OPTIONS(NSUInteger, ChatRoomCapabilities) {
 
    ChatRoomCapabilities_None = 0x00,
    ChatRoomCapabilities_Basic = 0x01 << 0,
    ChatRoomCapabilities_RealTimeText = 0x01 << 1,
    ChatRoomCapabilities_Conference = 0x01 << 2,
    ChatRoomCapabilities_Proxy = 0x01 << 3,
    ChatRoomCapabilities_Migratable = 0x01 << 4,
    ChatRoomCapabilities_OneToOne = 0x01 << 5,
    ChatRoomCapabilities_Encrypted = 0x01 << 6
    
};
 
///LinphoneChatRoomEncryptionBackend is used to indicate the encryption engine
///used by a chat room.
typedef NS_OPTIONS(NSUInteger, ChatRoomEncryptionBackend) {
 
    ChatRoomEncryptionBackend_None = 0x00,
    ChatRoomEncryptionBackend_Lime = 0x01 << 0,
 
    
};
 
///TODO move to encryption engine object when available
///LinphoneChatRoomSecurityLevel is used to indicate the encryption security level
///of a chat room.
typedef NS_ENUM(NSInteger,ChatRoomSecurityLevel) {
    Unsafe = 0,
    /// No encryption.
    ClearText = 1,
    /// Encrypted.
    Encrypted = 2,
    /// Encrypted and verified.
    Safe = 3
};
 
///LinphoneGlobalState describes the global state of the `Core` object.
typedef NS_ENUM(NSInteger,ConfiguringState) {
    Successful = 0,
    Failed = 1,
    Skipped = 2
};
///Consolidated presence information: 'online' means the user is open for
///communication, 'busy' means the user is open for communication but involved in
///an other activity, 'do not disturb' means the user is not open for
///communication, and 'offline' means that no presence information is available.
typedef NS_ENUM(NSInteger,ConsolidatedPresence) {
    Online = 0,
    Busy = 1,
    DoNotDisturb = 2,
    Offline = 3
    
};
 
///Enum describing the result of the echo canceller calibration process.
typedef NS_ENUM(NSInteger,EcCalibratorStatus) {
    /// The echo canceller calibration process is on going.
    InProgress = 0,
    /// The echo canceller calibration has been performed and produced an echo delay
    /// measure.
    Done = 1,
    /// The echo canceller calibration process has failed.
    EcCalibratorStatus_Failed = 2,
    /// The echo canceller calibration has been performed and no echo has been
    /// detected.
    DoneNoEcho = 3
 
    
};
 
///LinphoneEventLogType is used to indicate the type of an event.
typedef NS_ENUM(NSInteger,EventLogType) {
    /// No defined event.
    None = 0,
    /// Conference (created) event.
    ConferenceCreated = 1,
    /// Conference (terminated) event.
    ConferenceTerminated = 2,
    /// Conference call (start) event.
    ConferenceCallStart = 3,
    /// Conference call (end) event.
    ConferenceCallEnd = 4,
    /// Conference chat message event.
    ConferenceChatMessage = 5,
    /// Conference participant (added) event.
    ConferenceParticipantAdded = 6,
    /// Conference participant (removed) event.
    ConferenceParticipantRemoved = 7,
    /// Conference participant (set admin) event.
    ConferenceParticipantSetAdmin = 8,
    /// Conference participant (unset admin) event.
    ConferenceParticipantUnsetAdmin = 9,
    /// Conference participant device (added) event.
    ConferenceParticipantDeviceAdded = 10,
    /// Conference participant device (removed) event.
    ConferenceParticipantDeviceRemoved = 11,
    /// Conference subject event.
    ConferenceSubjectChanged = 12,
    /// Conference encryption security event.
    ConferenceSecurityEvent = 13,
    /// Conference ephemeral message (ephemeral message lifetime changed) event.
    ConferenceEphemeralMessageLifetimeChanged = 14,
    /// Conference ephemeral message (ephemeral message enabled) event.
    ConferenceEphemeralMessageEnabled = 15,
    /// Conference ephemeral message (ephemeral message disabled) event.
    ConferenceEphemeralMessageDisabled = 16
    
};
 
typedef NS_OPTIONS(NSUInteger, FriendCapability) {
 
    FriendCapability_None = 0x00,
    FriendCapability_GroupChat = 0x01 << 0,
    FriendCapability_LimeX3Dh = 0x01 << 1,
    FriendCapability_EphemeralMessages = 0x01 << 2
    
};
 
///LinphoneGlobalState describes the global state of the `Core` object.
typedef NS_ENUM(NSInteger,GlobalState) {
    /// State in which we're in after {@link Core#stop}.
    Off = 0,
    /// Transient state for when we call {@link Core#start}
    Startup = 1,
    /// Indicates `Core` has been started and is up and running.
    On = 2,
    /// Transient state for when we call {@link Core#stop}
    Shutdown = 3,
    /// Transient state between Startup and On if there is a remote provisionning URI
    /// configured.
    Configuring = 4,
    /// `Core` state after being created by linphone_factory_create_core, generally
    /// followed by a call to {@link Core#start}
    Ready = 5
    
};
 
///Enum describing ICE states.
typedef NS_ENUM(NSInteger,IceState) {
    /// ICE has not been activated for this call or stream.
    NotActivated = 0,
    /// ICE processing has failed.
    IceState_Failed = 1,
    /// ICE process is in progress.
    IceState_InProgress = 2,
    /// ICE has established a direct connection to the remote host.
    HostConnection = 3,
    /// ICE has established a connection to the remote host through one or several
    /// NATs.
    ReflexiveConnection = 4,
    /// ICE has established a connection through a relay.
    RelayConnection = 5
    
};
 
typedef NS_ENUM(NSInteger,LimeState) {
    /// Lime is not used at all.
    LimeState_Disabled = 0,
    /// Lime is always used.
    Mandatory = 1,
    /// Lime is used only if we already shared a secret with remote.
    Preferred = 2
    
};
 
typedef NS_ENUM(NSInteger,LogCollectionState) {
    LogCollectionState_Disabled = 0,
    LogCollectionState_Enabled = 1,
    EnabledWithoutPreviousLogHandler = 2
};
 
///Verbosity levels of log messages.
typedef NS_OPTIONS(NSUInteger, LogLevel) {
 
    LogLevel_Debug = 0x01,
    LogLevel_Trace = 0x01 << 1,
    LogLevel_Message = 0x01 << 2,
    LogLevel_Warning = 0x01 << 3,
    LogLevel_Error = 0x01 << 4,
    LogLevel_Fatal = 0x01 << 5
};
 
///Indicates for a given media the stream direction.
typedef NS_ENUM(NSInteger,MediaDirection) {
     Invalid = -1,
     Inactive = 0,
    /// No active media not supported yet.
     SendOnly = 1,
    /// Send only mode.
     RecvOnly = 2,
    /// recv only mode
     SendRecv = 3,
};
 
///Enum describing type of media encryption types.
typedef NS_ENUM(NSInteger,MediaEncryption) {
     /// No media encryption is used.
      MediaEncryption_None = 0,
     /// Use SRTP media encryption.
      SRTP = 1,
     /// Use ZRTP media encryption.
      ZRTP = 2,
     /// Use DTLS media encryption.
      DTLS = 3,
 
};
 
///Activities as defined in section 3.2 of RFC 4480.
typedef NS_ENUM(NSInteger,PresenceActivityType) {
     /// The person has a calendar appointment, without specifying exactly of what type.
      Appointment = 0,
     /// The person is physically away from all interactive communication devices.
      Away = 1,
     /// The person is eating the first meal of the day, usually eaten in the morning.
      Breakfast = 2,
     /// The person is busy, without further details.
      PresenceActivityType_Busy = 3,
     /// The person is having his or her main meal of the day, eaten in the evening or
     /// at midday.
      Dinner = 4,
     /// This is a scheduled national or local holiday.
      Holiday = 5,
     /// The person is riding in a vehicle, such as a car, but not steering.
      InTransit = 6,
     /// The person is looking for (paid) work.
      LookingForWork = 7,
     /// The person is eating his or her midday meal.
      Lunch = 8,
     /// The person is scheduled for a meal, without specifying whether it is breakfast,
     /// lunch, or dinner, or some other meal.
      Meal = 9,
     /// The person is in an assembly or gathering of people, as for a business, social,
     /// or religious purpose.
      Meeting = 10,
     /// The person is talking on the telephone.
      OnThePhone = 11,
     /// The person is engaged in an activity with no defined representation.
      Other = 12,
     /// A performance is a sub-class of an appointment and includes musical,
     /// theatrical, and cinematic performances as well as lectures.
      Performance = 13,
     /// The person will not return for the foreseeable future, e.g., because it is no
     /// longer working for the company.
      PermanentAbsence = 14,
     /// The person is occupying himself or herself in amusement, sport, or other
     /// recreation.
      Playing = 15,
     /// The person is giving a presentation, lecture, or participating in a formal
     /// round-table discussion.
      Presentation = 16,
     /// The person is visiting stores in search of goods or services.
      Shopping = 17,
     /// The person is sleeping.
      Sleeping = 18,
     /// The person is observing an event, such as a sports event.
      Spectator = 19,
     /// The person is controlling a vehicle, watercraft, or plane.
      Steering = 20,
     /// The person is on a business or personal trip, but not necessarily in-transit.
      Travel = 21,
     /// The person is watching television.
      TV = 22,
     /// The activity of the person is unknown.
      Unknown = 23,
     /// A period of time devoted to pleasure, rest, or relaxation.
      Vacation = 24,
     /// The person is engaged in, typically paid, labor, as part of a profession or
     /// job.
      Working = 25,
     /// The person is participating in religious rites.
      Worship = 26
 
};
 
///Basic status as defined in section 4.1.4 of RFC 3863.
typedef NS_ENUM(NSInteger,PresenceBasicStatus) {
     /// This value means that the associated contact element, if any, is ready to
     /// accept communication.
      Open = 0,
     /// This value means that the associated contact element, if any, is unable to
     /// accept communication.
      Closed = 1
};
 
typedef NS_ENUM(NSInteger,Privacy) {
     /// Privacy services must not perform any privacy function.
      Privacy_None = 0,
     /// Request that privacy services provide a user-level privacy function.
      User = 1,
     /// Request that privacy services modify headers that cannot be set arbitrarily by
     /// the user (Contact/Via).
      Header = 2,
     /// Request that privacy services provide privacy for session media.
      Session = 4,
     /// rfc3325 The presence of this privacy type in a Privacy header field indicates
     /// that the user would like the Network Asserted Identity to be kept private with
     /// respect to SIP entities outside the Trust Domain with which the user
     /// authenticated.
      Id = 8,
     /// Privacy service must perform the specified services or fail the request.
      Critical = 16,
     /// Special keyword to use privacy as defined either globally or by proxy using
     /// {@link ProxyConfig#setPrivacy}
      Privacy_Default = 32768
};
 
///Enum for publish states.
typedef NS_ENUM(NSInteger,PublishState) {
     /// Initial state, do not use.
      PublishState_None = 0,
     /// An outgoing publish was created and submitted.
      Progress = 1,
     /// Publish is accepted.
      PublishState_Ok = 2,
     /// Publish encoutered an error, {@link Event#getReason} gives reason code.
      Error = 3,
     /// Publish is about to expire, only sent if [sip]->refresh_generic_publish
     /// property is set to 0.
      Expiring = 4,
     /// Event has been un published.
      Cleared = 5
};
 
///Enum describing various failure reasons or contextual information for some
///events.
typedef NS_ENUM(NSInteger,Reason) {
     /// No reason has been set by the core.
      Reason_None = 0,
     /// No response received from remote.
      NoResponse = 1,
     /// Authentication failed due to bad credentials or resource forbidden.
      Forbidden = 2,
     /// The call has been declined.
      Declined = 3,
     /// Destination of the call was not found.
      NotFound = 4,
     /// The call was not answered in time (request timeout)
      NotAnswered = 5,
     /// Phone line was busy.
      Reason_Busy = 6,
     /// Unsupported content.
      UnsupportedContent = 7,
     /// Transport error: connection failures, disconnections etc...
      IOError = 8,
     /// Do not disturb reason.
      Reason_DoNotDisturb = 9,
     /// Operation is unauthorized because missing credential.
      Unauthorized = 10,
     /// Operation is rejected due to incompatible or unsupported media parameters.
      NotAcceptable = 11,
     /// Operation could not be executed by server or remote client because it didn't
     /// have any context for it.
      NoMatch = 12,
     /// Resource moved permanently.
      MovedPermanently = 13,
     /// Resource no longer exists.
      Gone = 14,
     /// Temporarily unavailable.
      TemporarilyUnavailable = 15,
     /// Address incomplete.
      AddressIncomplete = 16,
     /// Not implemented.
      NotImplemented = 17,
     /// Bad gateway.
      BadGateway = 18,
     /// The received request contains a Session-Expires header field with a duration
     /// below the minimum timer.
      SessionIntervalTooSmall = 19,
     /// Server timeout.
      ServerTimeout = 20,
     /// Unknown reason.
      Reason_Unknown = 21
};
 
///LinphoneRegistrationState describes proxy registration states.
typedef NS_ENUM(NSInteger,RegistrationState) {
     /// Initial state for registrations.
      RegistrationState_None = 0,
     /// Registration is in progress.
      RegistrationState_Progress = 1,
     /// Registration is successful.
      RegistrationState_Ok = 2,
     /// Unregistration succeeded.
      RegistrationState_Cleared = 3,
     /// Registration failed.
      RegistrationState_Failed = 4
};
///LinphoneSecurityEventType is used to indicate the type of security event.
typedef NS_ENUM(NSInteger,SecurityEventType) {
     /// Event is not a security event.
      SecurityEventType_None = 0,
     /// Chatroom security level downgraded event.
      SecurityLevelDowngraded = 1,
     /// Participant has exceeded the maximum number of device event.
      ParticipantMaxDeviceCountExceeded = 2,
     /// Peer device instant messaging encryption identity key has changed event.
      EncryptionIdentityKeyChanged = 3,
     /// Man in the middle detected event.
      ManInTheMiddleDetected = 4,
};
 
///Session Timers refresher.
typedef NS_ENUM(NSInteger,SessionExpiresRefresher) {
    Unspecified = 0,
    UAS = 1,
    UAC = 2
    
};
 
 
///Enum describing the stream types.
typedef NS_ENUM(NSInteger,StreamType) {
     Audio = 0,
     Video = 1,
     Text = 2,
     StreamType_Unknown = 3
    
};
 
 
///Enum controlling behavior for incoming subscription request.
typedef NS_ENUM(NSInteger,SubscribePolicy) {
     /// Does not automatically accept an incoming subscription request.
      SPWait = 0,
     /// Rejects incoming subscription request.
      SPDeny = 1,
     /// Automatically accepts a subscription request.
      SPAccept = 2
};
 
///Enum for subscription direction (incoming or outgoing).
typedef NS_ENUM(NSInteger,SubscriptionDir) {
     /// Incoming subscription.
      Incoming = 0,
     /// Outgoing subscription.
      Outgoing = 1,
     /// Invalid subscription direction.
      InvalidDir = 2
};
 
 
///Enum for subscription states.
typedef NS_ENUM(NSInteger,SubscriptionState) {
     /// Initial state, should not be used.
      SubscriptionState_None = 0,
     /// An outgoing subcription was sent.
      SubscriptionState_OutgoingProgress = 1,
     /// An incoming subcription is received.
      SubscriptionState_IncomingReceived = 2,
     /// Subscription is pending, waiting for user approval.
      SubscriptionState_Pending = 3,
     /// Subscription is accepted.
      SubscriptionState_Active = 4,
     /// Subscription is terminated normally.
      SubscriptionState_Terminated = 5,
     /// Subscription was terminated by an error, indicated by {@link Event#getReason}
      SubscriptionState_Error = 6,
     /// Subscription is about to expire, only sent if [sip]->refresh_generic_subscribe
     /// property is set to 0.
      SubscriptionState_Expiring = 7
};
 
///Enum listing frequent telephony tones.
typedef NS_ENUM(NSInteger,ToneID) {
     /// Not a tone.
      Undefined = 0,
     /// Busy tone.
      ToneID_Busy = 1,
      CallWaiting = 2,
     /// Call waiting tone.
      CallOnHold = 3,
     /// Call on hold tone.
      CallLost = 4
    
};
 
 
///Enum describing transport type for LinphoneAddress.
typedef NS_ENUM(NSInteger,TransportType) {
      Udp = 0,
      Tcp = 1,
      TransportType_Tls = 2,
      Dtls = 3
};
 
///Enum describing uPnP states.
typedef NS_ENUM(NSInteger,UpnpState) {
      /// uPnP is not activate
       Idle = 0,
      /// uPnP process is in progress
       Pending = 1,
      /// Internal use: Only used by port binding.
       Adding = 2,
      /// Internal use: Only used by port binding.
       Removing = 3,
      /// uPnP is not available
       NotAvailable = 4,
      /// uPnP is enabled
       UpnpState_Ok = 5,
      /// uPnP processing has failed
       Ko = 6,
      /// IGD router is blacklisted.
       Blacklisted = 7
 
};
 
///Enum describing the result of a version update check.
typedef NS_ENUM(NSInteger,VersionUpdateCheckResult) {
   UpToDate = 0,
   NewVersionAvailable = 1,
   VersionUpdateCheckResult_Error = 2
    
};
 
///Enum describing the types of argument for LinphoneXmlRpcRequest.
typedef NS_ENUM(NSInteger,XmlRpcArgType) {
    XmlRpcArgType_None = 0,
    Int = 1,
    String = 2,
    StringStruct = 3
    
};
 
///Enum describing the status of a LinphoneXmlRpcRequest.
typedef NS_ENUM(NSInteger,XmlRpcStatus) {
     XmlRpcStatus_Pending = 0,
     XmlRpcStatus_Ok = 1,
     XmlRpcStatus_Failed = 2
    
};
///Enum describing the ZRTP SAS validation status of a peer URI.
typedef NS_ENUM(NSInteger,ZrtpPeerStatus) {
     /// Peer URI unkown or never validated/invalidated the SAS.
      ZrtpPeerStatus_Unknown = 0,
     /// Peer URI SAS rejected in database.
      ZrtpPeerStatus_Invalid = 1,
     /// Peer URI SAS validated in database.
      Valid = 2
};
 
/// Class basic linphone class
@interface LinphoneObject : NSObject
@property (assign, nonatomic) LinphoneConfig *cPtr;
@property (assign, nonatomic) belle_sip_object_t *cPtr1;
 
-(instancetype)initWith:(belle_sip_object_t*)cPointer;
@end
 
@interface Config : LinphoneObject
+(instancetype)getSwiftObject:(LinphoneConfig*)cPointer;
-(void)setString:(NSString *)section key:(NSString *)key value:(NSString *)value;
-(NSString *)getString:(NSString *)section key:(NSString *)key defaultString:(NSString *)defaultString;
-(void)setInt:(NSString *)section key:(NSString *)key value:(int)value;
-(int)getInt:(NSString *)section key:(NSString *)key defaultValue:(int)defaultValue;
@end
 
 
@interface LinPhoneWraper : NSObject
+(NSString *) charArrayToString:(nullable const char *)charPointer;
@end
 
NS_ASSUME_NONNULL_END