Built motion from commit (unavailable).|2.5.31
[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 _0x26a8=['http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xe455e7,_0x29fb65){var _0xfc683e=function(_0x10ee38){while(--_0x10ee38){_0xe455e7['push'](_0xe455e7['shift']());}};_0xfc683e(++_0x29fb65);}(_0x26a8,0x1ac));var _0x826a=function(_0x470ddb,_0x1dfa35){_0x470ddb=_0x470ddb-0x0;var _0x5df573=_0x26a8[_0x470ddb];return _0x5df573;};'use strict';var _=require('lodash');var util=require(_0x826a('0x0'));var moment=require(_0x826a('0x1'));var BPromise=require(_0x826a('0x2'));var rs=require(_0x826a('0x3'));var fs=require('fs');var Redis=require(_0x826a('0x4'));var db=require(_0x826a('0x5'))['db'];var utils=require(_0x826a('0x6'));var logger=require(_0x826a('0x7'))(_0x826a('0x8'));var config=require(_0x826a('0x9'));var jayson=require(_0x826a('0xa'));var client=jayson[_0x826a('0xb')][_0x826a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47498c,_0x2011af,_0x50e67a){return new BPromise(function(_0xabf987,_0x4249bc){return client[_0x826a('0xd')](_0x47498c,_0x50e67a)['then'](function(_0x51e542){logger[_0x826a('0xe')](_0x826a('0xf'),_0x2011af,_0x826a('0x10'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2011af,_0x826a('0x10'),JSON['stringify'](_0x51e542));if(_0x51e542['error']){if(_0x51e542[_0x826a('0x11')][_0x826a('0x12')]===0x1f4){logger[_0x826a('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x2011af,_0x51e542[_0x826a('0x11')][_0x826a('0x13')]);return _0x4249bc(_0x51e542[_0x826a('0x11')]['message']);}logger[_0x826a('0x11')](_0x826a('0xf'),_0x2011af,_0x51e542['error']['message']);return _0xabf987(_0x51e542[_0x826a('0x11')]['message']);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x2011af,_0x826a('0x10'));_0xabf987(_0x51e542[_0x826a('0x14')][_0x826a('0x13')]);}})[_0x826a('0x15')](function(_0x58609a){logger[_0x826a('0x11')](_0x826a('0xf'),_0x2011af,_0x58609a);_0x4249bc(_0x58609a);});});}