Built motion from commit 167bccf5.|2.6.7
[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 _0xae6d=['number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','diff','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum'];(function(_0xba2881,_0x5c75f4){var _0x5df38a=function(_0x36b5e9){while(--_0x36b5e9){_0xba2881['push'](_0xba2881['shift']());}};_0x5df38a(++_0x5c75f4);}(_0xae6d,0x73));var _0xdae6=function(_0x3b64ae,_0x2c4e93){_0x3b64ae=_0x3b64ae-0x0;var _0x1506b8=_0xae6d[_0x3b64ae];return _0x1506b8;};'use strict';var util=require('util');var _=require(_0xdae6('0x0'));var moment=require(_0xdae6('0x1'));function getSeconds(_0x3c4530,_0x45476a){var _0x136165=moment(_0x3c4530)[_0xdae6('0x2')](0x0);var _0x5b3687=moment(_0x45476a)['milliseconds'](0x0);return _0x136165[_0xdae6('0x3')](_0x5b3687,'seconds');}function Hangup(_0x3eb3da,_0x4d9f89){this['state']=0x4;this[_0xdae6('0x4')]=_0xdae6('0x5');this[_0xdae6('0x6')]=_0x3eb3da[_0xdae6('0x6')];this[_0xdae6('0x7')]=_0x3eb3da[_0xdae6('0x7')];this[_0xdae6('0x8')]=_0x3eb3da['type']===_0xdae6('0x9')?_0xdae6('0xa'):_0x3eb3da['type'];this[_0xdae6('0xb')]=_0x3eb3da[_0xdae6('0xb')];this[_0xdae6('0xc')]=_0x3eb3da['countcongestionretry'];this[_0xdae6('0xd')]=_0x3eb3da[_0xdae6('0xd')];this[_0xdae6('0xe')]=_0x3eb3da['countbusyretry']+_0x3eb3da[_0xdae6('0xc')]+_0x3eb3da[_0xdae6('0xd')]+_0x3eb3da[_0xdae6('0xf')]+_0x3eb3da[_0xdae6('0x10')]+_0x3eb3da[_0xdae6('0x11')]+_0x3eb3da[_0xdae6('0x12')]+_0x3eb3da['countagentrejectretry'];this[_0xdae6('0xf')]=_0x3eb3da[_0xdae6('0xf')];this['countdropretry']=_0x3eb3da['countdropretry'];this[_0xdae6('0x11')]=_0x3eb3da[_0xdae6('0x11')];this[_0xdae6('0x12')]=_0x3eb3da[_0xdae6('0x12')];this[_0xdae6('0x13')]=_0x3eb3da['countagentrejectretry'];this[_0xdae6('0x14')]=_0x4d9f89[_0xdae6('0x14')];this['calleridname']=_0x3eb3da[_0xdae6('0x15')];this[_0xdae6('0x16')]=_0x3eb3da[_0xdae6('0x17')];this[_0xdae6('0x18')]=_0x3eb3da[_0xdae6('0x18')];this[_0xdae6('0x19')]=_0x3eb3da[_0xdae6('0x19')];this[_0xdae6('0x1a')]=moment()[_0xdae6('0x1b')](_0xdae6('0x1c'));this[_0xdae6('0x1d')]=getSeconds(_0x3eb3da[_0xdae6('0x19')],_0x3eb3da[_0xdae6('0x18')]);this[_0xdae6('0x1e')]=0x0;this[_0xdae6('0x1f')]=getSeconds(this[_0xdae6('0x1a')],_0x3eb3da['responsetime']);this[_0xdae6('0xa')]=_0x3eb3da[_0xdae6('0xa')];this[_0xdae6('0x20')]=_0xdae6('0x21');this[_0xdae6('0x22')]=_0x4d9f89[_0xdae6('0x23')];this['callback']=_0x3eb3da[_0xdae6('0x24')];this['callbackuniqueid']=_0x3eb3da[_0xdae6('0x25')];this['callbackat']=_0x3eb3da[_0xdae6('0x26')];this[_0xdae6('0x27')]=_0x3eb3da['recallme'];this['ContactId']=_0x3eb3da[_0xdae6('0x28')];this[_0xdae6('0x29')]=_0x3eb3da['ListId'];this[_0xdae6('0x2a')]=_0x3eb3da[_0xdae6('0x2a')];this[_0xdae6('0x2b')]=_0x3eb3da['VoiceQueueId'];this['CampaignId']=_0x3eb3da[_0xdae6('0x2c')];}module[_0xdae6('0x2d')]=Hangup;