Built motion from commit 7158bc59.|2.5.42
[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 _0xd9c8=['http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x31ed74,_0x96d0de){var _0x260f84=function(_0x49e5f2){while(--_0x49e5f2){_0x31ed74['push'](_0x31ed74['shift']());}};_0x260f84(++_0x96d0de);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xd9c8[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x8d9c('0x0'));var util=require(_0x8d9c('0x1'));var moment=require('moment');var BPromise=require(_0x8d9c('0x2'));var rs=require(_0x8d9c('0x3'));var fs=require('fs');var Redis=require(_0x8d9c('0x4'));var db=require(_0x8d9c('0x5'))['db'];var utils=require(_0x8d9c('0x6'));var logger=require(_0x8d9c('0x7'))(_0x8d9c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8d9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ebb5a,_0x475edd,_0x49c96f){return new BPromise(function(_0x3790f6,_0x3de357){return client[_0x8d9c('0xa')](_0x1ebb5a,_0x49c96f)[_0x8d9c('0xb')](function(_0x2db4b3){logger[_0x8d9c('0xc')](_0x8d9c('0xd'),_0x475edd,_0x8d9c('0xe'));logger['debug'](_0x8d9c('0xf'),_0x475edd,'request\x20sent',JSON[_0x8d9c('0x10')](_0x2db4b3));if(_0x2db4b3['error']){if(_0x2db4b3[_0x8d9c('0x11')]['code']===0x1f4){logger['error'](_0x8d9c('0xd'),_0x475edd,_0x2db4b3['error'][_0x8d9c('0x12')]);return _0x3de357(_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);}logger[_0x8d9c('0x11')](_0x8d9c('0xd'),_0x475edd,_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);return _0x3790f6(_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);}else{logger[_0x8d9c('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x475edd,_0x8d9c('0xe'));_0x3790f6(_0x2db4b3[_0x8d9c('0x13')][_0x8d9c('0x12')]);}})[_0x8d9c('0x14')](function(_0x1a071d){logger[_0x8d9c('0x11')](_0x8d9c('0xd'),_0x475edd,_0x1a071d);_0x3de357(_0x1a071d);});});}