e3b348d46599b7ee078a283dd86ce9958289db10
[motion2.git] / server / services / ami / dialer / hangup.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 _0xb156=['starttime','responsetime','endtime','format','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','milliseconds','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number'];(function(_0x409dfe,_0x521b38){var _0x2cf771=function(_0x2231a5){while(--_0x2231a5){_0x409dfe['push'](_0x409dfe['shift']());}};_0x2cf771(++_0x521b38);}(_0xb156,0xc8));var _0x6b15=function(_0x1ee358,_0x42fdfb){_0x1ee358=_0x1ee358-0x0;var _0x4d01b9=_0xb156[_0x1ee358];return _0x4d01b9;};'use strict';var util=require(_0x6b15('0x0'));var _=require(_0x6b15('0x1'));var moment=require('moment');function getSeconds(_0x906a77,_0x24a863){var _0x300c0e=moment(_0x906a77)[_0x6b15('0x2')](0x0);var _0x35175c=moment(_0x24a863)['milliseconds'](0x0);return _0x300c0e['diff'](_0x35175c,_0x6b15('0x3'));}function Hangup(_0xd1ef44,_0x540602){this[_0x6b15('0x4')]=0x4;this['statedesc']=_0x6b15('0x5');this[_0x6b15('0x6')]=_0xd1ef44[_0x6b15('0x6')];this[_0x6b15('0x7')]=_0xd1ef44[_0x6b15('0x7')];this[_0x6b15('0x8')]=_0xd1ef44[_0x6b15('0x7')]===_0x6b15('0x9')?_0x6b15('0xa'):_0xd1ef44['type'];this[_0x6b15('0xb')]=_0xd1ef44[_0x6b15('0xb')];this[_0x6b15('0xc')]=_0xd1ef44['countcongestionretry'];this[_0x6b15('0xd')]=_0xd1ef44[_0x6b15('0xd')];this[_0x6b15('0xe')]=_0xd1ef44['countbusyretry']+_0xd1ef44['countcongestionretry']+_0xd1ef44[_0x6b15('0xd')]+_0xd1ef44[_0x6b15('0xf')]+_0xd1ef44[_0x6b15('0x10')]+_0xd1ef44['countabandonedretry']+_0xd1ef44[_0x6b15('0x11')]+_0xd1ef44[_0x6b15('0x12')];this[_0x6b15('0xf')]=_0xd1ef44[_0x6b15('0xf')];this[_0x6b15('0x10')]=_0xd1ef44[_0x6b15('0x10')];this[_0x6b15('0x13')]=_0xd1ef44[_0x6b15('0x13')];this[_0x6b15('0x11')]=_0xd1ef44[_0x6b15('0x11')];this[_0x6b15('0x12')]=_0xd1ef44[_0x6b15('0x12')];this['uniqueid']=_0x540602[_0x6b15('0x14')];this[_0x6b15('0x15')]=_0xd1ef44[_0x6b15('0x16')];this[_0x6b15('0x17')]=_0xd1ef44[_0x6b15('0x18')];this[_0x6b15('0x19')]=_0xd1ef44[_0x6b15('0x19')];this[_0x6b15('0x1a')]=_0xd1ef44[_0x6b15('0x1a')];this[_0x6b15('0x1b')]=moment()[_0x6b15('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6b15('0x1d')]=getSeconds(_0xd1ef44[_0x6b15('0x1a')],_0xd1ef44['starttime']);this[_0x6b15('0x1e')]=0x0;this[_0x6b15('0x1f')]=getSeconds(this[_0x6b15('0x1b')],_0xd1ef44[_0x6b15('0x1a')]);this[_0x6b15('0xa')]=_0xd1ef44[_0x6b15('0xa')];this[_0x6b15('0x20')]=_0x6b15('0x21');this[_0x6b15('0x22')]=_0x540602[_0x6b15('0x23')];this[_0x6b15('0x24')]=_0xd1ef44[_0x6b15('0x24')];this[_0x6b15('0x25')]=_0xd1ef44['callbackuniqueid'];this[_0x6b15('0x26')]=_0xd1ef44[_0x6b15('0x26')];this['recallme']=_0xd1ef44['recallme'];this[_0x6b15('0x27')]=_0xd1ef44[_0x6b15('0x27')];this['ListId']=_0xd1ef44[_0x6b15('0x28')];this[_0x6b15('0x29')]=_0xd1ef44[_0x6b15('0x29')];this['VoiceQueueId']=_0xd1ef44[_0x6b15('0x2a')];this['CampaignId']=_0xd1ef44[_0x6b15('0x2b')];}module[_0x6b15('0x2c')]=Hangup;