Built motion from commit (unavailable).|2.4.20
[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 _0x034b=['stringify','error','code','message','util','moment','bluebird','ioredis','../../mysqldb','jayson/promise','client','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x034b,0x1b4));var _0xb034=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x034b[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xb034('0x0'));var moment=require(_0xb034('0x1'));var BPromise=require(_0xb034('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb034('0x3'));var db=require(_0xb034('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb034('0x5'));var client=jayson[_0xb034('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c1abb,_0xb7819b,_0x56a176){return new BPromise(function(_0x469a92,_0x40f39f){return client[_0xb034('0x7')](_0x4c1abb,_0x56a176)['then'](function(_0x4d02d1){logger[_0xb034('0x8')](_0xb034('0x9'),_0xb7819b,_0xb034('0xa'));logger['debug'](_0xb034('0xb'),_0xb7819b,'request\x20sent',JSON[_0xb034('0xc')](_0x4d02d1));if(_0x4d02d1[_0xb034('0xd')]){if(_0x4d02d1[_0xb034('0xd')][_0xb034('0xe')]===0x1f4){logger[_0xb034('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0xb7819b,_0x4d02d1[_0xb034('0xd')][_0xb034('0xf')]);return _0x40f39f(_0x4d02d1[_0xb034('0xd')][_0xb034('0xf')]);}logger[_0xb034('0xd')](_0xb034('0x9'),_0xb7819b,_0x4d02d1['error']['message']);return _0x469a92(_0x4d02d1[_0xb034('0xd')][_0xb034('0xf')]);}else{logger['info'](_0xb034('0x9'),_0xb7819b,_0xb034('0xa'));_0x469a92(_0x4d02d1['result'][_0xb034('0xf')]);}})['catch'](function(_0x7b363c){logger[_0xb034('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0xb7819b,_0x7b363c);_0x40f39f(_0x7b363c);});});}