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 _0x3ace=['request','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','http'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3ace,0x1eb));var _0xe3ac=function(_0x548b70,_0x4860f6){_0x548b70=_0x548b70-0x0;var _0xd21679=_0x3ace[_0x548b70];return _0xd21679;};'use strict';var _=require(_0xe3ac('0x0'));var util=require(_0xe3ac('0x1'));var moment=require(_0xe3ac('0x2'));var BPromise=require(_0xe3ac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3ac('0x4'));var db=require(_0xe3ac('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe3ac('0x6'));var jayson=require(_0xe3ac('0x7'));var client=jayson['client'][_0xe3ac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5858df,_0x33830f,_0x16e241){return new BPromise(function(_0x53c430,_0x1644b7){return client[_0xe3ac('0x9')](_0x5858df,_0x16e241)['then'](function(_0x2de717){logger[_0xe3ac('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x33830f,_0xe3ac('0xb'));logger[_0xe3ac('0xc')](_0xe3ac('0xd'),_0x33830f,'request\x20sent',JSON[_0xe3ac('0xe')](_0x2de717));if(_0x2de717[_0xe3ac('0xf')]){if(_0x2de717[_0xe3ac('0xf')]['code']===0x1f4){logger[_0xe3ac('0xf')](_0xe3ac('0x10'),_0x33830f,_0x2de717['error'][_0xe3ac('0x11')]);return _0x1644b7(_0x2de717[_0xe3ac('0xf')][_0xe3ac('0x11')]);}logger['error'](_0xe3ac('0x10'),_0x33830f,_0x2de717[_0xe3ac('0xf')][_0xe3ac('0x11')]);return _0x53c430(_0x2de717[_0xe3ac('0xf')][_0xe3ac('0x11')]);}else{logger[_0xe3ac('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x33830f,_0xe3ac('0xb'));_0x53c430(_0x2de717[_0xe3ac('0x12')][_0xe3ac('0x11')]);}})[_0xe3ac('0x13')](function(_0x4ef5cb){logger[_0xe3ac('0xf')](_0xe3ac('0x10'),_0x33830f,_0x4ef5cb);_0x1644b7(_0x4ef5cb);});});}