37de5acc18a66e186f304333d6b41387321790d9
[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 _0x587b=['name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname'];(function(_0x2c29fa,_0x4426f5){var _0x4d0e7f=function(_0x4d3fe6){while(--_0x4d3fe6){_0x2c29fa['push'](_0x2c29fa['shift']());}};_0x4d0e7f(++_0x4426f5);}(_0x587b,0x1e4));var _0xb587=function(_0x14b591,_0x356001){_0x14b591=_0x14b591-0x0;var _0x4428bb=_0x587b[_0x14b591];return _0x4428bb;};'use strict';var util=require('util');var _=require(_0xb587('0x0'));var moment=require(_0xb587('0x1'));function getSeconds(_0x27f624,_0x43da63){var _0x39ddc7=moment(_0x27f624)[_0xb587('0x2')](0x0);var _0x5037d3=moment(_0x43da63)[_0xb587('0x2')](0x0);return _0x39ddc7[_0xb587('0x3')](_0x5037d3,_0xb587('0x4'));}function AgentComplete(_0x3d0463,_0x399d9f){this['state']=0x4;this[_0xb587('0x5')]='Answer';this['scheduledat']=_0x3d0463[_0xb587('0x6')];this['type']=_0x3d0463[_0xb587('0x7')];this[_0xb587('0x8')]=_0x3d0463[_0xb587('0x7')]===_0xb587('0x9')?_0xb587('0xa'):_0x3d0463[_0xb587('0x7')];this[_0xb587('0xb')]=_0x3d0463[_0xb587('0xb')];this['countcongestionretry']=_0x3d0463['countcongestionretry'];this[_0xb587('0xc')]=_0x3d0463[_0xb587('0xc')];this[_0xb587('0xd')]=_0x3d0463[_0xb587('0xb')]+_0x3d0463[_0xb587('0xe')]+_0x3d0463[_0xb587('0xc')]+_0x3d0463['countnosuchnumberretry']+_0x3d0463[_0xb587('0xf')]+_0x3d0463[_0xb587('0x10')]+_0x3d0463[_0xb587('0x11')]+_0x3d0463[_0xb587('0x12')];this[_0xb587('0x13')]=_0x3d0463[_0xb587('0x13')];this[_0xb587('0xf')]=_0x3d0463['countdropretry'];this['countabandonedretry']=_0x3d0463[_0xb587('0x10')];this[_0xb587('0x11')]=_0x3d0463[_0xb587('0x11')];this['countagentrejectretry']=_0x3d0463[_0xb587('0x12')];this['uniqueid']=_0x399d9f[_0xb587('0x14')];this[_0xb587('0x15')]=_0x3d0463[_0xb587('0x16')];this[_0xb587('0x17')]=_0x3d0463[_0xb587('0x18')];this[_0xb587('0x19')]=_0x3d0463[_0xb587('0x19')];this[_0xb587('0x1a')]=_0x3d0463[_0xb587('0x1a')];this[_0xb587('0x1b')]=_0x3d0463[_0xb587('0x1b')];this[_0xb587('0x1c')]=moment()[_0xb587('0x1d')](_0xb587('0x1e'));this[_0xb587('0x1f')]=getSeconds(_0x3d0463[_0xb587('0x1a')],_0x3d0463[_0xb587('0x19')]);this[_0xb587('0x20')]=getSeconds(_0x3d0463['answertime'],_0x3d0463[_0xb587('0x1a')]);this['talktime']=getSeconds(this[_0xb587('0x1c')],_0x3d0463['answertime']);this[_0xb587('0xa')]=_0x399d9f['queue'];this['membername']=_0x399d9f[_0xb587('0x21')];this['reason']=_0x399d9f[_0xb587('0x22')];this[_0xb587('0x23')]=_0x3d0463[_0xb587('0x23')];this[_0xb587('0x24')]=_0x3d0463['callbackuniqueid'];this['callbackat']=_0x3d0463['callbackat'];this[_0xb587('0x25')]=_0x3d0463['recallme'];this[_0xb587('0x26')]=_0x3d0463[_0xb587('0x26')];this[_0xb587('0x27')]=_0x3d0463[_0xb587('0x27')];this[_0xb587('0x28')]=_0x3d0463[_0xb587('0x28')];this[_0xb587('0x29')]=_0x3d0463['VoiceQueueId'];this[_0xb587('0x2a')]=_0x3d0463[_0xb587('0x2a')];this[_0xb587('0x2b')]=_0x3d0463[_0xb587('0x2b')]||'';this[_0xb587('0x2c')]=_0x3d0463[_0xb587('0x2c')]||'';}module[_0xb587('0x2d')]=AgentComplete;