TP-89230 | universal call sdk
This commit is contained in:
@@ -138,7 +138,7 @@ export const setAutoStatus = (sessionId: string) => {
|
||||
return getResponseWithoutCors({
|
||||
url: `${window.BASE_AMEYO_URL}/ameyorestapi/cc/setAutoStatusForUser`,
|
||||
method: 'POST',
|
||||
requestKey: RequestKeys.SIP_ACCOUNT_INFO,
|
||||
requestKey: RequestKeys.SET_AUTO_STATUS,
|
||||
requestType: RequestType.JSON,
|
||||
data: { userSessionId: sessionId, status: true },
|
||||
headers: {
|
||||
|
||||
@@ -4,12 +4,13 @@ import {AmeyoInitializationOptions, RequestKeys, StateType} from "./types.ts";
|
||||
import MessagingType from "../types/MessagingType.ts";
|
||||
import {
|
||||
ameyoHangupUser,
|
||||
//attachOmniqueService, autoSelectExtension,
|
||||
attachOmniqueService,
|
||||
autoSelectExtension,
|
||||
getSipAccountInfo,
|
||||
loginInAmeyo,
|
||||
//selectCampaign,
|
||||
selectCampaign,
|
||||
setAgentActive, setAgentOnBreak,
|
||||
//setAutoStatus
|
||||
setAutoStatus
|
||||
} from "./api.ts";
|
||||
import {
|
||||
acceptSipCall,
|
||||
@@ -96,26 +97,26 @@ class AmeyoAdapter implements IAdapter {
|
||||
this.sipAccountInfo = payload?.data?.response;
|
||||
setAgentActive(this.sessionId);
|
||||
}
|
||||
// if(payload?.data?.requestKey === RequestKeys.AMEYO_AVAILABLE) {
|
||||
// setAutoStatus(this.sessionId);
|
||||
// attachOmniqueService(this.sessionId, this.userName.toLowerCase());
|
||||
//
|
||||
// }
|
||||
// if (payload?.data?.requestKey === RequestKeys.OMNIQUEUE_SERVICE) {
|
||||
// selectCampaign(this.sessionId, this.userName.toLowerCase());
|
||||
// }
|
||||
// if(payload?.data?.requestKey === RequestKeys.SELECT_CAMPAIGN) {
|
||||
// console.log('campaign selected', payload?.data?.response);
|
||||
// autoSelectExtension(this.sessionId, this.userName.toLowerCase());
|
||||
//
|
||||
// }
|
||||
// if(payload?.data?.requestKey === RequestKeys.AUTO_SELECT_EXTENSION) {
|
||||
// console.log('auto select extension', payload?.data?.response);
|
||||
// setAutoStatus(this.sessionId)
|
||||
// }
|
||||
// if(payload?.data?.requestKey === RequestKeys.AMEYO_ON_BREAK) {
|
||||
// setAutoStatus(this.sessionId);
|
||||
// }
|
||||
if(payload?.data?.requestKey === RequestKeys.AMEYO_AVAILABLE) {
|
||||
setAutoStatus(this.sessionId);
|
||||
attachOmniqueService(this.sessionId, this.userName.toLowerCase());
|
||||
|
||||
}
|
||||
if (payload?.data?.requestKey === RequestKeys.OMNIQUEUE_SERVICE) {
|
||||
selectCampaign(this.sessionId, this.userName.toLowerCase());
|
||||
}
|
||||
if(payload?.data?.requestKey === RequestKeys.SELECT_CAMPAIGN) {
|
||||
console.log('campaign selected', payload?.data?.response);
|
||||
autoSelectExtension(this.sessionId, this.userName.toLowerCase());
|
||||
|
||||
}
|
||||
if(payload?.data?.requestKey === RequestKeys.AUTO_SELECT_EXTENSION) {
|
||||
console.log('auto select extension', payload?.data?.response);
|
||||
setAutoStatus(this.sessionId)
|
||||
}
|
||||
if(payload?.data?.requestKey === RequestKeys.AMEYO_ON_BREAK) {
|
||||
setAutoStatus(this.sessionId);
|
||||
}
|
||||
}
|
||||
|
||||
_registerMessageListener = async ({ data }: GenericObject) => {
|
||||
|
||||
@@ -19,7 +19,8 @@ export enum RequestKeys {
|
||||
OMNIQUEUE_SERVICE = 'ameyo_omniqueue',
|
||||
SELECT_CAMPAIGN = 'select_campaign',
|
||||
HANGUP_USER = 'hangup_user',
|
||||
AUTO_SELECT_EXTENSION = 'auto_select_extension'
|
||||
AUTO_SELECT_EXTENSION = 'auto_select_extension',
|
||||
SET_AUTO_STATUS = "set_auto_status"
|
||||
}
|
||||
|
||||
export type AmeyoInitializationOptions = {
|
||||
|
||||
Reference in New Issue
Block a user