a348cf6718d06bbdc056fd2387ca02b2e883b5cf
[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 _0x7d73=['cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','CampaignId','exports','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','queue','membername','IVR','reason'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7d73,0x1d7));var _0x37d7=function(_0xa2c0a3,_0x5bbac0){_0xa2c0a3=_0xa2c0a3-0x0;var _0x52c618=_0x7d73[_0xa2c0a3];return _0x52c618;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x37d7('0x0'));function getSeconds(_0x16cbc6,_0x24e140){var _0x438051=moment(_0x16cbc6)[_0x37d7('0x1')](0x0);var _0x5c6ea8=moment(_0x24e140)['milliseconds'](0x0);return _0x438051[_0x37d7('0x2')](_0x5c6ea8,_0x37d7('0x3'));}function Hangup(_0x4e6a51,_0x1f6f2e){this[_0x37d7('0x4')]=0x4;this[_0x37d7('0x5')]=_0x37d7('0x6');this[_0x37d7('0x7')]=_0x4e6a51['scheduledat'];this[_0x37d7('0x8')]=_0x4e6a51[_0x37d7('0x8')];this[_0x37d7('0x9')]=_0x4e6a51[_0x37d7('0x8')]===_0x37d7('0xa')?'queue':_0x4e6a51['type'];this[_0x37d7('0xb')]=_0x4e6a51['countbusyretry'];this[_0x37d7('0xc')]=_0x4e6a51['countcongestionretry'];this['countnoanswerretry']=_0x4e6a51['countnoanswerretry'];this['countglobal']=_0x4e6a51['countbusyretry']+_0x4e6a51[_0x37d7('0xc')]+_0x4e6a51['countnoanswerretry']+_0x4e6a51[_0x37d7('0xd')]+_0x4e6a51[_0x37d7('0xe')]+_0x4e6a51[_0x37d7('0xf')]+_0x4e6a51[_0x37d7('0x10')]+_0x4e6a51[_0x37d7('0x11')];this['countnosuchnumberretry']=_0x4e6a51[_0x37d7('0xd')];this[_0x37d7('0xe')]=_0x4e6a51[_0x37d7('0xe')];this['countabandonedretry']=_0x4e6a51[_0x37d7('0xf')];this[_0x37d7('0x10')]=_0x4e6a51[_0x37d7('0x10')];this[_0x37d7('0x11')]=_0x4e6a51[_0x37d7('0x11')];this[_0x37d7('0x12')]=_0x1f6f2e[_0x37d7('0x12')];this[_0x37d7('0x13')]=_0x4e6a51['name'];this[_0x37d7('0x14')]=_0x4e6a51[_0x37d7('0x15')];this[_0x37d7('0x16')]=_0x4e6a51[_0x37d7('0x16')];this[_0x37d7('0x17')]=_0x4e6a51[_0x37d7('0x17')];this[_0x37d7('0x18')]=moment()[_0x37d7('0x19')](_0x37d7('0x1a'));this[_0x37d7('0x1b')]=getSeconds(_0x4e6a51[_0x37d7('0x17')],_0x4e6a51[_0x37d7('0x16')]);this[_0x37d7('0x1c')]=0x0;this['talktime']=getSeconds(this[_0x37d7('0x18')],_0x4e6a51[_0x37d7('0x17')]);this['queue']=_0x4e6a51[_0x37d7('0x1d')];this[_0x37d7('0x1e')]=_0x37d7('0x1f');this[_0x37d7('0x20')]=_0x1f6f2e[_0x37d7('0x21')];this[_0x37d7('0x22')]=_0x4e6a51[_0x37d7('0x22')];this[_0x37d7('0x23')]=_0x4e6a51[_0x37d7('0x23')];this[_0x37d7('0x24')]=_0x4e6a51[_0x37d7('0x24')];this[_0x37d7('0x25')]=_0x4e6a51[_0x37d7('0x25')];this[_0x37d7('0x26')]=_0x4e6a51[_0x37d7('0x26')];this['ListId']=_0x4e6a51['ListId'];this[_0x37d7('0x27')]=_0x4e6a51['UserId'];this['VoiceQueueId']=_0x4e6a51['VoiceQueueId'];this[_0x37d7('0x28')]=_0x4e6a51[_0x37d7('0x28')];}module[_0x37d7('0x29')]=Hangup;