8f49a2213d9d26f3ab26442a34604f29658e1aee
[motion2.git] / server / services / ami / dialer / history.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 _0xf29f=['CampaignId','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','number','starttime','responsetime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x23d7c5,_0x2a7547){var _0x350950=function(_0x26f5b6){while(--_0x26f5b6){_0x23d7c5['push'](_0x23d7c5['shift']());}};_0x350950(++_0x2a7547);}(_0xf29f,0xcf));var _0xff29=function(_0x5714fc,_0x41a87b){_0x5714fc=_0x5714fc-0x0;var _0xd7439c=_0xf29f[_0x5714fc];return _0xd7439c;};'use strict';var util=require(_0xff29('0x0'));var _=require(_0xff29('0x1'));var moment=require('moment');function getSeconds(_0xd8eee,_0x6164c5){var _0x1eb2de=moment(_0xd8eee)[_0xff29('0x2')](0x0);var _0x2ca91d=moment(_0x6164c5)[_0xff29('0x2')](0x0);return _0x1eb2de[_0xff29('0x3')](_0x2ca91d,'seconds');}function History(_0x29b1a3){this['uniqueid']=_0x29b1a3[_0xff29('0x4')];this[_0xff29('0x5')]=_0x29b1a3[_0xff29('0x5')]||undefined;this['type']=_0x29b1a3[_0xff29('0x6')];this['campaigntype']=_0x29b1a3[_0xff29('0x6')]==='outbound'?_0xff29('0x7'):_0x29b1a3['type'];this[_0xff29('0x8')]=_0x29b1a3[_0xff29('0x8')];this[_0xff29('0x9')]=_0x29b1a3[_0xff29('0x9')];this[_0xff29('0xa')]=_0x29b1a3[_0xff29('0xa')];this[_0xff29('0xb')]=_0x29b1a3[_0xff29('0x8')]+_0x29b1a3['countcongestionretry']+_0x29b1a3[_0xff29('0xa')]+_0x29b1a3[_0xff29('0xc')]+_0x29b1a3[_0xff29('0xd')]+_0x29b1a3['countabandonedretry']+_0x29b1a3[_0xff29('0xe')]+_0x29b1a3[_0xff29('0xf')];this[_0xff29('0xc')]=_0x29b1a3[_0xff29('0xc')];this[_0xff29('0xd')]=_0x29b1a3[_0xff29('0xd')];this[_0xff29('0x10')]=_0x29b1a3[_0xff29('0x10')];this[_0xff29('0xe')]=_0x29b1a3['countmachineretry'];this[_0xff29('0xf')]=_0x29b1a3[_0xff29('0xf')];this[_0xff29('0x7')]=_0x29b1a3[_0xff29('0x7')];this[_0xff29('0x11')]=_0x29b1a3['name'];this['calleridnum']=_0x29b1a3[_0xff29('0x12')];this['starttime']=_0x29b1a3[_0xff29('0x13')];this[_0xff29('0x14')]=_0x29b1a3['responsetime'];this['endtime']=_0x29b1a3[_0xff29('0x14')];this[_0xff29('0x15')]=getSeconds(_0x29b1a3[_0xff29('0x14')],_0x29b1a3[_0xff29('0x13')]);this['holdtime']=0x0;this[_0xff29('0x16')]=0x0;this[_0xff29('0x17')]=_0x29b1a3[_0xff29('0x17')];this['callbackuniqueid']=_0x29b1a3[_0xff29('0x18')];this['callbackat']=_0x29b1a3[_0xff29('0x19')];this[_0xff29('0x1a')]=_0x29b1a3['recallme'];this[_0xff29('0x1b')]=_0x29b1a3[_0xff29('0x1b')];this[_0xff29('0x1c')]=_0x29b1a3[_0xff29('0x1c')];this['UserId']=_0x29b1a3[_0xff29('0x1d')];this['VoiceQueueId']=_0x29b1a3[_0xff29('0x1e')];this[_0xff29('0x1f')]=_0x29b1a3[_0xff29('0x1f')];this['originatecalleridnum']=_0x29b1a3['originatecalleridnum']||'';this[_0xff29('0x20')]=_0x29b1a3[_0xff29('0x20')]||'';}module[_0xff29('0x21')]=History;