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 _0x3833=['code','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x49052b,_0x3ba709){var _0x48c045=function(_0x41ac38){while(--_0x41ac38){_0x49052b['push'](_0x49052b['shift']());}};_0x48c045(++_0x3ba709);}(_0x3833,0x1bd));var _0x3383=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x3833[_0x341e0f];return _0x59555a;};'use strict';var _=require('lodash');var util=require(_0x3383('0x0'));var moment=require('moment');var BPromise=require(_0x3383('0x1'));var rs=require(_0x3383('0x2'));var fs=require('fs');var Redis=require(_0x3383('0x3'));var db=require(_0x3383('0x4'))['db'];var utils=require(_0x3383('0x5'));var logger=require('../../config/logger')(_0x3383('0x6'));var config=require(_0x3383('0x7'));var jayson=require(_0x3383('0x8'));var client=jayson['client'][_0x3383('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x426627,_0xffe77,_0x4c00b3){return new BPromise(function(_0x279969,_0x4bef31){return client[_0x3383('0xa')](_0x426627,_0x4c00b3)[_0x3383('0xb')](function(_0x3e3a86){logger[_0x3383('0xc')](_0x3383('0xd'),_0xffe77,_0x3383('0xe'));logger['debug'](_0x3383('0xf'),_0xffe77,_0x3383('0xe'),JSON[_0x3383('0x10')](_0x3e3a86));if(_0x3e3a86['error']){if(_0x3e3a86['error'][_0x3383('0x11')]===0x1f4){logger[_0x3383('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0xffe77,_0x3e3a86[_0x3383('0x12')][_0x3383('0x13')]);return _0x4bef31(_0x3e3a86[_0x3383('0x12')]['message']);}logger[_0x3383('0x12')](_0x3383('0xd'),_0xffe77,_0x3e3a86[_0x3383('0x12')]['message']);return _0x279969(_0x3e3a86['error'][_0x3383('0x13')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0xffe77,'request\x20sent');_0x279969(_0x3e3a86['result'][_0x3383('0x13')]);}})[_0x3383('0x14')](function(_0x33b7a6){logger[_0x3383('0x12')](_0x3383('0xd'),_0xffe77,_0x33b7a6);_0x4bef31(_0x33b7a6);});});}