88dab473d0ac7b310abd3ed7750ec5afac148fb3
[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 _0xb4a3=['milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','util','lodash'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xb4a3,0x174));var _0x3b4a=function(_0x2fdce0,_0x496242){_0x2fdce0=_0x2fdce0-0x0;var _0x36f07e=_0xb4a3[_0x2fdce0];return _0x36f07e;};'use strict';var util=require(_0x3b4a('0x0'));var _=require(_0x3b4a('0x1'));var moment=require('moment');function getSeconds(_0x1563cc,_0x506539){var _0x39016d=moment(_0x1563cc)['milliseconds'](0x0);var _0x410b5b=moment(_0x506539)[_0x3b4a('0x2')](0x0);return _0x39016d['diff'](_0x410b5b,_0x3b4a('0x3'));}function History(_0x47b8bf){this[_0x3b4a('0x4')]=_0x47b8bf[_0x3b4a('0x4')];this[_0x3b4a('0x5')]=_0x47b8bf['scheduledat']||undefined;this['type']=_0x47b8bf[_0x3b4a('0x6')];this[_0x3b4a('0x7')]=_0x47b8bf['type']==='outbound'?_0x3b4a('0x8'):_0x47b8bf[_0x3b4a('0x6')];this[_0x3b4a('0x9')]=_0x47b8bf[_0x3b4a('0x9')];this[_0x3b4a('0xa')]=_0x47b8bf['countcongestionretry'];this[_0x3b4a('0xb')]=_0x47b8bf[_0x3b4a('0xb')];this[_0x3b4a('0xc')]=_0x47b8bf[_0x3b4a('0x9')]+_0x47b8bf['countcongestionretry']+_0x47b8bf[_0x3b4a('0xb')]+_0x47b8bf[_0x3b4a('0xd')]+_0x47b8bf['countdropretry']+_0x47b8bf[_0x3b4a('0xe')]+_0x47b8bf[_0x3b4a('0xf')]+_0x47b8bf[_0x3b4a('0x10')];this[_0x3b4a('0xd')]=_0x47b8bf[_0x3b4a('0xd')];this[_0x3b4a('0x11')]=_0x47b8bf[_0x3b4a('0x11')];this['countabandonedretry']=_0x47b8bf[_0x3b4a('0xe')];this['countmachineretry']=_0x47b8bf[_0x3b4a('0xf')];this[_0x3b4a('0x10')]=_0x47b8bf['countagentrejectretry'];this[_0x3b4a('0x8')]=_0x47b8bf[_0x3b4a('0x8')];this['calleridname']=_0x47b8bf[_0x3b4a('0x12')];this[_0x3b4a('0x13')]=_0x47b8bf['number'];this[_0x3b4a('0x14')]=_0x47b8bf[_0x3b4a('0x14')];this['responsetime']=_0x47b8bf[_0x3b4a('0x15')];this[_0x3b4a('0x16')]=_0x47b8bf['responsetime'];this[_0x3b4a('0x17')]=getSeconds(_0x47b8bf[_0x3b4a('0x15')],_0x47b8bf['starttime']);this[_0x3b4a('0x18')]=0x0;this['talktime']=0x0;this[_0x3b4a('0x19')]=_0x47b8bf['callback'];this[_0x3b4a('0x1a')]=_0x47b8bf['callbackuniqueid'];this[_0x3b4a('0x1b')]=_0x47b8bf[_0x3b4a('0x1b')];this['recallme']=_0x47b8bf['recallme'];this[_0x3b4a('0x1c')]=_0x47b8bf[_0x3b4a('0x1c')];this[_0x3b4a('0x1d')]=_0x47b8bf[_0x3b4a('0x1d')];this[_0x3b4a('0x1e')]=_0x47b8bf[_0x3b4a('0x1e')];this[_0x3b4a('0x1f')]=_0x47b8bf[_0x3b4a('0x1f')];this['CampaignId']=_0x47b8bf['CampaignId'];this[_0x3b4a('0x20')]=_0x47b8bf[_0x3b4a('0x20')]||'';this[_0x3b4a('0x21')]=_0x47b8bf[_0x3b4a('0x21')]||'';}module['exports']=History;