1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x4b06=['request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then'];(function(_0x49327d,_0x4a484b){var _0x4f2c09=function(_0x1e29fc){while(--_0x1e29fc){_0x49327d['push'](_0x49327d['shift']());}};_0x4f2c09(++_0x4a484b);}(_0x4b06,0x107));var _0x64b0=function(_0x39a5cd,_0xca6b99){_0x39a5cd=_0x39a5cd-0x0;var _0x27a68c=_0x4b06[_0x39a5cd];return _0x27a68c;};'use strict';var _=require(_0x64b0('0x0'));var util=require('util');var moment=require(_0x64b0('0x1'));var BPromise=require('bluebird');var rs=require(_0x64b0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64b0('0x3'))['db'];var utils=require(_0x64b0('0x4'));var logger=require(_0x64b0('0x5'))('rpc');var config=require(_0x64b0('0x6'));var jayson=require(_0x64b0('0x7'));var client=jayson[_0x64b0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x421eee,_0xa77936,_0xbb91cd){return new BPromise(function(_0x42a048,_0x3f9e42){return client['request'](_0x421eee,_0xbb91cd)[_0x64b0('0x9')](function(_0xe87a8a){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0xa77936,_0x64b0('0xa'));logger[_0x64b0('0xb')](_0x64b0('0xc'),_0xa77936,_0x64b0('0xa'),JSON[_0x64b0('0xd')](_0xe87a8a));if(_0xe87a8a[_0x64b0('0xe')]){if(_0xe87a8a['error'][_0x64b0('0xf')]===0x1f4){logger['error'](_0x64b0('0x10'),_0xa77936,_0xe87a8a[_0x64b0('0xe')][_0x64b0('0x11')]);return _0x3f9e42(_0xe87a8a['error'][_0x64b0('0x11')]);}logger['error'](_0x64b0('0x10'),_0xa77936,_0xe87a8a[_0x64b0('0xe')]['message']);return _0x42a048(_0xe87a8a[_0x64b0('0xe')][_0x64b0('0x11')]);}else{logger[_0x64b0('0x12')](_0x64b0('0x10'),_0xa77936,'request\x20sent');_0x42a048(_0xe87a8a[_0x64b0('0x13')][_0x64b0('0x11')]);}})[_0x64b0('0x14')](function(_0x134da9){logger[_0x64b0('0xe')](_0x64b0('0x10'),_0xa77936,_0x134da9);_0x3f9e42(_0x134da9);});});}