Built motion from commit (unavailable).|2.5.11
[motion2.git] / server / api / smsTransferReport / smsTransferReport.rpc.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 _0x8e91=['info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1148d5,_0x559401){var _0x585624=function(_0x57f3ba){while(--_0x57f3ba){_0x1148d5['push'](_0x1148d5['shift']());}};_0x585624(++_0x559401);}(_0x8e91,0x1c1));var _0x18e9=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x8e91[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x18e9('0x0'));var util=require('util');var moment=require(_0x18e9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x18e9('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x18e9('0x3'))(_0x18e9('0x4'));var config=require(_0x18e9('0x5'));var jayson=require(_0x18e9('0x6'));var client=jayson[_0x18e9('0x7')][_0x18e9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39a7c7,_0xb3725,_0x5129cd){return new BPromise(function(_0x53e99c,_0x558a85){return client[_0x18e9('0x9')](_0x39a7c7,_0x5129cd)[_0x18e9('0xa')](function(_0x280454){logger[_0x18e9('0xb')](_0x18e9('0xc'),_0xb3725,_0x18e9('0xd'));logger['debug'](_0x18e9('0xe'),_0xb3725,_0x18e9('0xd'),JSON[_0x18e9('0xf')](_0x280454));if(_0x280454[_0x18e9('0x10')]){if(_0x280454['error'][_0x18e9('0x11')]===0x1f4){logger['error'](_0x18e9('0xc'),_0xb3725,_0x280454[_0x18e9('0x10')][_0x18e9('0x12')]);return _0x558a85(_0x280454[_0x18e9('0x10')][_0x18e9('0x12')]);}logger[_0x18e9('0x10')](_0x18e9('0xc'),_0xb3725,_0x280454[_0x18e9('0x10')][_0x18e9('0x12')]);return _0x53e99c(_0x280454[_0x18e9('0x10')][_0x18e9('0x12')]);}else{logger[_0x18e9('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0xb3725,_0x18e9('0xd'));_0x53e99c(_0x280454[_0x18e9('0x13')][_0x18e9('0x12')]);}})['catch'](function(_0x380d3b){logger[_0x18e9('0x10')](_0x18e9('0xc'),_0xb3725,_0x380d3b);_0x558a85(_0x380d3b);});});}