8dc2ef654022268fb9ea46f5c05aa6512215d34f
[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 _0x4359=['countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','IVR','reason','cause-txt','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countmachineretry'];(function(_0x4a64f5,_0x2ec027){var _0x3ce2eb=function(_0x504ae2){while(--_0x504ae2){_0x4a64f5['push'](_0x4a64f5['shift']());}};_0x3ce2eb(++_0x2ec027);}(_0x4359,0x1dd));var _0x9435=function(_0x703841,_0x52fe1b){_0x703841=_0x703841-0x0;var _0x5e9e58=_0x4359[_0x703841];return _0x5e9e58;};'use strict';var util=require(_0x9435('0x0'));var _=require(_0x9435('0x1'));var moment=require(_0x9435('0x2'));function getSeconds(_0x287f3f,_0x32e54f){var _0x3cac57=moment(_0x287f3f)[_0x9435('0x3')](0x0);var _0x3d9270=moment(_0x32e54f)['milliseconds'](0x0);return _0x3cac57[_0x9435('0x4')](_0x3d9270,_0x9435('0x5'));}function Hangup(_0x5d6843,_0xcc1f9d){this[_0x9435('0x6')]=0x4;this['statedesc']=_0x9435('0x7');this[_0x9435('0x8')]=_0x5d6843[_0x9435('0x8')];this[_0x9435('0x9')]=_0x5d6843['type'];this[_0x9435('0xa')]=_0x5d6843[_0x9435('0x9')]==='outbound'?_0x9435('0xb'):_0x5d6843[_0x9435('0x9')];this['countbusyretry']=_0x5d6843['countbusyretry'];this[_0x9435('0xc')]=_0x5d6843[_0x9435('0xc')];this[_0x9435('0xd')]=_0x5d6843[_0x9435('0xd')];this[_0x9435('0xe')]=_0x5d6843[_0x9435('0xf')]+_0x5d6843['countcongestionretry']+_0x5d6843[_0x9435('0xd')]+_0x5d6843['countnosuchnumberretry']+_0x5d6843[_0x9435('0x10')]+_0x5d6843['countabandonedretry']+_0x5d6843[_0x9435('0x11')]+_0x5d6843[_0x9435('0x12')];this[_0x9435('0x13')]=_0x5d6843[_0x9435('0x13')];this[_0x9435('0x10')]=_0x5d6843[_0x9435('0x10')];this[_0x9435('0x14')]=_0x5d6843[_0x9435('0x14')];this[_0x9435('0x11')]=_0x5d6843[_0x9435('0x11')];this[_0x9435('0x12')]=_0x5d6843[_0x9435('0x12')];this[_0x9435('0x15')]=_0xcc1f9d[_0x9435('0x15')];this[_0x9435('0x16')]=_0x5d6843[_0x9435('0x17')];this[_0x9435('0x18')]=_0x5d6843['number'];this['starttime']=_0x5d6843[_0x9435('0x19')];this[_0x9435('0x1a')]=_0x5d6843[_0x9435('0x1a')];this[_0x9435('0x1b')]=moment()[_0x9435('0x1c')](_0x9435('0x1d'));this[_0x9435('0x1e')]=getSeconds(_0x5d6843['responsetime'],_0x5d6843[_0x9435('0x19')]);this[_0x9435('0x1f')]=0x0;this['talktime']=getSeconds(this[_0x9435('0x1b')],_0x5d6843['responsetime']);this[_0x9435('0xb')]=_0x5d6843['queue'];this[_0x9435('0x20')]=_0x9435('0x21');this[_0x9435('0x22')]=_0xcc1f9d[_0x9435('0x23')];this['callback']=_0x5d6843['callback'];this[_0x9435('0x24')]=_0x5d6843['callbackuniqueid'];this[_0x9435('0x25')]=_0x5d6843['callbackat'];this['recallme']=_0x5d6843[_0x9435('0x26')];this[_0x9435('0x27')]=_0x5d6843[_0x9435('0x27')];this[_0x9435('0x28')]=_0x5d6843['ListId'];this[_0x9435('0x29')]=_0x5d6843['UserId'];this['VoiceQueueId']=_0x5d6843[_0x9435('0x2a')];this[_0x9435('0x2b')]=_0x5d6843[_0x9435('0x2b')];}module[_0x9435('0x2c')]=Hangup;