Built motion from commit (unavailable).|2.5.14
[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 _0xfe58=['holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xfe58,0x177));var _0x8fe5=function(_0x2c0099,_0x572104){_0x2c0099=_0x2c0099-0x0;var _0x28f43e=_0xfe58[_0x2c0099];return _0x28f43e;};'use strict';var util=require('util');var _=require(_0x8fe5('0x0'));var moment=require(_0x8fe5('0x1'));function getSeconds(_0x2a0235,_0x112aad){var _0x4c1223=moment(_0x2a0235)[_0x8fe5('0x2')](0x0);var _0x3c4657=moment(_0x112aad)[_0x8fe5('0x2')](0x0);return _0x4c1223[_0x8fe5('0x3')](_0x3c4657,'seconds');}function AgentComplete(_0x4070da,_0x5d7c6e){this[_0x8fe5('0x4')]=0x4;this[_0x8fe5('0x5')]=_0x8fe5('0x6');this['scheduledat']=_0x4070da[_0x8fe5('0x7')];this[_0x8fe5('0x8')]=_0x4070da[_0x8fe5('0x8')];this['campaigntype']=_0x4070da[_0x8fe5('0x8')]===_0x8fe5('0x9')?_0x8fe5('0xa'):_0x4070da[_0x8fe5('0x8')];this['countbusyretry']=_0x4070da[_0x8fe5('0xb')];this[_0x8fe5('0xc')]=_0x4070da[_0x8fe5('0xc')];this[_0x8fe5('0xd')]=_0x4070da[_0x8fe5('0xd')];this['countglobal']=_0x4070da['countbusyretry']+_0x4070da[_0x8fe5('0xc')]+_0x4070da[_0x8fe5('0xd')]+_0x4070da['countnosuchnumberretry']+_0x4070da['countdropretry']+_0x4070da['countabandonedretry']+_0x4070da[_0x8fe5('0xe')]+_0x4070da[_0x8fe5('0xf')];this[_0x8fe5('0x10')]=_0x4070da[_0x8fe5('0x10')];this[_0x8fe5('0x11')]=_0x4070da[_0x8fe5('0x11')];this[_0x8fe5('0x12')]=_0x4070da[_0x8fe5('0x12')];this[_0x8fe5('0xe')]=_0x4070da['countmachineretry'];this[_0x8fe5('0xf')]=_0x4070da[_0x8fe5('0xf')];this['uniqueid']=_0x5d7c6e['uniqueid'];this[_0x8fe5('0x13')]=_0x4070da[_0x8fe5('0x14')];this[_0x8fe5('0x15')]=_0x4070da[_0x8fe5('0x16')];this[_0x8fe5('0x17')]=_0x4070da[_0x8fe5('0x17')];this[_0x8fe5('0x18')]=_0x4070da[_0x8fe5('0x18')];this['answertime']=_0x4070da[_0x8fe5('0x19')];this[_0x8fe5('0x1a')]=moment()[_0x8fe5('0x1b')](_0x8fe5('0x1c'));this[_0x8fe5('0x1d')]=getSeconds(_0x4070da[_0x8fe5('0x18')],_0x4070da[_0x8fe5('0x17')]);this[_0x8fe5('0x1e')]=getSeconds(_0x4070da[_0x8fe5('0x19')],_0x4070da['responsetime']);this[_0x8fe5('0x1f')]=getSeconds(this[_0x8fe5('0x1a')],_0x4070da[_0x8fe5('0x19')]);this[_0x8fe5('0xa')]=_0x5d7c6e[_0x8fe5('0xa')];this[_0x8fe5('0x20')]=_0x5d7c6e[_0x8fe5('0x20')];this[_0x8fe5('0x21')]=_0x5d7c6e['reason'];this[_0x8fe5('0x22')]=_0x4070da['callback'];this[_0x8fe5('0x23')]=_0x4070da[_0x8fe5('0x23')];this[_0x8fe5('0x24')]=_0x4070da['callbackat'];this['recallme']=_0x4070da['recallme'];this[_0x8fe5('0x25')]=_0x4070da[_0x8fe5('0x25')];this[_0x8fe5('0x26')]=_0x4070da[_0x8fe5('0x26')];this[_0x8fe5('0x27')]=_0x4070da['UserId'];this[_0x8fe5('0x28')]=_0x4070da[_0x8fe5('0x28')];this[_0x8fe5('0x29')]=_0x4070da[_0x8fe5('0x29')];this[_0x8fe5('0x2a')]=_0x4070da['originatecalleridnum']||'';this['originatecalleridname']=_0x4070da[_0x8fe5('0x2b')]||'';}module[_0x8fe5('0x2c')]=AgentComplete;