//
//  YCKCallInfo.h
//  YCKit
//
//  Created by 徐家骏 on 2019/7/2.
//  Copyright © 2019 徐家骏. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(uint16_t, YCKParticipantState)
{
    YCKParticipantStateIdle     = 0,
    YCKParticipantStateCalling  = 1,
    YCKParticipantStateCalled   = 2,
    YCKParticipantStateIncall   = 4,
};

typedef NS_ENUM(uint16_t, YCKParticipantEvent)
{
    YCKParticipantEventInvite     = 1,
    YCKParticipantEventRecvInvite = 2,
    YCKParticipantEventCancel     = 3,
    YCKParticipantEventRecvCancel = 4,
    YCKParticipantEventAccept     = 5,
    YCKParticipantEventRecvAccept = 6,
    YCKParticipantEventReject     = 7,
    YCKParticipantEventRecvReject = 8,
    YCKParticipantEventBusy       = 9,
    YCKParticipantEventRecvBusy   = 10,
    YCKParticipantEventEnd        = 11,
    YCKParticipantEventRecvEnd    = 12,
    YCKParticipantEventTimout     = 13,
    YCKParticipantEventRing       = 14,
};

@interface YCKCallInfo : NSObject

@property(nonatomic)   YCKCallMode      mode;
@property(nonatomic)   int64_t          session_id;
@property(nonatomic)   int64_t          me;
@property(nonatomic)   int64_t          peer;
@property(nonatomic)   int64_t          opsrc; //通话触发者
@property(nonatomic)   int              net;
@property(nonatomic)   YCKCallMediaType mediaType;
@property(nonatomic)   YCKCallPreset    subType;
@property(nonatomic, strong) NSArray   *callees;
@property(nonatomic, strong) NSArray   *relays;
@property(nonatomic, strong) NSArray   *pubkeys;
@property(nonatomic, strong) NSDictionary *participantInfo;  //多方时的成员信息
@property(nonatomic)   int64_t          lastChangeTime; ///多方时的状态变化时间
@property(nonatomic)   int64_t          lastRelayChangeTime; //Relay列表有更改时的时间戳，客户端每次报告relay performance的时候带上此时间戳，服务器发现上次更改客户端还没收到的话，就需要重发relay更新信令

@property(nonatomic) NSString *msg; //外部携带的消息数据

- (void)clear;

- (NSOrderedSet *)activeParticipants;
- (NSOrderedSet *)newJoin;
- (NSOrderedSet *)newLeave;

@end

NS_ASSUME_NONNULL_END
