ae5caf5db0eb6f34250535c997ff30aeb4f28edd
[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 _0xa468=['outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype'];(function(_0xc00a41,_0x100f65){var _0x20eb37=function(_0x3034c9){while(--_0x3034c9){_0xc00a41['push'](_0xc00a41['shift']());}};_0x20eb37(++_0x100f65);}(_0xa468,0x1e3));var _0x8a46=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xa468[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x8a46('0x0'));function getSeconds(_0x84c24e,_0x536838){var _0x10ee91=moment(_0x84c24e)[_0x8a46('0x1')](0x0);var _0x177fe7=moment(_0x536838)[_0x8a46('0x1')](0x0);return _0x10ee91[_0x8a46('0x2')](_0x177fe7,'seconds');}function History(_0x5b629b){this[_0x8a46('0x3')]=_0x5b629b['uniqueid'];this[_0x8a46('0x4')]=_0x5b629b['scheduledat']||undefined;this[_0x8a46('0x5')]=_0x5b629b[_0x8a46('0x5')];this[_0x8a46('0x6')]=_0x5b629b['type']===_0x8a46('0x7')?_0x8a46('0x8'):_0x5b629b[_0x8a46('0x5')];this[_0x8a46('0x9')]=_0x5b629b[_0x8a46('0x9')];this[_0x8a46('0xa')]=_0x5b629b[_0x8a46('0xa')];this[_0x8a46('0xb')]=_0x5b629b[_0x8a46('0xb')];this['countglobal']=_0x5b629b[_0x8a46('0x9')]+_0x5b629b['countcongestionretry']+_0x5b629b['countnoanswerretry']+_0x5b629b[_0x8a46('0xc')]+_0x5b629b['countdropretry']+_0x5b629b[_0x8a46('0xd')]+_0x5b629b[_0x8a46('0xe')]+_0x5b629b[_0x8a46('0xf')];this[_0x8a46('0xc')]=_0x5b629b[_0x8a46('0xc')];this[_0x8a46('0x10')]=_0x5b629b['countdropretry'];this[_0x8a46('0xd')]=_0x5b629b[_0x8a46('0xd')];this[_0x8a46('0xe')]=_0x5b629b[_0x8a46('0xe')];this[_0x8a46('0xf')]=_0x5b629b[_0x8a46('0xf')];this[_0x8a46('0x8')]=_0x5b629b[_0x8a46('0x8')];this['calleridname']=_0x5b629b[_0x8a46('0x11')];this[_0x8a46('0x12')]=_0x5b629b['number'];this[_0x8a46('0x13')]=_0x5b629b[_0x8a46('0x13')];this[_0x8a46('0x14')]=_0x5b629b[_0x8a46('0x14')];this[_0x8a46('0x15')]=_0x5b629b[_0x8a46('0x14')];this[_0x8a46('0x16')]=getSeconds(_0x5b629b[_0x8a46('0x14')],_0x5b629b[_0x8a46('0x13')]);this[_0x8a46('0x17')]=0x0;this[_0x8a46('0x18')]=0x0;this[_0x8a46('0x19')]=_0x5b629b[_0x8a46('0x19')];this['callbackuniqueid']=_0x5b629b['callbackuniqueid'];this[_0x8a46('0x1a')]=_0x5b629b[_0x8a46('0x1a')];this[_0x8a46('0x1b')]=_0x5b629b['recallme'];this[_0x8a46('0x1c')]=_0x5b629b[_0x8a46('0x1c')];this[_0x8a46('0x1d')]=_0x5b629b['ListId'];this[_0x8a46('0x1e')]=_0x5b629b[_0x8a46('0x1e')];this[_0x8a46('0x1f')]=_0x5b629b['VoiceQueueId'];this[_0x8a46('0x20')]=_0x5b629b['CampaignId'];this[_0x8a46('0x21')]=_0x5b629b[_0x8a46('0x21')]||'';this[_0x8a46('0x22')]=_0x5b629b['originatecalleridname']||'';}module['exports']=History;