/** * Agent Commands */ export declare type AllowOperation = "make" | "answer" | "hangup" | "hold" | "unhold" | "consult" | "single_step_transfer" | "single_step_three_parties" | "agent_evaluate" | "transfer_agent_group" | "cancel_consult" | "complete_transfer" | "complete_three_parties" | "create_conference" | "add_conference_member" | "leave_conference" | "login" | "logout" | "status" | "force_busy" | "force_free" | "force_logout" | "force_whisper" | "force_listen" | "force_conference" | "force_hangup"; export declare type BaseAgentCommand = Readonly<{ agent_id: string; host: string; }>; declare type BaseCallCommand = BaseAgentCommand & Readonly<{ call_uuid: string; }>; export declare const STATUS_READY = "0"; export declare const STATUS_NOT_READY = "1"; export declare const STATUS_AFTER_WORK = "2"; export declare const STATUS_REST = "3"; export declare const STATUS_DINNER = "4"; export declare const STATUS_TRAINING = "5"; export declare const STATUS_RINGING = "6"; export declare const STATUS_MEETING = "7"; export declare const STATUS_LOGOUT = "10"; export declare const STATUS_LOGIN = "11"; export declare const STATUS_TALKING = "12"; export declare const STATUS_OUTBOUND = "13"; export declare const STATUS_MONITOR_FORCE_WLC = "14"; declare const all_agent_status: readonly ["0", "1", "2", "3", "4", "5", "6", "10", "11", "12", "7", "13", "14"]; export declare type EnumAgentStatus = typeof all_agent_status[number]; export interface GatewaysInfo { desc: string; prefix: string; gateway_id: string; trunk_number: string; prefix_bridge: string; } export declare type MemberStatusType = { [key: string]: EnumAgentStatus; }; export declare const agentStatusText: (status: EnumAgentStatus) => string; export declare type LoginQueue = Readonly<{ queue_id: string; is_monitor: boolean; }>; export declare type CheckRegisteredCommand = BaseAgentCommand & Readonly<{ type: "CheckRegistered"; extension: string; belong_queues: ReadonlyArray; }>; export declare type LoginCommand = BaseAgentCommand & Readonly<{ type: "Login"; extension: string; password: string; is_after_call: boolean; }>; export declare type LogoutCommand = BaseAgentCommand & Readonly<{ type: "Logout"; extension: string; }>; export declare type SetAgentStatusCommand = BaseAgentCommand & Readonly<{ type: "SetAgentStatus"; extension: string; status: EnumAgentStatus; is_after_call: boolean; is_monitor: boolean; }>; export declare type AnswerCallCommand = BaseCallCommand & Readonly<{ type: "AnswerCall"; }>; export declare type TraceCallCommand = BaseCallCommand & Readonly<{ type: "TraceCall"; }>; export declare type HoldCallCommand = BaseCallCommand & Readonly<{ type: "HoldCall"; }>; export declare type UnHoldCallCommand = BaseCallCommand & Readonly<{ type: "UnHoldCall"; }>; export declare type ConsultCallCommand = BaseCallCommand & Readonly<{ type: "ConsultCall"; extension: string; target: string; gateway_id: string; gateway_number: string; prefix_bridge: string; choice: string; customer_uuid: string; }>; export declare type RetrieveCallCommand = BaseCallCommand & Readonly<{ type: "RetrieveCall"; extension: string; }>; export declare type CompleteTransferCommand = BaseCallCommand & Readonly<{ type: "CompleteTransfer"; }>; export declare type CompleteThreePartiesCommand = BaseCallCommand & Readonly<{ type: "CompleteThreeParties"; }>; export declare type CreateConferenceCommand = BaseCallCommand & Readonly<{ type: "CreateConference"; }>; export declare type AddConferenceMemberCommand = BaseCallCommand & Readonly<{ type: "AddConferenceMember"; extension: string; target: string; gateway_id: string; gateway_number: string; prefix_bridge: string; }>; export declare type LeaveConferenceCommand = BaseAgentCommand & Readonly<{ type: "LeaveConference"; extension: string; }>; export declare type MakeCallCommand = BaseAgentCommand & Readonly<{ type: "MakeCall"; extension: string; target: string; gateway_id: string; gateway_number: string; prefix_bridge: string; agent_group: string; }>; export declare type HangupCallCommand = BaseCallCommand & Readonly<{ type: "HangupCall"; }>; export declare type ForceConferenceCommand = BaseCallCommand & Readonly<{ type: "ForceConference"; monitor_dn: string; agent_dn: string; }>; export declare type ForceListenCommand = BaseCallCommand & Readonly<{ type: "ForceListen"; monitor_dn: string; agent_dn: string; }>; export declare type ForceHangUpCommand = BaseCallCommand & Readonly<{ type: "ForceHangUp"; }>; export declare type ForceWhisperCommand = BaseCallCommand & Readonly<{ type: "ForceWhisper"; monitor_dn: string; agent_dn: string; }>; export declare type StartDetectSpeechCommand = BaseCallCommand & Readonly<{ type: "StartDetectSpeech"; }>; export declare type ResumeDetectSpeechCommand = BaseCallCommand & Readonly<{ type: "ResumeDetectSpeech"; }>; export declare type StopDetectSpeechCommand = BaseCallCommand & Readonly<{ type: "StopDetectSpeech"; }>; export declare type SnapShotCommand = BaseCallCommand & Readonly<{ type: "SnapShot"; fileName: string; }>; export declare type PlayVideoCommand = BaseCallCommand & Readonly<{ type: "PlayVideo"; other_uuid: string; fileName: string; isLoop: boolean; isAudio: boolean; }>; export declare type StopVideoCommand = BaseCallCommand & Readonly<{ type: "StopVideo"; other_uuid: string; }>; export declare type RecordCommand = BaseCallCommand & Readonly<{ type: "Record"; fileName: string; }>; export declare type StopRecordCommand = BaseCallCommand & Readonly<{ type: "StopRecord"; }>; export declare type AgentEvaluateCommand = BaseCallCommand & Readonly<{ type: "AgentEvaluate"; evaluate_number: number; }>; export declare type AgentXferGroupCommand = BaseCallCommand & Readonly<{ type: "AgentXferGroup"; evaluate_number: number; }>; export declare type ConsultToQueueCommand = BaseCallCommand & Readonly<{ type: "ConsultToQueue"; target: number; }>; export declare type AgentQueryRecordCommand = BaseAgentCommand & Readonly<{ type: "QueryRecord"; request_id: number; call_uuid: string; caller_number: string; }>; export declare type AgentClientErrorCommand = BaseAgentCommand & Readonly<{ type: "ClientError"; error_message: string; }>; export declare type AgentClientGetMembersStatusByGroupCommand = BaseAgentCommand & Readonly<{ type: "AgentGroupMembersStatus"; group: string; async_id: number; }>; export declare type AgentClientSingleMemberStatusCommand = BaseAgentCommand & Readonly<{ type: "AgentSingleMemberStatus"; scene: string; target: string; async_id: number; }>; export declare type OcrIdCardFrontCommand = BaseCallCommand & Readonly<{ type: "OcrIdCardFront"; fileName: string; }>; export declare type OcrIdCardBackCommand = BaseCallCommand & Readonly<{ type: "OcrIdCardBack"; fileName: string; }>; export declare type OcrBankCardCommand = BaseCallCommand & Readonly<{ type: "OcrBankCard"; fileName: string; }>; export declare type AgentCommand = AnswerCallCommand | TraceCallCommand | CheckRegisteredCommand | CompleteThreePartiesCommand | AddConferenceMemberCommand | LeaveConferenceCommand | CompleteTransferCommand | CreateConferenceCommand | StartDetectSpeechCommand | ResumeDetectSpeechCommand | StopDetectSpeechCommand | ForceConferenceCommand | ForceHangUpCommand | ForceListenCommand | ForceWhisperCommand | SnapShotCommand | PlayVideoCommand | StopVideoCommand | RecordCommand | StopRecordCommand | AgentEvaluateCommand | AgentXferGroupCommand | ConsultToQueueCommand | HangupCallCommand | HoldCallCommand | LoginCommand | LogoutCommand | MakeCallCommand | RetrieveCallCommand | SetAgentStatusCommand | ConsultCallCommand | UnHoldCallCommand | AgentQueryRecordCommand | AgentClientErrorCommand | OcrIdCardFrontCommand | OcrIdCardBackCommand | OcrBankCardCommand | AgentClientGetMembersStatusByGroupCommand | AgentClientSingleMemberStatusCommand; declare let dummy_agent_cmd: AgentCommand; export declare type AgentCommandTransport = Readonly<{ agent_id: string; type: typeof dummy_agent_cmd.type; api_version: string; agent_command?: AgentCommand; routing_key: string; free_switch_command: string | ReadonlyArray; }>; /** * Agent Events */ declare type BaseAgentEvent = Readonly<{ agent_id: string; timestamp: string; }>; declare type BaseCallEvent = BaseAgentEvent & Readonly<{ call_uuid: string; allow: ReadonlyArray; }>; export declare type AgentRegistrationEvent = BaseAgentEvent & Readonly<{ type: "Registration"; }>; export declare type AgentUnRegistrationEvent = BaseAgentEvent & Readonly<{ type: "UnRegistration"; cause: string; }>; export declare type AgentLoginSuccessEvent = BaseAgentEvent & Readonly<{ type: "LoginSuccess"; is_monitor: boolean; monitor_queues: ReadonlyArray; cause: string; }>; export declare type AgentLoginFailedEvent = BaseAgentEvent & Readonly<{ type: "LoginFailed"; cause: string; }>; export declare const WS_CLOSE_NORMAL = 1000; export declare const WS_CLOSE_GOING_AWAY = 1001; export declare const WS_CLOSE_PROTOCOL_ERROR = 1002; export declare const WS_CLOSE_UNSUPPORTED = 1003; export declare const WS_CLOSE_NO_STATUS = 1005; export declare const WS_CLOSE_ABNORMAL = 1006; export declare const WS_CLOSE_TOO_LARGE = 1009; export declare const WS_CLOSE_DUPLICATE = 4801; export declare const WS_CLOSE_SAME_AGENT = 4802; export declare const WS_CLOSE_BY_MONITOR = 4803; export declare const LOGIN_FAILED_DUPLICATE = "login_failed_duplicate"; export declare type AgentLogoutEvent = BaseAgentEvent & Readonly<{ type: "Logout"; code: number; cause: string; allow: ReadonlyArray; }>; export declare type AgentStatusChangeEvent = BaseAgentEvent & Readonly<{ type: "AgentStatusChange"; extension: string; status: EnumAgentStatus; by_monitor: boolean; allow: ReadonlyArray; }>; export declare type AgentStatusSyncEvent = BaseAgentEvent & Readonly<{ type: "AgentStatusSync"; extension: string; status: EnumAgentStatus; }>; export declare type AgentCallRingingEvent = BaseCallEvent & Readonly<{ type: "Ringing"; customer_party: string; queue_id: string; choice: string; is_inbound: boolean; is_internal: boolean; is_consult: boolean; is_video: boolean; trunk_number: string; att_xfer_group: string; }>; export declare type AgentCallTalkingEvent = BaseCallEvent & Readonly<{ type: "Talking"; other_party: string; other_party_uuid: string; customer_party: string; queue_id: string; choice: string; is_inbound: boolean; is_internal: boolean; is_consult: boolean; is_video: boolean; custom_fields: Record; trunk_number: string; }>; export declare type AgentCallHoldEvent = BaseCallEvent & Readonly<{ type: "Hold"; }>; export declare type AgentCallUnHoldEvent = BaseCallEvent & Readonly<{ type: "UnHold"; }>; export declare type AgentCallHangupEvent = BaseCallEvent & Readonly<{ type: "Hangup"; cause: string; call_duration: string; recording_server_url: string; recording_path: string; }>; export declare type AgentCallConsultDialingEvent = BaseCallEvent & Readonly<{ type: "ConsultDialing"; }>; export declare type AgentCallConsultFailEvent = BaseCallEvent & Readonly<{ type: "ConsultFail"; cause: string; }>; export declare type AgentCallConsultEvent = BaseCallEvent & Readonly<{ type: "Consult"; }>; export declare type AgentCallThreePartiesEvent = BaseCallEvent & Readonly<{ type: "ThreeParties"; }>; export declare type ConferenceMemberList = Array<{ member_id: string; conference_member: string; }>; export declare type AgentAddConferenceMemberEvent = Omit; }>, "agent_id">; export declare type AgentLeaveConferenceEvent = Omit; }>, "agent_id">; export declare type EnumExtractInfo = "地址" | "烟雾类型" | ""; export declare type SpeechContent = Readonly<{ id: string; label: "customer" | "agent"; content: string; extract_type: EnumExtractInfo; extract_content: string; }>; export declare type AgentDetectSpeechEvent = BaseAgentEvent & Readonly<{ type: "DetectSpeech"; data: SpeechContent; }>; export declare type AgentQueueAllBusyEvent = Readonly<{ type: "QueueAllBusy"; queue_id: string; is_all_busy: boolean; timestamp: string; }>; export declare type EnumAgentCustomEvent = AgentQueueAllBusyEvent | AgentEarlyHangupEvent | AgentQueueCountEvent; export declare type AgentMatchExtensionStatusType = { [key: string]: AgentMatchExtensionStatus; }; export declare type AgentMatchExtensionStatus = { extension: string; status: EnumAgentStatus; }; export declare type AgentQueueList = { caller: string; timestamp: string; }; export declare type AgentQueueCountEvent = Readonly<{ type: "QueueCount"; queue_id: string; count: number; timestamp: string; queueList: AgentQueueList[]; }>; export declare type AgentMembersStatusByGroupEvent = Readonly<{ type: "AgentGroupMembersStatus"; res: any; }>; export declare type AgentSingleMemberStatusEvent = Readonly<{ type: "AgentSingleMemberStatus"; res: any; }>; export declare type EnumEarlyHangupReason = "黑名单" | "AI挂机" | "排队挂机" | "超时未分配" | "座席未接听"; export declare type AgentEarlyHangupEvent = Readonly<{ type: "EarlyHangup"; customer_party: string; call_uuid: string; queue_id: string; enter_timestamp: string; hangup_timestamp: string; hangup_reason: EnumEarlyHangupReason; }>; export declare type AgentCheckRegisteredEvent = BaseAgentEvent & Readonly<{ type: "CheckRegistered"; is_registered: boolean; }>; export declare type AgentErrorEvent = Readonly<{ type: "AgentError"; code: number; message: string; timestamp: string; }>; export declare type AgentNullEvent = BaseAgentEvent & Readonly<{ type: "AgentNull"; }>; export declare const AGENT_NULL_EVENT: AgentNullEvent; export declare type OcrIdCardFrontEvent = BaseCallEvent & Readonly<{ type: "OcrIdCardFront"; }>; export declare type OrcIdCardBackEvent = BaseCallEvent & Readonly<{ type: "OrcIdCardBack"; }>; export declare type OcrBankCardEvent = BaseCallEvent & Readonly<{ type: "OcrBankCard"; }>; export declare type AgentEvent = AgentCallThreePartiesEvent | AgentCallConsultEvent | AgentCallConsultDialingEvent | AgentCallConsultFailEvent | AgentCallHangupEvent | AgentCallHoldEvent | AgentCallRingingEvent | AgentCallTalkingEvent | AgentCallUnHoldEvent | AgentAddConferenceMemberEvent | AgentLeaveConferenceEvent | AgentDetectSpeechEvent | AgentLoginFailedEvent | AgentLoginSuccessEvent | AgentLogoutEvent | AgentRegistrationEvent | AgentQueueAllBusyEvent | AgentQueueCountEvent | AgentEarlyHangupEvent | AgentStatusChangeEvent | AgentStatusSyncEvent | AgentUnRegistrationEvent | AgentCheckRegisteredEvent | AgentErrorEvent | AgentNullEvent | AgentMembersStatusByGroupEvent | AgentSingleMemberStatusEvent; declare let dummy_agent_event: AgentEvent; export declare type EnumAgentEventType = typeof dummy_agent_event.type; export declare type AgentEventListenerType = (e: AgentEvent) => void; export declare const isAgentQueueAllBusyEvent: (e: any) => e is Readonly<{ type: "QueueAllBusy"; queue_id: string; is_all_busy: boolean; timestamp: string; }>; export declare const isAgentEarlyHangupEvent: (e: any) => e is Readonly<{ type: "EarlyHangup"; customer_party: string; call_uuid: string; queue_id: string; enter_timestamp: string; hangup_timestamp: string; hangup_reason: EnumEarlyHangupReason; }>; export declare const isAgentQueueCountEvent: (e: any) => e is Readonly<{ type: "QueueCount"; queue_id: string; count: number; timestamp: string; queueList: AgentQueueList[]; }>; export declare const isAgentMembersStatusByGroupEvent: (e: any) => e is Readonly<{ type: "AgentGroupMembersStatus"; res: any; }>; export declare const isAgentSingleMemberStatusEvent: (e: any) => e is Readonly<{ type: "AgentSingleMemberStatus"; res: any; }>; export declare const isAgentCustomEvent: (e: any) => e is EnumAgentCustomEvent; export declare const wsCloseCause: (code: number) => "正常登出" | "浏览器页面关闭或跳转,请重新登录" | "因协议错误无法连接服务器,请通知系统管理员" | "因数据类型不支持无法连接服务器,请通知系统管理员" | "因未知原因连接已断连,请重新登录" | "连接非正常关闭,请重新登录" | "因数据帧过大连接已断连,请重新登录并通知系统管理员" | "浏览器重复发起连接,请登出后重新登录" | "同工号在别处登录,本连接被断连" | "已被班长席强制退出" | undefined; export declare const fsHangupCause: (cause: string) => string; export {};