using System.Runtime.Serialization; using StreamBox.Lib.Server.Codes; namespace StreamBox.Lib.Server.Linkage { [DataContract] public class CallOverview { [DataMember(Name = "terminateReason")] public TerminateReasonTp TerminateReason { get; set; } [DataMember(Name = "incomingTime", EmitDefaultValue = false)] public string IncomingTime { get; set; } [DataMember(Name = "ringingTime", EmitDefaultValue = false)] public string RingingTime { get; set; } [DataMember(Name = "connectTime", EmitDefaultValue = false)] public string ConnectTime { get; set; } [DataMember(Name = "terminateTime", EmitDefaultValue = false)] public string TerminateTime { get; set; } [DataMember(Name = "talkingSec", EmitDefaultValue = false)] public int? TalkingSec { get; set; } [DataMember(Name = "chargePrice", EmitDefaultValue = false)] public int? ChargePrice { get; set; } [DataMember(Name = "chargeUnitSec", EmitDefaultValue = false)] public int? ChargeUnitSec { get; set; } [DataMember(Name = "pointPrice", EmitDefaultValue = false)] public int? PointPrice { get; set; } [DataMember(Name = "startPoint", EmitDefaultValue = false)] public int? StartPoint { get; set; } [DataMember(Name = "talkingPoint", EmitDefaultValue = false)] public int? TalkingPoint { get; set; } [DataMember(Name = "autoChargePoint", EmitDefaultValue = false)] public int? AutoChargePoint { get; set; } [DataMember(Name = "outsideUsagePoint", EmitDefaultValue = false)] public int? OutsideUsagePoint { get; set; } } [DataContract] public class CallUser { [DataMember(Name = "userId")] public string UserId { get; set; } [DataMember(Name = "userSubId", EmitDefaultValue = false)] public string UserSubId { get; set; } [DataMember(Name = "uaTp", EmitDefaultValue = false)] public UaTp? UaTp { get; set; } [DataMember(Name = "phoneNo", EmitDefaultValue = false)] public string PhoneNo { get; set; } [DataMember(Name = "viaPstn", EmitDefaultValue = false)] public bool? ViaPstn { get; set; } [DataMember(Name = "did", EmitDefaultValue = false)] public string Did { get; set; } [DataMember(Name = "deviceName", EmitDefaultValue = false)] public string DeviceName { get; set; } [DataMember(Name = "osVer", EmitDefaultValue = false)] public string OsVer { get; set; } [DataMember(Name = "appVer", EmitDefaultValue = false)] public string AppVer { get; set; } } [DataContract] public class LinkCallService : LinkSite { [DataMember(Name = "crn")] public long Crn { get; set; } [DataMember(Name = "callServiceTp")] public CallServiceTp CallService { get; set; } [DataMember(Name = "callToken")] public string CallToken { get; set; } [DataMember(Name = "caller", EmitDefaultValue = false)] public CallUser Caller { get; set; } [DataMember(Name = "Callee", EmitDefaultValue = false)] public CallUser Callee { get; set; } [DataMember(Name = "videoCall", EmitDefaultValue = false)] public bool? VideoCall { get; set; } [DataMember(Name = "callStatusTime")] public string CallStatusTime { get; set; } [DataMember(Name = "callOverview")] public CallOverview CallOverview { get; set; } // for remain report [IgnoreDataMember] public string CallerJson { get; set; } [IgnoreDataMember] public string CalleeJson { get; set; } [IgnoreDataMember] public string CallOverviewJson { get; set; } public LinkCallService( CallServiceTp callService, long crn, string siteToken, string callToken, string callStatusTime) : base(siteToken, allowRetry: callService == CallServiceTp.Terminated) { CallService = callService; Crn = crn; CallToken = callToken; CallStatusTime = callStatusTime; } // fo redis public LinkCallService() { } public override string ToString() { return $"service:{CallService} crn:{Crn} callToken:{CallToken}"; } } }