using Microsoft.VisualBasic; using RestSharp; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.Json.Serialization; using System.Threading.Tasks; namespace Tr.Sdk.Tels { public class QueryTelStateRequest : TrRequest { public override Method HttpMethod() => Method.Get; public override string Path() => $"api/ola/agents/{TelNo}"; /// /// 分机号 /// [RequestProperty(Name = "extn")] public string? TelNo { get; set; } /// /// 需查询状态 /// [RequestProperty(Name = "state")] public string? State { get; set; } } public class QueryTelStateResponse { [JsonPropertyName("count")] public string Count { get; set; } [JsonPropertyName("agents")] public List? AgentList { get; set; } [JsonPropertyName("agent")] public List? Agents { get; set; } } public class Agent { /// /// ID /// [JsonPropertyName("id")] public string? Id { get; set; } /// /// 分机号 /// [JsonPropertyName("extn")] public string? TelNo { get; set; } /// /// 通道流水 /// [JsonPropertyName("channel_uuid")] public string? ChannelUUid { get; set; } /// /// 鉴权用户名 /// [JsonPropertyName("name")] public string? TelName { get; set; } /// /// 分机状态机类型 /// [JsonPropertyName("type")] public string? Type { get; set; } /// /// 权重 /// [JsonPropertyName("weight")] public string? Weight { get; set; } /// /// 所在呼叫组 /// [JsonPropertyName("queue")] public string? Queue { get; set; } /// /// 分机状态 /// [JsonPropertyName("state")] public string? State { get; set; } /// /// 前一状态 /// [JsonPropertyName("old_state")] public string? OldState { get; set; } /// /// 注册设备 /// [JsonPropertyName("device")] public string? Device { get; set; } /// /// 注册IP /// [JsonPropertyName("sip_ip")] public string? SipIp { get; set; } /// /// 二级状态 /// [JsonPropertyName("private_data")] public string? PrivateData { get; set; } /// /// 是否注册 /// [JsonPropertyName("sip_state")] public string? SipState { get; set; } /// /// 签入时间 /// [JsonPropertyName("created_at")] public string? CreatedAt { get; set; } /// /// 状态变更时间 /// [JsonPropertyName("updated_at")] public string? UpdatedAt { get; set; } /// /// 呼叫方向 /// [JsonPropertyName("call_direction")] public string? CallDirection { get; set; } /// /// 呼叫号码 /// [JsonPropertyName("other_number")] public string? OtherNumber { get; set; } /// /// 使用线路 /// [JsonPropertyName("gateway")] public string? GateWay { get; set; } /// /// 接听时间 /// [JsonPropertyName("answered_at")] public string? AnsweredAt { get; set; } } }