8e64f2bcc750ac35deb764b90fdd46521f66bd26
[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 _0x3c62=['membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','format','ringtime','talktime','endtime','queue'];(function(_0x31cece,_0x4c61d6){var _0x2319b7=function(_0x52b927){while(--_0x52b927){_0x31cece['push'](_0x31cece['shift']());}};_0x2319b7(++_0x4c61d6);}(_0x3c62,0xbd));var _0x23c6=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x3c62[_0x491a7f];return _0x3d8f44;};'use strict';var util=require(_0x23c6('0x0'));var _=require('lodash');var moment=require(_0x23c6('0x1'));function getSeconds(_0x2761a1,_0x5d518f){var _0x3fc947=moment(_0x2761a1)[_0x23c6('0x2')](0x0);var _0x3cf7d0=moment(_0x5d518f)['milliseconds'](0x0);return _0x3fc947['diff'](_0x3cf7d0,_0x23c6('0x3'));}function Hangup(_0x4802ba,_0x1bfb15){this[_0x23c6('0x4')]=0x4;this[_0x23c6('0x5')]=_0x23c6('0x6');this[_0x23c6('0x7')]=_0x4802ba[_0x23c6('0x7')];this[_0x23c6('0x8')]=_0x4802ba[_0x23c6('0x8')];this[_0x23c6('0x9')]=_0x4802ba[_0x23c6('0x8')]===_0x23c6('0xa')?'queue':_0x4802ba[_0x23c6('0x8')];this[_0x23c6('0xb')]=_0x4802ba[_0x23c6('0xb')];this['countcongestionretry']=_0x4802ba['countcongestionretry'];this['countnoanswerretry']=_0x4802ba[_0x23c6('0xc')];this[_0x23c6('0xd')]=_0x4802ba[_0x23c6('0xb')]+_0x4802ba[_0x23c6('0xe')]+_0x4802ba[_0x23c6('0xc')]+_0x4802ba['countnosuchnumberretry']+_0x4802ba[_0x23c6('0xf')]+_0x4802ba['countabandonedretry']+_0x4802ba['countmachineretry']+_0x4802ba['countagentrejectretry'];this[_0x23c6('0x10')]=_0x4802ba[_0x23c6('0x10')];this[_0x23c6('0xf')]=_0x4802ba['countdropretry'];this[_0x23c6('0x11')]=_0x4802ba[_0x23c6('0x11')];this['countmachineretry']=_0x4802ba[_0x23c6('0x12')];this[_0x23c6('0x13')]=_0x4802ba['countagentrejectretry'];this[_0x23c6('0x14')]=_0x1bfb15[_0x23c6('0x14')];this[_0x23c6('0x15')]=_0x4802ba[_0x23c6('0x16')];this['calleridnum']=_0x4802ba[_0x23c6('0x17')];this[_0x23c6('0x18')]=_0x4802ba[_0x23c6('0x18')];this[_0x23c6('0x19')]=_0x4802ba['responsetime'];this['endtime']=moment()[_0x23c6('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x23c6('0x1b')]=getSeconds(_0x4802ba[_0x23c6('0x19')],_0x4802ba[_0x23c6('0x18')]);this['holdtime']=0x0;this[_0x23c6('0x1c')]=getSeconds(this[_0x23c6('0x1d')],_0x4802ba[_0x23c6('0x19')]);this[_0x23c6('0x1e')]=_0x4802ba[_0x23c6('0x1e')];this[_0x23c6('0x1f')]=_0x23c6('0x20');this[_0x23c6('0x21')]=_0x1bfb15[_0x23c6('0x22')];this[_0x23c6('0x23')]=_0x4802ba[_0x23c6('0x23')];this['callbackuniqueid']=_0x4802ba[_0x23c6('0x24')];this[_0x23c6('0x25')]=_0x4802ba[_0x23c6('0x25')];this[_0x23c6('0x26')]=_0x4802ba['recallme'];this['ContactId']=_0x4802ba['ContactId'];this[_0x23c6('0x27')]=_0x4802ba[_0x23c6('0x27')];this[_0x23c6('0x28')]=_0x4802ba[_0x23c6('0x28')];this[_0x23c6('0x29')]=_0x4802ba[_0x23c6('0x29')];this[_0x23c6('0x2a')]=_0x4802ba['CampaignId'];}module[_0x23c6('0x2b')]=Hangup;