Built motion from commit da617fac.|2.6.6
[motion2.git] / server / services / ami / dialer / final.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 _0x106f=['scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid'];(function(_0x38c6d1,_0x2fd9f5){var _0xfa4656=function(_0xe99894){while(--_0xe99894){_0x38c6d1['push'](_0x38c6d1['shift']());}};_0xfa4656(++_0x2fd9f5);}(_0x106f,0x162));var _0xf106=function(_0x29d1cc,_0x5b7b56){_0x29d1cc=_0x29d1cc-0x0;var _0x429200=_0x106f[_0x29d1cc];return _0x429200;};'use strict';var util=require(_0xf106('0x0'));var _=require(_0xf106('0x1'));var moment=require('moment');function getSeconds(_0x4014dd,_0x6d8236){var _0x59bc3a=moment(_0x4014dd)[_0xf106('0x2')](0x0);var _0x4ab04f=moment(_0x6d8236)[_0xf106('0x2')](0x0);return _0x59bc3a[_0xf106('0x3')](_0x4ab04f,_0xf106('0x4'));}function Final(_0x318376){this[_0xf106('0x5')]=_0x318376[_0xf106('0x5')];this[_0xf106('0x6')]=_0x318376['scheduledat'];this[_0xf106('0x7')]=_0x318376[_0xf106('0x7')];this['campaigntype']=_0x318376['type']==='outbound'?'queue':_0x318376['type'];this[_0xf106('0x8')]=_0x318376[_0xf106('0x8')];this[_0xf106('0x9')]=_0x318376[_0xf106('0x9')];this[_0xf106('0xa')]=_0x318376[_0xf106('0xa')];this[_0xf106('0xb')]=_0x318376[_0xf106('0x8')]+_0x318376[_0xf106('0x9')]+_0x318376[_0xf106('0xa')]+_0x318376[_0xf106('0xc')]+_0x318376['countdropretry']+_0x318376[_0xf106('0xd')]+_0x318376[_0xf106('0xe')]+_0x318376['countagentrejectretry'];this['countnosuchnumberretry']=_0x318376[_0xf106('0xc')];this[_0xf106('0xf')]=_0x318376[_0xf106('0xf')];this['countabandonedretry']=_0x318376[_0xf106('0xd')];this[_0xf106('0xe')]=_0x318376[_0xf106('0xe')];this['countagentrejectretry']=_0x318376[_0xf106('0x10')];this[_0xf106('0x11')]=_0x318376['queue'];this[_0xf106('0x12')]=_0x318376[_0xf106('0x12')];this[_0xf106('0x13')]=_0x318376['calleridnum'];this['starttime']=_0x318376[_0xf106('0x14')];this[_0xf106('0x15')]=_0x318376[_0xf106('0x15')];this['endtime']=_0x318376[_0xf106('0x15')];this[_0xf106('0x16')]=_0x318376[_0xf106('0x16')]||0x0;this[_0xf106('0x17')]=_0x318376[_0xf106('0x17')]||0x0;this[_0xf106('0x18')]=_0x318376[_0xf106('0x18')]||0x0;this[_0xf106('0x19')]=_0x318376[_0xf106('0x19')];this['callbackuniqueid']=_0x318376['callbackuniqueid'];this[_0xf106('0x1a')]=_0x318376['callbackat'];this[_0xf106('0x1b')]=_0x318376[_0xf106('0x1b')];this[_0xf106('0x1c')]=_0x318376[_0xf106('0x1c')];this[_0xf106('0x1d')]=_0x318376['ListId'];this['UserId']=_0x318376[_0xf106('0x1e')];this[_0xf106('0x1f')]=_0x318376[_0xf106('0x1f')];this[_0xf106('0x20')]=_0x318376[_0xf106('0x20')];this[_0xf106('0x21')]=_0x318376[_0xf106('0x21')]||'';this[_0xf106('0x22')]=_0x318376[_0xf106('0x22')]||'';}module[_0xf106('0x23')]=Final;