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 _0x4d41=['client','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x208d39,_0x5de94f){var _0x3f96cb=function(_0x23d510){while(--_0x23d510){_0x208d39['push'](_0x208d39['shift']());}};_0x3f96cb(++_0x5de94f);}(_0x4d41,0x1c5));var _0x14d4=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0x4d41[_0x10791d];return _0x1b4f9c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14d4('0x0'));var db=require(_0x14d4('0x1'))['db'];var utils=require(_0x14d4('0x2'));var logger=require(_0x14d4('0x3'))(_0x14d4('0x4'));var config=require(_0x14d4('0x5'));var jayson=require(_0x14d4('0x6'));var client=jayson[_0x14d4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eedc1,_0x5c34d9,_0x32557d){return new BPromise(function(_0x1859a9,_0x4dbb28){return client[_0x14d4('0x8')](_0x3eedc1,_0x32557d)['then'](function(_0x450208){logger[_0x14d4('0x9')](_0x14d4('0xa'),_0x5c34d9,_0x14d4('0xb'));logger[_0x14d4('0xc')](_0x14d4('0xd'),_0x5c34d9,_0x14d4('0xb'),JSON[_0x14d4('0xe')](_0x450208));if(_0x450208['error']){if(_0x450208[_0x14d4('0xf')][_0x14d4('0x10')]===0x1f4){logger[_0x14d4('0xf')](_0x14d4('0xa'),_0x5c34d9,_0x450208[_0x14d4('0xf')]['message']);return _0x4dbb28(_0x450208['error'][_0x14d4('0x11')]);}logger[_0x14d4('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5c34d9,_0x450208['error'][_0x14d4('0x11')]);return _0x1859a9(_0x450208[_0x14d4('0xf')][_0x14d4('0x11')]);}else{logger[_0x14d4('0x9')](_0x14d4('0xa'),_0x5c34d9,'request\x20sent');_0x1859a9(_0x450208[_0x14d4('0x12')][_0x14d4('0x11')]);}})[_0x14d4('0x13')](function(_0x4fbab1){logger[_0x14d4('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5c34d9,_0x4fbab1);_0x4dbb28(_0x4fbab1);});});}