Built motion from commit 4d4d9a88.|2.6.26
[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 _0xbdfd=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xbdfd,0x135));var _0xdbdf=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbdfd[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xdbdf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdbdf('0x1'));var rs=require(_0xdbdf('0x2'));var fs=require('fs');var Redis=require(_0xdbdf('0x3'));var db=require(_0xdbdf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdbdf('0x5'))(_0xdbdf('0x6'));var config=require('../../config/environment');var jayson=require(_0xdbdf('0x7'));var client=jayson[_0xdbdf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40096b,_0x116557,_0x121a56){return new BPromise(function(_0x272b5b,_0x39c0c6){return client['request'](_0x40096b,_0x121a56)[_0xdbdf('0x9')](function(_0x2fd118){logger[_0xdbdf('0xa')](_0xdbdf('0xb'),_0x116557,_0xdbdf('0xc'));logger[_0xdbdf('0xd')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x116557,'request\x20sent',JSON[_0xdbdf('0xe')](_0x2fd118));if(_0x2fd118[_0xdbdf('0xf')]){if(_0x2fd118[_0xdbdf('0xf')][_0xdbdf('0x10')]===0x1f4){logger[_0xdbdf('0xf')](_0xdbdf('0xb'),_0x116557,_0x2fd118['error'][_0xdbdf('0x11')]);return _0x39c0c6(_0x2fd118[_0xdbdf('0xf')][_0xdbdf('0x11')]);}logger[_0xdbdf('0xf')](_0xdbdf('0xb'),_0x116557,_0x2fd118[_0xdbdf('0xf')][_0xdbdf('0x11')]);return _0x272b5b(_0x2fd118['error'][_0xdbdf('0x11')]);}else{logger[_0xdbdf('0xa')](_0xdbdf('0xb'),_0x116557,_0xdbdf('0xc'));_0x272b5b(_0x2fd118[_0xdbdf('0x12')]['message']);}})[_0xdbdf('0x13')](function(_0x34c928){logger[_0xdbdf('0xf')](_0xdbdf('0xb'),_0x116557,_0x34c928);_0x39c0c6(_0x34c928);});});}