Built motion from commit (unavailable).|2.5.11
[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 _0x981b=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','format','ringtime','holdtime','talktime','membername','reason'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x981b,0xec));var _0xb981=function(_0x5439f1,_0x2cdbcf){_0x5439f1=_0x5439f1-0x0;var _0x402b35=_0x981b[_0x5439f1];return _0x402b35;};'use strict';var util=require(_0xb981('0x0'));var _=require(_0xb981('0x1'));var moment=require(_0xb981('0x2'));function getSeconds(_0x2105d3,_0xcf48ba){var _0x2db6ca=moment(_0x2105d3)[_0xb981('0x3')](0x0);var _0x29339e=moment(_0xcf48ba)[_0xb981('0x3')](0x0);return _0x2db6ca[_0xb981('0x4')](_0x29339e,'seconds');}function AgentComplete(_0x3e8ccb,_0x33763f){this[_0xb981('0x5')]=0x4;this['statedesc']=_0xb981('0x6');this['scheduledat']=_0x3e8ccb[_0xb981('0x7')];this[_0xb981('0x8')]=_0x3e8ccb[_0xb981('0x8')];this[_0xb981('0x9')]=_0x3e8ccb[_0xb981('0x8')]===_0xb981('0xa')?_0xb981('0xb'):_0x3e8ccb[_0xb981('0x8')];this['countbusyretry']=_0x3e8ccb[_0xb981('0xc')];this['countcongestionretry']=_0x3e8ccb[_0xb981('0xd')];this['countnoanswerretry']=_0x3e8ccb[_0xb981('0xe')];this['countglobal']=_0x3e8ccb[_0xb981('0xc')]+_0x3e8ccb[_0xb981('0xd')]+_0x3e8ccb[_0xb981('0xe')]+_0x3e8ccb[_0xb981('0xf')]+_0x3e8ccb[_0xb981('0x10')]+_0x3e8ccb[_0xb981('0x11')]+_0x3e8ccb[_0xb981('0x12')]+_0x3e8ccb[_0xb981('0x13')];this[_0xb981('0xf')]=_0x3e8ccb[_0xb981('0xf')];this[_0xb981('0x10')]=_0x3e8ccb[_0xb981('0x10')];this[_0xb981('0x11')]=_0x3e8ccb['countabandonedretry'];this[_0xb981('0x12')]=_0x3e8ccb['countmachineretry'];this['countagentrejectretry']=_0x3e8ccb['countagentrejectretry'];this['uniqueid']=_0x33763f[_0xb981('0x14')];this[_0xb981('0x15')]=_0x3e8ccb[_0xb981('0x16')];this[_0xb981('0x17')]=_0x3e8ccb[_0xb981('0x18')];this[_0xb981('0x19')]=_0x3e8ccb[_0xb981('0x19')];this[_0xb981('0x1a')]=_0x3e8ccb[_0xb981('0x1a')];this[_0xb981('0x1b')]=_0x3e8ccb['answertime'];this['endtime']=moment()[_0xb981('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb981('0x1d')]=getSeconds(_0x3e8ccb[_0xb981('0x1a')],_0x3e8ccb[_0xb981('0x19')]);this[_0xb981('0x1e')]=getSeconds(_0x3e8ccb[_0xb981('0x1b')],_0x3e8ccb[_0xb981('0x1a')]);this[_0xb981('0x1f')]=getSeconds(this['endtime'],_0x3e8ccb[_0xb981('0x1b')]);this[_0xb981('0xb')]=_0x33763f['queue'];this[_0xb981('0x20')]=_0x33763f[_0xb981('0x20')];this['reason']=_0x33763f[_0xb981('0x21')];this['callback']=_0x3e8ccb[_0xb981('0x22')];this[_0xb981('0x23')]=_0x3e8ccb['callbackuniqueid'];this[_0xb981('0x24')]=_0x3e8ccb[_0xb981('0x24')];this[_0xb981('0x25')]=_0x3e8ccb[_0xb981('0x25')];this[_0xb981('0x26')]=_0x3e8ccb[_0xb981('0x26')];this['ListId']=_0x3e8ccb[_0xb981('0x27')];this['UserId']=_0x3e8ccb[_0xb981('0x28')];this['VoiceQueueId']=_0x3e8ccb['VoiceQueueId'];this[_0xb981('0x29')]=_0x3e8ccb[_0xb981('0x29')];this[_0xb981('0x2a')]=_0x3e8ccb[_0xb981('0x2a')]||'';this[_0xb981('0x2b')]=_0x3e8ccb[_0xb981('0x2b')]||'';}module[_0xb981('0x2c')]=AgentComplete;