4a7099bd3cdea8891e10f9b6dbcbae5a8fc92f8a
[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 _0xf290=['calleridnum','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','diff','seconds','statedesc','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name'];(function(_0x4632ae,_0x2977ca){var _0x2c5c0c=function(_0x10659c){while(--_0x10659c){_0x4632ae['push'](_0x4632ae['shift']());}};_0x2c5c0c(++_0x2977ca);}(_0xf290,0x68));var _0x0f29=function(_0x25d2fb,_0x18a774){_0x25d2fb=_0x25d2fb-0x0;var _0x1ded53=_0xf290[_0x25d2fb];return _0x1ded53;};'use strict';var util=require(_0x0f29('0x0'));var _=require(_0x0f29('0x1'));var moment=require(_0x0f29('0x2'));function getSeconds(_0x182c57,_0x388541){var _0x5cec83=moment(_0x182c57)['milliseconds'](0x0);var _0x1fd3cb=moment(_0x388541)[_0x0f29('0x3')](0x0);return _0x5cec83[_0x0f29('0x4')](_0x1fd3cb,_0x0f29('0x5'));}function Hangup(_0x5ab76c,_0x1ad26e){this['state']=0x4;this[_0x0f29('0x6')]='Answer';this[_0x0f29('0x7')]=_0x5ab76c[_0x0f29('0x7')];this[_0x0f29('0x8')]=_0x5ab76c[_0x0f29('0x8')];this['campaigntype']=_0x5ab76c[_0x0f29('0x8')]==='outbound'?_0x0f29('0x9'):_0x5ab76c['type'];this[_0x0f29('0xa')]=_0x5ab76c[_0x0f29('0xa')];this[_0x0f29('0xb')]=_0x5ab76c[_0x0f29('0xb')];this[_0x0f29('0xc')]=_0x5ab76c['countnoanswerretry'];this[_0x0f29('0xd')]=_0x5ab76c[_0x0f29('0xa')]+_0x5ab76c['countcongestionretry']+_0x5ab76c[_0x0f29('0xc')]+_0x5ab76c[_0x0f29('0xe')]+_0x5ab76c['countdropretry']+_0x5ab76c[_0x0f29('0xf')]+_0x5ab76c[_0x0f29('0x10')]+_0x5ab76c[_0x0f29('0x11')];this[_0x0f29('0xe')]=_0x5ab76c[_0x0f29('0xe')];this['countdropretry']=_0x5ab76c[_0x0f29('0x12')];this[_0x0f29('0xf')]=_0x5ab76c['countabandonedretry'];this[_0x0f29('0x10')]=_0x5ab76c[_0x0f29('0x10')];this[_0x0f29('0x11')]=_0x5ab76c[_0x0f29('0x11')];this[_0x0f29('0x13')]=_0x1ad26e[_0x0f29('0x13')];this[_0x0f29('0x14')]=_0x5ab76c[_0x0f29('0x15')];this[_0x0f29('0x16')]=_0x5ab76c['number'];this[_0x0f29('0x17')]=_0x5ab76c[_0x0f29('0x17')];this['responsetime']=_0x5ab76c[_0x0f29('0x18')];this['endtime']=moment()[_0x0f29('0x19')](_0x0f29('0x1a'));this[_0x0f29('0x1b')]=getSeconds(_0x5ab76c[_0x0f29('0x18')],_0x5ab76c['starttime']);this[_0x0f29('0x1c')]=0x0;this[_0x0f29('0x1d')]=getSeconds(this[_0x0f29('0x1e')],_0x5ab76c[_0x0f29('0x18')]);this[_0x0f29('0x9')]=_0x5ab76c[_0x0f29('0x9')];this[_0x0f29('0x1f')]='IVR';this[_0x0f29('0x20')]=_0x1ad26e['cause-txt'];this['callback']=_0x5ab76c[_0x0f29('0x21')];this[_0x0f29('0x22')]=_0x5ab76c[_0x0f29('0x22')];this[_0x0f29('0x23')]=_0x5ab76c['callbackat'];this[_0x0f29('0x24')]=_0x5ab76c['recallme'];this['ContactId']=_0x5ab76c[_0x0f29('0x25')];this[_0x0f29('0x26')]=_0x5ab76c['ListId'];this[_0x0f29('0x27')]=_0x5ab76c[_0x0f29('0x27')];this[_0x0f29('0x28')]=_0x5ab76c[_0x0f29('0x28')];this[_0x0f29('0x29')]=_0x5ab76c[_0x0f29('0x29')];}module['exports']=Hangup;