Built motion from commit 87cd5f02.|2.5.48
[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 _0x9589=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x12b1a6,_0x22df2d){var _0x5813d3=function(_0x57773e){while(--_0x57773e){_0x12b1a6['push'](_0x12b1a6['shift']());}};_0x5813d3(++_0x22df2d);}(_0x9589,0xbc));var _0x9958=function(_0x41554a,_0x542479){_0x41554a=_0x41554a-0x0;var _0x17edd7=_0x9589[_0x41554a];return _0x17edd7;};'use strict';var _=require(_0x9958('0x0'));var util=require(_0x9958('0x1'));var moment=require(_0x9958('0x2'));var BPromise=require(_0x9958('0x3'));var rs=require(_0x9958('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9958('0x5'))['db'];var utils=require(_0x9958('0x6'));var logger=require(_0x9958('0x7'))('rpc');var config=require(_0x9958('0x8'));var jayson=require(_0x9958('0x9'));var client=jayson[_0x9958('0xa')][_0x9958('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4225da,_0x2c3eaf,_0x5750c5){return new BPromise(function(_0x2ac795,_0x19f3b3){return client[_0x9958('0xc')](_0x4225da,_0x5750c5)[_0x9958('0xd')](function(_0x21f35c){logger[_0x9958('0xe')](_0x9958('0xf'),_0x2c3eaf,_0x9958('0x10'));logger[_0x9958('0x11')](_0x9958('0x12'),_0x2c3eaf,_0x9958('0x10'),JSON[_0x9958('0x13')](_0x21f35c));if(_0x21f35c[_0x9958('0x14')]){if(_0x21f35c[_0x9958('0x14')][_0x9958('0x15')]===0x1f4){logger[_0x9958('0x14')](_0x9958('0xf'),_0x2c3eaf,_0x21f35c[_0x9958('0x14')]['message']);return _0x19f3b3(_0x21f35c[_0x9958('0x14')]['message']);}logger[_0x9958('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0x2c3eaf,_0x21f35c[_0x9958('0x14')][_0x9958('0x16')]);return _0x2ac795(_0x21f35c[_0x9958('0x14')][_0x9958('0x16')]);}else{logger['info'](_0x9958('0xf'),_0x2c3eaf,_0x9958('0x10'));_0x2ac795(_0x21f35c['result']['message']);}})[_0x9958('0x17')](function(_0x4a27cf){logger[_0x9958('0x14')](_0x9958('0xf'),_0x2c3eaf,_0x4a27cf);_0x19f3b3(_0x4a27cf);});});}