Built motion from commit (unavailable).|2.5.12
[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 _0x3056=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x57b337,_0x45d2e6){var _0x2aabda=function(_0x34e5b2){while(--_0x34e5b2){_0x57b337['push'](_0x57b337['shift']());}};_0x2aabda(++_0x45d2e6);}(_0x3056,0x1ce));var _0x6305=function(_0x97be10,_0x18ebf6){_0x97be10=_0x97be10-0x0;var _0x5c4322=_0x3056[_0x97be10];return _0x5c4322;};'use strict';var _=require(_0x6305('0x0'));var util=require('util');var moment=require(_0x6305('0x1'));var BPromise=require(_0x6305('0x2'));var rs=require(_0x6305('0x3'));var fs=require('fs');var Redis=require(_0x6305('0x4'));var db=require(_0x6305('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6305('0x6'));var jayson=require(_0x6305('0x7'));var client=jayson[_0x6305('0x8')][_0x6305('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fac15,_0x2c1882,_0x4932f7){return new BPromise(function(_0x20b52b,_0x55ba42){return client[_0x6305('0xa')](_0x1fac15,_0x4932f7)['then'](function(_0x64448c){logger[_0x6305('0xb')](_0x6305('0xc'),_0x2c1882,'request\x20sent');logger[_0x6305('0xd')](_0x6305('0xe'),_0x2c1882,_0x6305('0xf'),JSON[_0x6305('0x10')](_0x64448c));if(_0x64448c[_0x6305('0x11')]){if(_0x64448c['error'][_0x6305('0x12')]===0x1f4){logger[_0x6305('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x2c1882,_0x64448c[_0x6305('0x11')][_0x6305('0x13')]);return _0x55ba42(_0x64448c['error'][_0x6305('0x13')]);}logger['error'](_0x6305('0xc'),_0x2c1882,_0x64448c[_0x6305('0x11')][_0x6305('0x13')]);return _0x20b52b(_0x64448c[_0x6305('0x11')][_0x6305('0x13')]);}else{logger[_0x6305('0xb')](_0x6305('0xc'),_0x2c1882,_0x6305('0xf'));_0x20b52b(_0x64448c[_0x6305('0x14')][_0x6305('0x13')]);}})[_0x6305('0x15')](function(_0x231277){logger[_0x6305('0x11')](_0x6305('0xc'),_0x2c1882,_0x231277);_0x55ba42(_0x231277);});});}