Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / api / openchannelTransferReport / openchannelTransferReport.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 _0xa93e=['http','info','request\x20sent','debug','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa93e,0x1df));var _0xea93=function(_0x372dea,_0x3e8837){_0x372dea=_0x372dea-0x0;var _0x4e0c4a=_0xa93e[_0x372dea];return _0x4e0c4a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea93('0x0'));var BPromise=require(_0xea93('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea93('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xea93('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xea93('0x4'));var jayson=require(_0xea93('0x5'));var client=jayson[_0xea93('0x6')][_0xea93('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x477a7d,_0x3d53bd,_0x54ebdf){return new BPromise(function(_0x12876e,_0x55d233){return client['request'](_0x477a7d,_0x54ebdf)['then'](function(_0x19047a){logger[_0xea93('0x8')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3d53bd,_0xea93('0x9'));logger[_0xea93('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x3d53bd,_0xea93('0x9'),JSON[_0xea93('0xb')](_0x19047a));if(_0x19047a[_0xea93('0xc')]){if(_0x19047a[_0xea93('0xc')][_0xea93('0xd')]===0x1f4){logger[_0xea93('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3d53bd,_0x19047a[_0xea93('0xc')]['message']);return _0x55d233(_0x19047a['error'][_0xea93('0xe')]);}logger[_0xea93('0xc')](_0xea93('0xf'),_0x3d53bd,_0x19047a[_0xea93('0xc')][_0xea93('0xe')]);return _0x12876e(_0x19047a[_0xea93('0xc')]['message']);}else{logger[_0xea93('0x8')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3d53bd,_0xea93('0x9'));_0x12876e(_0x19047a[_0xea93('0x10')][_0xea93('0xe')]);}})[_0xea93('0x11')](function(_0x246b42){logger[_0xea93('0xc')](_0xea93('0xf'),_0x3d53bd,_0x246b42);_0x55d233(_0x246b42);});});}