Built motion from commit 85328c08.|2.5.50
[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 _0xc0a4=['error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4536a4,_0x55af7b){var _0x4fd1c1=function(_0x4c68cd){while(--_0x4c68cd){_0x4536a4['push'](_0x4536a4['shift']());}};_0x4fd1c1(++_0x55af7b);}(_0xc0a4,0x147));var _0x4c0a=function(_0x5ec41b,_0x3e2d08){_0x5ec41b=_0x5ec41b-0x0;var _0x4fad0b=_0xc0a4[_0x5ec41b];return _0x4fad0b;};'use strict';var _=require('lodash');var util=require(_0x4c0a('0x0'));var moment=require(_0x4c0a('0x1'));var BPromise=require(_0x4c0a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c0a('0x3'));var db=require(_0x4c0a('0x4'))['db'];var utils=require(_0x4c0a('0x5'));var logger=require(_0x4c0a('0x6'))(_0x4c0a('0x7'));var config=require('../../config/environment');var jayson=require(_0x4c0a('0x8'));var client=jayson[_0x4c0a('0x9')][_0x4c0a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x457ef9,_0x7ca892,_0x1a64e7){return new BPromise(function(_0x4093d5,_0x33aedb){return client[_0x4c0a('0xb')](_0x457ef9,_0x1a64e7)['then'](function(_0x3bfa91){logger[_0x4c0a('0xc')](_0x4c0a('0xd'),_0x7ca892,_0x4c0a('0xe'));logger[_0x4c0a('0xf')](_0x4c0a('0x10'),_0x7ca892,_0x4c0a('0xe'),JSON[_0x4c0a('0x11')](_0x3bfa91));if(_0x3bfa91[_0x4c0a('0x12')]){if(_0x3bfa91[_0x4c0a('0x12')][_0x4c0a('0x13')]===0x1f4){logger[_0x4c0a('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x7ca892,_0x3bfa91[_0x4c0a('0x12')][_0x4c0a('0x14')]);return _0x33aedb(_0x3bfa91[_0x4c0a('0x12')][_0x4c0a('0x14')]);}logger['error'](_0x4c0a('0xd'),_0x7ca892,_0x3bfa91[_0x4c0a('0x12')][_0x4c0a('0x14')]);return _0x4093d5(_0x3bfa91[_0x4c0a('0x12')][_0x4c0a('0x14')]);}else{logger[_0x4c0a('0xc')](_0x4c0a('0xd'),_0x7ca892,_0x4c0a('0xe'));_0x4093d5(_0x3bfa91[_0x4c0a('0x15')][_0x4c0a('0x14')]);}})[_0x4c0a('0x16')](function(_0x4637a8){logger[_0x4c0a('0x12')](_0x4c0a('0xd'),_0x7ca892,_0x4637a8);_0x33aedb(_0x4637a8);});});}