50657cb14efa63762265d925fcb050b57c808446
[motion2.git] / server / services / ami / dialer / agentComplete.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x7172=['Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','state','statedesc'];(function(_0x22074f,_0x84b386){var _0x370e5a=function(_0x1b9f87){while(--_0x1b9f87){_0x22074f['push'](_0x22074f['shift']());}};_0x370e5a(++_0x84b386);}(_0x7172,0xd2));var _0x2717=function(_0x365877,_0x428816){_0x365877=_0x365877-0x0;var _0x2ba9ce=_0x7172[_0x365877];return _0x2ba9ce;};'use strict';var util=require('util');var _=require(_0x2717('0x0'));var moment=require(_0x2717('0x1'));function getSeconds(_0x267a21,_0x341bd2){var _0x1344bc=moment(_0x267a21)[_0x2717('0x2')](0x0);var _0x224ea7=moment(_0x341bd2)[_0x2717('0x2')](0x0);return _0x1344bc['diff'](_0x224ea7,'seconds');}function AgentComplete(_0x522493,_0x768762){this[_0x2717('0x3')]=0x4;this[_0x2717('0x4')]=_0x2717('0x5');this[_0x2717('0x6')]=_0x522493[_0x2717('0x6')];this[_0x2717('0x7')]=_0x522493['type'];this[_0x2717('0x8')]=_0x522493[_0x2717('0x7')]==='outbound'?_0x2717('0x9'):_0x522493[_0x2717('0x7')];this[_0x2717('0xa')]=_0x522493[_0x2717('0xa')];this[_0x2717('0xb')]=_0x522493['countcongestionretry'];this['countnoanswerretry']=_0x522493[_0x2717('0xc')];this[_0x2717('0xd')]=_0x522493[_0x2717('0xa')]+_0x522493['countcongestionretry']+_0x522493[_0x2717('0xc')]+_0x522493['countnosuchnumberretry']+_0x522493[_0x2717('0xe')]+_0x522493[_0x2717('0xf')]+_0x522493['countmachineretry']+_0x522493[_0x2717('0x10')];this[_0x2717('0x11')]=_0x522493['countnosuchnumberretry'];this[_0x2717('0xe')]=_0x522493[_0x2717('0xe')];this[_0x2717('0xf')]=_0x522493[_0x2717('0xf')];this[_0x2717('0x12')]=_0x522493['countmachineretry'];this['countagentrejectretry']=_0x522493[_0x2717('0x10')];this['uniqueid']=_0x768762[_0x2717('0x13')];this[_0x2717('0x14')]=_0x522493[_0x2717('0x15')];this[_0x2717('0x16')]=_0x522493[_0x2717('0x17')];this[_0x2717('0x18')]=_0x522493['starttime'];this['responsetime']=_0x522493[_0x2717('0x19')];this[_0x2717('0x1a')]=_0x522493[_0x2717('0x1a')];this['endtime']=moment()[_0x2717('0x1b')](_0x2717('0x1c'));this[_0x2717('0x1d')]=getSeconds(_0x522493[_0x2717('0x19')],_0x522493['starttime']);this[_0x2717('0x1e')]=getSeconds(_0x522493[_0x2717('0x1a')],_0x522493[_0x2717('0x19')]);this[_0x2717('0x1f')]=getSeconds(this[_0x2717('0x20')],_0x522493[_0x2717('0x1a')]);this[_0x2717('0x9')]=_0x768762[_0x2717('0x9')];this[_0x2717('0x21')]=_0x768762['membername'];this['reason']=_0x768762[_0x2717('0x22')];this['callback']=_0x522493[_0x2717('0x23')];this['callbackuniqueid']=_0x522493[_0x2717('0x24')];this[_0x2717('0x25')]=_0x522493['callbackat'];this[_0x2717('0x26')]=_0x522493[_0x2717('0x26')];this['ContactId']=_0x522493['ContactId'];this[_0x2717('0x27')]=_0x522493[_0x2717('0x27')];this['UserId']=_0x522493['UserId'];this[_0x2717('0x28')]=_0x522493[_0x2717('0x28')];this['CampaignId']=_0x522493['CampaignId'];this['originatecalleridnum']=_0x522493[_0x2717('0x29')]||'';this[_0x2717('0x2a')]=_0x522493[_0x2717('0x2a')]||'';}module['exports']=AgentComplete;