Built motion from commit (unavailable).|2.2.0
[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 _0xf496=['Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','ringtime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','statedesc'];(function(_0x1b9ec4,_0x4f3208){var _0x3326ae=function(_0x2d7af3){while(--_0x2d7af3){_0x1b9ec4['push'](_0x1b9ec4['shift']());}};_0x3326ae(++_0x4f3208);}(_0xf496,0x132));var _0x6f49=function(_0x4a5b01,_0xcdb2fc){_0x4a5b01=_0x4a5b01-0x0;var _0xae8cd2=_0xf496[_0x4a5b01];return _0xae8cd2;};'use strict';var util=require(_0x6f49('0x0'));var _=require(_0x6f49('0x1'));var moment=require('moment');function getSeconds(_0xaeb22e,_0x5720e4){var _0x4c4050=moment(_0xaeb22e)[_0x6f49('0x2')](0x0);var _0x430206=moment(_0x5720e4)[_0x6f49('0x2')](0x0);return _0x4c4050[_0x6f49('0x3')](_0x430206,_0x6f49('0x4'));}function AgentComplete(_0x53c7d7,_0x2508c8){this['state']=0x4;this[_0x6f49('0x5')]=_0x6f49('0x6');this[_0x6f49('0x7')]=_0x53c7d7[_0x6f49('0x7')];this[_0x6f49('0x8')]=_0x53c7d7[_0x6f49('0x8')];this[_0x6f49('0x9')]=_0x53c7d7[_0x6f49('0x8')]===_0x6f49('0xa')?'queue':_0x53c7d7[_0x6f49('0x8')];this[_0x6f49('0xb')]=_0x53c7d7[_0x6f49('0xb')];this['countcongestionretry']=_0x53c7d7['countcongestionretry'];this[_0x6f49('0xc')]=_0x53c7d7[_0x6f49('0xc')];this[_0x6f49('0xd')]=_0x53c7d7[_0x6f49('0xb')]+_0x53c7d7[_0x6f49('0xe')]+_0x53c7d7[_0x6f49('0xc')];this[_0x6f49('0xf')]=_0x2508c8['uniqueid'];this[_0x6f49('0x10')]=_0x53c7d7[_0x6f49('0x11')];this[_0x6f49('0x12')]=_0x53c7d7[_0x6f49('0x13')];this[_0x6f49('0x14')]=_0x53c7d7[_0x6f49('0x14')];this[_0x6f49('0x15')]=_0x53c7d7[_0x6f49('0x15')];this[_0x6f49('0x16')]=_0x53c7d7[_0x6f49('0x16')];this['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x6f49('0x17')]=getSeconds(_0x53c7d7[_0x6f49('0x15')],_0x53c7d7['starttime']);this['holdtime']=getSeconds(_0x53c7d7['answertime'],_0x53c7d7[_0x6f49('0x15')]);this['talktime']=getSeconds(this[_0x6f49('0x18')],_0x53c7d7[_0x6f49('0x16')]);this[_0x6f49('0x19')]=_0x2508c8[_0x6f49('0x19')];this[_0x6f49('0x1a')]=_0x2508c8[_0x6f49('0x1a')];this[_0x6f49('0x1b')]=_0x2508c8['reason'];this[_0x6f49('0x1c')]=_0x53c7d7[_0x6f49('0x1c')];this[_0x6f49('0x1d')]=_0x53c7d7[_0x6f49('0x1d')];this[_0x6f49('0x1e')]=_0x53c7d7[_0x6f49('0x1e')];this['recallme']=_0x53c7d7[_0x6f49('0x1f')];this[_0x6f49('0x20')]=_0x53c7d7[_0x6f49('0x20')];this[_0x6f49('0x21')]=_0x53c7d7['ListId'];this[_0x6f49('0x22')]=_0x53c7d7['UserId'];this[_0x6f49('0x23')]=_0x53c7d7[_0x6f49('0x23')];this[_0x6f49('0x24')]=_0x53c7d7[_0x6f49('0x24')];this['originatecalleridnum']=_0x53c7d7['originatecalleridnum']||'';this[_0x6f49('0x25')]=_0x53c7d7[_0x6f49('0x25')]||'';}module[_0x6f49('0x26')]=AgentComplete;