ysyt-agent-sdk 1.0.50 → 1.0.52

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",
@@ -33,6 +34,10 @@ export declare enum CallSipCallEvent {
33
34
  OUT_FAILED = "out_call_failed",
34
35
  OUT_RINGING = "out_call_ringing",
35
36
  OUT_OFF_ANSWER = "out_call_answer",
37
+ HOLD_SUCCESS = "hold_success",
38
+ HOLD_FAILED = "hold_failed",
39
+ UNHOLD_SUCCESS = "unhold_success",
40
+ UNHOLD_FAILED = "unhold_failed",
36
41
  OUT_HANGUP = "out_call_hangup",
37
42
  CONSULT_RINGING = "consult_ringing",
38
43
  CONSULT_OFF_HOOK = "consult_off_hook",
@@ -57,7 +62,12 @@ export declare enum CallSipCallEvent {
57
62
  SATISFACTION_EVALUATION_FAILED = "satisfaction_evaluation_failed",
58
63
  CONSULT_THREE_WAY_SUCCESS = "consult_three_way_success",
59
64
  CONSULT_THREE_WAY_FAILED = "consult_three_way_failed",
60
- THREE_WAY_OUR_SIDE_HANGUP = "three_way_our_side_hangup"
65
+ THREE_WAY_OUR_SIDE_HANGUP = "three_way_our_side_hangup",
66
+ TRANSFER_FAILED = "transfer_failed",
67
+ TRANSFER_PROGRESS = "transfer_progress",
68
+ TRANSFER_INCOMING_CALL = "transfer_incoming_call",
69
+ TRANSFER_OFF_HOOK = "transfer_off_hook",
70
+ TRANSFER_END = "transfer_end"
61
71
  }
62
72
  export declare enum WebsocketTypeEnum {
63
73
  OUT_CALL = 100,
@@ -86,7 +96,11 @@ export declare enum WebsocketTypeEnum {
86
96
  INCOMING_CALL_END = 121,
87
97
  SATISFACTION_EVALUATION = 122,
88
98
  CONSULT_THREE_WAY = 123,
89
- CONSULT_THREE_WAY_RESULT = 124
99
+ CONSULT_THREE_WAY_RESULT = 124,
100
+ TRANSFER = 127,
101
+ TRANSFER_FAILED = 128,
102
+ TRANSFER_INCOMING_CALL = 129,
103
+ TRANSFER_OFF_HOOK = 130
90
104
  }
91
105
  export declare enum EventName {
92
106
  EVENT_ALL = "event_all",
@@ -97,11 +111,14 @@ export declare enum EventName {
97
111
  }
98
112
  export declare enum DisplayTextEnum {
99
113
  RINGING = "\u5BA2\u6237\u632F\u94C3",
100
- HOLD = "\u901A\u8BDD\u4FDD\u6301",
101
114
  AGENT_RINGING = "\u632F\u94C3\u4E2D",
102
115
  CALLING = "\u901A\u8BDD\u4E2D",
103
116
  CONSULTING = "\u6B63\u5728\u54A8\u8BE2",
104
117
  CONSULT_CALL_IN = "\u54A8\u8BE2\u6765\u7535",
105
118
  INCOMING_CALL = "\u5BA2\u6237\u6765\u7535",
106
- MEETING = "\u4F1A\u8BAE\u4E2D"
119
+ MEETING = "\u4F1A\u8BAE\u4E2D",
120
+ TRANSFERRING = "\u8F6C\u63A5\u4E2D",
121
+ TRANSFER_INCOMING_CALL = "\u8F6C\u63A5\u6765\u7535",
122
+ HOLDING = "\u4FDD\u6301\u4E2D",
123
+ MUTING = "\u9759\u97F3\u4E2D"
107
124
  }
@@ -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;