ysyt-agent-sdk 1.0.50 → 1.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ import { SIPClient } from '@/core/sip-client';
2
+ declare class CallApi {
3
+ sipClient: SIPClient | null;
4
+ constructor(sipClient: SIPClient);
5
+ roleMute(): void;
6
+ holdCall(): void;
7
+ unholdCall(): void;
8
+ sendDTMF(tone: string): void;
9
+ cancelCall(): void;
10
+ consultCall(agentNo: string): Promise<void>;
11
+ answerCall(): Promise<void>;
12
+ rejectInCall(): Promise<void>;
13
+ makeCall(number: string): Promise<void>;
14
+ rejectOutCall(): Promise<void>;
15
+ hangup(): Promise<void>;
16
+ mute(): void;
17
+ unmute(): void;
18
+ consultTransfer(): void;
19
+ satisfactionEvaluation(): void;
20
+ startConference(): void;
21
+ consultRetrieve(): void;
22
+ transferAgent(agentNo: string): Promise<void>;
23
+ transferOutline(number: string): Promise<void>;
24
+ }
25
+ export default CallApi;
@@ -10,6 +10,7 @@ import './components/my-select';
10
10
  import './components/my-phone-dialer';
11
11
  import './components/my-modal-wrapper';
12
12
  import './components/my-icon-popup';
13
+ import CallApi from '@/core/call-api';
13
14
  interface Props {
14
15
  container: HTMLElement;
15
16
  rttHTML?: HTMLElement;
@@ -17,6 +18,7 @@ interface Props {
17
18
  }
18
19
  export declare class PhoneView {
19
20
  private VoiceSDKInstance;
21
+ private callApi;
20
22
  private readonly container;
21
23
  private readonly rttHTML?;
22
24
  private apiClient;
@@ -26,9 +28,10 @@ export declare class PhoneView {
26
28
  private modalRoot;
27
29
  private agentStateData;
28
30
  private default_device;
29
- private inCallAudio;
30
- private waitAudio;
31
- constructor({ container, rttHTML, statusParams }: Props, VoiceSDKInstance: YSYTAgentSdk);
31
+ private readonly inCallAudio;
32
+ private readonly waitAudio;
33
+ transferType: string;
34
+ constructor({ container, rttHTML, statusParams }: Props, VoiceSDKInstance: YSYTAgentSdk, callApi: CallApi);
32
35
  private play;
33
36
  private playFromStart;
34
37
  private pause;
@@ -59,6 +62,7 @@ export declare class PhoneView {
59
62
  private renderAnswer;
60
63
  private renderReject;
61
64
  private renderConsultModalToBody;
65
+ private renderTransferModalToBody;
62
66
  private getActionConfigs;
63
67
  private render;
64
68
  private renderRtt;
@@ -35,6 +35,8 @@ declare class YSYTAgentSdk {
35
35
  unmute: () => void;
36
36
  satisfactionEvaluation: () => void;
37
37
  startConference: () => void;
38
+ transferAgent: (agent_no: string) => Promise<void>;
39
+ transferOutline: (number: string) => Promise<void>;
38
40
  };
39
41
  get agent_api(): {
40
42
  changeDevice: (params: RequestBodyType<{
@@ -12,6 +12,7 @@ declare class CallInfoStore extends ReactiveStore<CallInfoType> {
12
12
  updateIncomingIsAnswer(incomingIsAnswer: boolean): void;
13
13
  updateAnswerDevice(answerDevice: CallInfoType['answerDevice']): void;
14
14
  updateIsMeeting(isMeeting: boolean): void;
15
+ updateTransferIsAnswer(transferIsAnswer: boolean): void;
15
16
  reset(): void;
16
17
  getCallInfo(): CallInfoType;
17
18
  get<K extends keyof CallInfoType>(key: K): CallInfoType[K];
@@ -8,7 +8,8 @@ export declare enum DirectionEnum {
8
8
  OUTGOING = "outgoing",
9
9
  INCOMING = "incoming",
10
10
  CONSULT = "consult",
11
- MEETING = "meeting"
11
+ MEETING = "meeting",
12
+ TRANSFER = "transfer"
12
13
  }
13
14
  export declare enum WebRtcCallSipEventEnum {
14
15
  WEB_RTC_CONNECTING = "connecting",
@@ -57,7 +58,12 @@ export declare enum CallSipCallEvent {
57
58
  SATISFACTION_EVALUATION_FAILED = "satisfaction_evaluation_failed",
58
59
  CONSULT_THREE_WAY_SUCCESS = "consult_three_way_success",
59
60
  CONSULT_THREE_WAY_FAILED = "consult_three_way_failed",
60
- THREE_WAY_OUR_SIDE_HANGUP = "three_way_our_side_hangup"
61
+ THREE_WAY_OUR_SIDE_HANGUP = "three_way_our_side_hangup",
62
+ TRANSFER_FAILED = "transfer_failed",
63
+ TRANSFER_PROGRESS = "transfer_progress",
64
+ TRANSFER_INCOMING_CALL = "transfer_incoming_call",
65
+ TRANSFER_OFF_HOOK = "transfer_off_hook",
66
+ TRANSFER_END = "transfer_end"
61
67
  }
62
68
  export declare enum WebsocketTypeEnum {
63
69
  OUT_CALL = 100,
@@ -86,7 +92,11 @@ export declare enum WebsocketTypeEnum {
86
92
  INCOMING_CALL_END = 121,
87
93
  SATISFACTION_EVALUATION = 122,
88
94
  CONSULT_THREE_WAY = 123,
89
- CONSULT_THREE_WAY_RESULT = 124
95
+ CONSULT_THREE_WAY_RESULT = 124,
96
+ TRANSFER = 127,
97
+ TRANSFER_FAILED = 128,
98
+ TRANSFER_INCOMING_CALL = 129,
99
+ TRANSFER_OFF_HOOK = 130
90
100
  }
91
101
  export declare enum EventName {
92
102
  EVENT_ALL = "event_all",
@@ -103,5 +113,7 @@ export declare enum DisplayTextEnum {
103
113
  CONSULTING = "\u6B63\u5728\u54A8\u8BE2",
104
114
  CONSULT_CALL_IN = "\u54A8\u8BE2\u6765\u7535",
105
115
  INCOMING_CALL = "\u5BA2\u6237\u6765\u7535",
106
- MEETING = "\u4F1A\u8BAE\u4E2D"
116
+ MEETING = "\u4F1A\u8BAE\u4E2D",
117
+ TRANSFERRING = "\u8F6C\u63A5\u4E2D",
118
+ TRANSFER_INCOMING_CALL = "\u8F6C\u63A5\u6765\u7535"
107
119
  }
@@ -21,11 +21,12 @@ export type RttObjectType = {
21
21
  };
22
22
  export interface CallInfoType {
23
23
  isCalling: boolean;
24
- direction: DirectionEnum.OUTGOING | DirectionEnum.INCOMING | DirectionEnum.CONSULT | DirectionEnum.MEETING | null;
24
+ direction: DirectionEnum.OUTGOING | DirectionEnum.INCOMING | DirectionEnum.CONSULT | DirectionEnum.MEETING | DirectionEnum.TRANSFER | null;
25
25
  outCallIsAnswer: boolean;
26
26
  consultIsAnswer: boolean;
27
27
  incomingIsAnswer: boolean;
28
28
  isMeeting: boolean;
29
+ transferIsAnswer: boolean;
29
30
  isHold: boolean;
30
31
  displayText: string;
31
32
  isMuted: boolean;