Built motion from commit (unavailable).|2.4.15
[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 _0x4f56=['countglobal','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','util','lodash','milliseconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x4f56,0x85));var _0x64f5=function(_0x2a6359,_0x935a6c){_0x2a6359=_0x2a6359-0x0;var _0x32b3f6=_0x4f56[_0x2a6359];return _0x32b3f6;};'use strict';var util=require(_0x64f5('0x0'));var _=require(_0x64f5('0x1'));var moment=require('moment');function getSeconds(_0x5bcfe7,_0x13bacc){var _0x50da0d=moment(_0x5bcfe7)[_0x64f5('0x2')](0x0);var _0x207adc=moment(_0x13bacc)[_0x64f5('0x2')](0x0);return _0x50da0d['diff'](_0x207adc,'seconds');}function AgentComplete(_0x117719,_0x490099){this['state']=0x4;this['statedesc']='Answer';this[_0x64f5('0x3')]=_0x117719[_0x64f5('0x3')];this[_0x64f5('0x4')]=_0x117719[_0x64f5('0x4')];this[_0x64f5('0x5')]=_0x117719[_0x64f5('0x4')]===_0x64f5('0x6')?_0x64f5('0x7'):_0x117719[_0x64f5('0x4')];this[_0x64f5('0x8')]=_0x117719[_0x64f5('0x8')];this['countcongestionretry']=_0x117719[_0x64f5('0x9')];this[_0x64f5('0xa')]=_0x117719[_0x64f5('0xa')];this[_0x64f5('0xb')]=_0x117719[_0x64f5('0x8')]+_0x117719[_0x64f5('0x9')]+_0x117719['countnoanswerretry'];this[_0x64f5('0xc')]=_0x490099[_0x64f5('0xc')];this[_0x64f5('0xd')]=_0x117719[_0x64f5('0xe')];this[_0x64f5('0xf')]=_0x117719['number'];this[_0x64f5('0x10')]=_0x117719['starttime'];this[_0x64f5('0x11')]=_0x117719['responsetime'];this[_0x64f5('0x12')]=_0x117719[_0x64f5('0x12')];this['endtime']=moment()[_0x64f5('0x13')](_0x64f5('0x14'));this[_0x64f5('0x15')]=getSeconds(_0x117719[_0x64f5('0x11')],_0x117719[_0x64f5('0x10')]);this[_0x64f5('0x16')]=getSeconds(_0x117719[_0x64f5('0x12')],_0x117719['responsetime']);this[_0x64f5('0x17')]=getSeconds(this[_0x64f5('0x18')],_0x117719['answertime']);this[_0x64f5('0x7')]=_0x490099[_0x64f5('0x7')];this[_0x64f5('0x19')]=_0x490099[_0x64f5('0x19')];this['reason']=_0x490099[_0x64f5('0x1a')];this[_0x64f5('0x1b')]=_0x117719[_0x64f5('0x1b')];this['callbackuniqueid']=_0x117719['callbackuniqueid'];this[_0x64f5('0x1c')]=_0x117719[_0x64f5('0x1c')];this[_0x64f5('0x1d')]=_0x117719['recallme'];this[_0x64f5('0x1e')]=_0x117719['ContactId'];this['ListId']=_0x117719[_0x64f5('0x1f')];this[_0x64f5('0x20')]=_0x117719[_0x64f5('0x20')];this['VoiceQueueId']=_0x117719[_0x64f5('0x21')];this[_0x64f5('0x22')]=_0x117719['CampaignId'];this[_0x64f5('0x23')]=_0x117719['originatecalleridnum']||'';this['originatecalleridname']=_0x117719['originatecalleridname']||'';}module['exports']=AgentComplete;