Built motion from commit (unavailable).|2.5.21
[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 _0xa136=['countmachineretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countdropretry'];(function(_0x5af415,_0x2df0cd){var _0x429695=function(_0x31ed9d){while(--_0x31ed9d){_0x5af415['push'](_0x5af415['shift']());}};_0x429695(++_0x2df0cd);}(_0xa136,0xab));var _0x6a13=function(_0x31cc6e,_0x4da430){_0x31cc6e=_0x31cc6e-0x0;var _0x39a234=_0xa136[_0x31cc6e];return _0x39a234;};'use strict';var util=require(_0x6a13('0x0'));var _=require('lodash');var moment=require(_0x6a13('0x1'));function getSeconds(_0x297f5,_0x43a9d8){var _0x3f4fdf=moment(_0x297f5)[_0x6a13('0x2')](0x0);var _0x8df63e=moment(_0x43a9d8)[_0x6a13('0x2')](0x0);return _0x3f4fdf[_0x6a13('0x3')](_0x8df63e,_0x6a13('0x4'));}function AgentComplete(_0x386e2a,_0x31fac4){this[_0x6a13('0x5')]=0x4;this[_0x6a13('0x6')]=_0x6a13('0x7');this[_0x6a13('0x8')]=_0x386e2a[_0x6a13('0x8')];this[_0x6a13('0x9')]=_0x386e2a[_0x6a13('0x9')];this[_0x6a13('0xa')]=_0x386e2a[_0x6a13('0x9')]===_0x6a13('0xb')?_0x6a13('0xc'):_0x386e2a[_0x6a13('0x9')];this[_0x6a13('0xd')]=_0x386e2a[_0x6a13('0xd')];this[_0x6a13('0xe')]=_0x386e2a[_0x6a13('0xe')];this[_0x6a13('0xf')]=_0x386e2a[_0x6a13('0xf')];this[_0x6a13('0x10')]=_0x386e2a[_0x6a13('0xd')]+_0x386e2a[_0x6a13('0xe')]+_0x386e2a['countnoanswerretry']+_0x386e2a['countnosuchnumberretry']+_0x386e2a['countdropretry']+_0x386e2a[_0x6a13('0x11')]+_0x386e2a['countmachineretry']+_0x386e2a[_0x6a13('0x12')];this['countnosuchnumberretry']=_0x386e2a[_0x6a13('0x13')];this['countdropretry']=_0x386e2a[_0x6a13('0x14')];this[_0x6a13('0x11')]=_0x386e2a['countabandonedretry'];this[_0x6a13('0x15')]=_0x386e2a[_0x6a13('0x15')];this[_0x6a13('0x12')]=_0x386e2a[_0x6a13('0x12')];this[_0x6a13('0x16')]=_0x31fac4[_0x6a13('0x16')];this[_0x6a13('0x17')]=_0x386e2a[_0x6a13('0x18')];this['calleridnum']=_0x386e2a[_0x6a13('0x19')];this['starttime']=_0x386e2a[_0x6a13('0x1a')];this[_0x6a13('0x1b')]=_0x386e2a[_0x6a13('0x1b')];this[_0x6a13('0x1c')]=_0x386e2a[_0x6a13('0x1c')];this['endtime']=moment()[_0x6a13('0x1d')](_0x6a13('0x1e'));this[_0x6a13('0x1f')]=getSeconds(_0x386e2a['responsetime'],_0x386e2a['starttime']);this['holdtime']=getSeconds(_0x386e2a[_0x6a13('0x1c')],_0x386e2a[_0x6a13('0x1b')]);this[_0x6a13('0x20')]=getSeconds(this[_0x6a13('0x21')],_0x386e2a[_0x6a13('0x1c')]);this[_0x6a13('0xc')]=_0x31fac4[_0x6a13('0xc')];this[_0x6a13('0x22')]=_0x31fac4[_0x6a13('0x22')];this[_0x6a13('0x23')]=_0x31fac4[_0x6a13('0x23')];this[_0x6a13('0x24')]=_0x386e2a[_0x6a13('0x24')];this[_0x6a13('0x25')]=_0x386e2a[_0x6a13('0x25')];this[_0x6a13('0x26')]=_0x386e2a[_0x6a13('0x26')];this[_0x6a13('0x27')]=_0x386e2a[_0x6a13('0x27')];this[_0x6a13('0x28')]=_0x386e2a[_0x6a13('0x28')];this[_0x6a13('0x29')]=_0x386e2a['ListId'];this[_0x6a13('0x2a')]=_0x386e2a[_0x6a13('0x2a')];this[_0x6a13('0x2b')]=_0x386e2a[_0x6a13('0x2b')];this[_0x6a13('0x2c')]=_0x386e2a[_0x6a13('0x2c')];this[_0x6a13('0x2d')]=_0x386e2a[_0x6a13('0x2d')]||'';this[_0x6a13('0x2e')]=_0x386e2a[_0x6a13('0x2e')]||'';}module[_0x6a13('0x2f')]=AgentComplete;