Built motion from commit (unavailable).|2.4.4
[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 _0x8980=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','scheduledat','type','outbound','countbusyretry','countcongestionretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','answertime','talktime','queue','membername','callback'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x8980,0x114));var _0x0898=function(_0x30b9e3,_0x9a40cb){_0x30b9e3=_0x30b9e3-0x0;var _0x1bbab0=_0x8980[_0x30b9e3];return _0x1bbab0;};'use strict';var util=require(_0x0898('0x0'));var _=require(_0x0898('0x1'));var moment=require('moment');function getSeconds(_0x216792,_0x3c0329){var _0x1f4c2e=moment(_0x216792)['milliseconds'](0x0);var _0x565d8b=moment(_0x3c0329)[_0x0898('0x2')](0x0);return _0x1f4c2e[_0x0898('0x3')](_0x565d8b,_0x0898('0x4'));}function AgentComplete(_0xc07829,_0x1eaae3){this[_0x0898('0x5')]=0x4;this[_0x0898('0x6')]='Answer';this[_0x0898('0x7')]=_0xc07829['scheduledat'];this[_0x0898('0x8')]=_0xc07829[_0x0898('0x8')];this['campaigntype']=_0xc07829[_0x0898('0x8')]===_0x0898('0x9')?'queue':_0xc07829['type'];this[_0x0898('0xa')]=_0xc07829[_0x0898('0xa')];this['countcongestionretry']=_0xc07829[_0x0898('0xb')];this['countnoanswerretry']=_0xc07829['countnoanswerretry'];this[_0x0898('0xc')]=_0xc07829[_0x0898('0xa')]+_0xc07829[_0x0898('0xb')]+_0xc07829['countnoanswerretry'];this['uniqueid']=_0x1eaae3[_0x0898('0xd')];this[_0x0898('0xe')]=_0xc07829[_0x0898('0xf')];this[_0x0898('0x10')]=_0xc07829[_0x0898('0x11')];this['starttime']=_0xc07829[_0x0898('0x12')];this[_0x0898('0x13')]=_0xc07829[_0x0898('0x13')];this['answertime']=_0xc07829['answertime'];this[_0x0898('0x14')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0898('0x15')]=getSeconds(_0xc07829[_0x0898('0x13')],_0xc07829[_0x0898('0x12')]);this[_0x0898('0x16')]=getSeconds(_0xc07829[_0x0898('0x17')],_0xc07829[_0x0898('0x13')]);this[_0x0898('0x18')]=getSeconds(this[_0x0898('0x14')],_0xc07829[_0x0898('0x17')]);this[_0x0898('0x19')]=_0x1eaae3['queue'];this[_0x0898('0x1a')]=_0x1eaae3['membername'];this['reason']=_0x1eaae3['reason'];this[_0x0898('0x1b')]=_0xc07829[_0x0898('0x1b')];this[_0x0898('0x1c')]=_0xc07829[_0x0898('0x1c')];this[_0x0898('0x1d')]=_0xc07829[_0x0898('0x1d')];this[_0x0898('0x1e')]=_0xc07829[_0x0898('0x1e')];this[_0x0898('0x1f')]=_0xc07829[_0x0898('0x1f')];this['ListId']=_0xc07829[_0x0898('0x20')];this['UserId']=_0xc07829[_0x0898('0x21')];this['VoiceQueueId']=_0xc07829[_0x0898('0x22')];this['CampaignId']=_0xc07829[_0x0898('0x23')];this[_0x0898('0x24')]=_0xc07829[_0x0898('0x24')]||'';this['originatecalleridname']=_0xc07829['originatecalleridname']||'';}module[_0x0898('0x25')]=AgentComplete;