910194d4d60be15acdd9d5efb81b405c942e0b0d
[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 _0x55d2=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelTransferReport,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','request\x20sent'];(function(_0x1d06a5,_0x4fc577){var _0xbaab59=function(_0x458664){while(--_0x458664){_0x1d06a5['push'](_0x1d06a5['shift']());}};_0xbaab59(++_0x4fc577);}(_0x55d2,0x9f));var _0x255d=function(_0x28fad6,_0x2d2220){_0x28fad6=_0x28fad6-0x0;var _0x3c6f2f=_0x55d2[_0x28fad6];return _0x3c6f2f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x255d('0x0'));var BPromise=require(_0x255d('0x1'));var rs=require(_0x255d('0x2'));var fs=require('fs');var Redis=require(_0x255d('0x3'));var db=require(_0x255d('0x4'))['db'];var utils=require(_0x255d('0x5'));var logger=require('../../config/logger')(_0x255d('0x6'));var config=require(_0x255d('0x7'));var jayson=require(_0x255d('0x8'));var client=jayson[_0x255d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f93b4,_0x15469e,_0xcf66a2){return new BPromise(function(_0x253ac9,_0xdb6ea7){return client[_0x255d('0xa')](_0x4f93b4,_0xcf66a2)['then'](function(_0x5198d7){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x15469e,_0x255d('0xb'));logger['debug'](_0x255d('0xc'),_0x15469e,_0x255d('0xb'),JSON[_0x255d('0xd')](_0x5198d7));if(_0x5198d7['error']){if(_0x5198d7['error'][_0x255d('0xe')]===0x1f4){logger[_0x255d('0xf')](_0x255d('0x10'),_0x15469e,_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);return _0xdb6ea7(_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);}logger[_0x255d('0xf')](_0x255d('0x10'),_0x15469e,_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);return _0x253ac9(_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);}else{logger['info'](_0x255d('0x10'),_0x15469e,_0x255d('0xb'));_0x253ac9(_0x5198d7['result'][_0x255d('0x11')]);}})[_0x255d('0x12')](function(_0x37c217){logger[_0x255d('0xf')](_0x255d('0x10'),_0x15469e,_0x37c217);_0xdb6ea7(_0x37c217);});});}