Built motion from commit da617fac.|2.6.6
[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 _0x4600=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','moment','milliseconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime'];(function(_0x38d5d2,_0x24ae9b){var _0x3b15b0=function(_0x3e3378){while(--_0x3e3378){_0x38d5d2['push'](_0x38d5d2['shift']());}};_0x3b15b0(++_0x24ae9b);}(_0x4600,0x9e));var _0x0460=function(_0x5bf595,_0x3dcc0b){_0x5bf595=_0x5bf595-0x0;var _0x3026a4=_0x4600[_0x5bf595];return _0x3026a4;};'use strict';var util=require(_0x0460('0x0'));var _=require('lodash');var moment=require(_0x0460('0x1'));function getSeconds(_0x302974,_0x1dde99){var _0x24d807=moment(_0x302974)['milliseconds'](0x0);var _0x20c195=moment(_0x1dde99)[_0x0460('0x2')](0x0);return _0x24d807['diff'](_0x20c195,'seconds');}function AgentComplete(_0x34d6f9,_0x1c8441){this[_0x0460('0x3')]=0x4;this[_0x0460('0x4')]=_0x0460('0x5');this[_0x0460('0x6')]=_0x34d6f9[_0x0460('0x6')];this[_0x0460('0x7')]=_0x34d6f9[_0x0460('0x7')];this[_0x0460('0x8')]=_0x34d6f9['type']===_0x0460('0x9')?'queue':_0x34d6f9['type'];this[_0x0460('0xa')]=_0x34d6f9['countbusyretry'];this['countcongestionretry']=_0x34d6f9[_0x0460('0xb')];this[_0x0460('0xc')]=_0x34d6f9[_0x0460('0xc')];this[_0x0460('0xd')]=_0x34d6f9['countbusyretry']+_0x34d6f9[_0x0460('0xb')]+_0x34d6f9[_0x0460('0xc')]+_0x34d6f9[_0x0460('0xe')]+_0x34d6f9[_0x0460('0xf')]+_0x34d6f9[_0x0460('0x10')]+_0x34d6f9[_0x0460('0x11')]+_0x34d6f9[_0x0460('0x12')];this[_0x0460('0xe')]=_0x34d6f9[_0x0460('0xe')];this['countdropretry']=_0x34d6f9[_0x0460('0xf')];this[_0x0460('0x10')]=_0x34d6f9[_0x0460('0x10')];this[_0x0460('0x11')]=_0x34d6f9[_0x0460('0x11')];this[_0x0460('0x12')]=_0x34d6f9[_0x0460('0x12')];this[_0x0460('0x13')]=_0x1c8441[_0x0460('0x13')];this[_0x0460('0x14')]=_0x34d6f9[_0x0460('0x15')];this['calleridnum']=_0x34d6f9[_0x0460('0x16')];this['starttime']=_0x34d6f9[_0x0460('0x17')];this[_0x0460('0x18')]=_0x34d6f9[_0x0460('0x18')];this[_0x0460('0x19')]=_0x34d6f9[_0x0460('0x19')];this[_0x0460('0x1a')]=moment()[_0x0460('0x1b')](_0x0460('0x1c'));this[_0x0460('0x1d')]=getSeconds(_0x34d6f9[_0x0460('0x18')],_0x34d6f9[_0x0460('0x17')]);this[_0x0460('0x1e')]=getSeconds(_0x34d6f9[_0x0460('0x19')],_0x34d6f9['responsetime']);this[_0x0460('0x1f')]=getSeconds(this[_0x0460('0x1a')],_0x34d6f9[_0x0460('0x19')]);this['queue']=_0x1c8441[_0x0460('0x20')];this[_0x0460('0x21')]=_0x1c8441[_0x0460('0x21')];this[_0x0460('0x22')]=_0x1c8441[_0x0460('0x22')];this[_0x0460('0x23')]=_0x34d6f9[_0x0460('0x23')];this['callbackuniqueid']=_0x34d6f9[_0x0460('0x24')];this[_0x0460('0x25')]=_0x34d6f9[_0x0460('0x25')];this[_0x0460('0x26')]=_0x34d6f9[_0x0460('0x26')];this['ContactId']=_0x34d6f9[_0x0460('0x27')];this[_0x0460('0x28')]=_0x34d6f9['ListId'];this[_0x0460('0x29')]=_0x34d6f9[_0x0460('0x29')];this[_0x0460('0x2a')]=_0x34d6f9[_0x0460('0x2a')];this[_0x0460('0x2b')]=_0x34d6f9[_0x0460('0x2b')];this['originatecalleridnum']=_0x34d6f9['originatecalleridnum']||'';this[_0x0460('0x2c')]=_0x34d6f9[_0x0460('0x2c')]||'';}module[_0x0460('0x2d')]=AgentComplete;