a3fe34ebdefa8239f87dbabc1e352ff81998e2ab
[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 _0xc130=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x4b0290,_0x188c34){var _0x4bd9f4=function(_0x357f3f){while(--_0x357f3f){_0x4b0290['push'](_0x4b0290['shift']());}};_0x4bd9f4(++_0x188c34);}(_0xc130,0x7c));var _0x0c13=function(_0x57df66,_0xf7a1eb){_0x57df66=_0x57df66-0x0;var _0x52baae=_0xc130[_0x57df66];return _0x52baae;};'use strict';var _=require(_0x0c13('0x0'));var util=require(_0x0c13('0x1'));var moment=require(_0x0c13('0x2'));var BPromise=require(_0x0c13('0x3'));var rs=require(_0x0c13('0x4'));var fs=require('fs');var Redis=require(_0x0c13('0x5'));var db=require(_0x0c13('0x6'))['db'];var utils=require(_0x0c13('0x7'));var logger=require(_0x0c13('0x8'))(_0x0c13('0x9'));var config=require(_0x0c13('0xa'));var jayson=require(_0x0c13('0xb'));var client=jayson[_0x0c13('0xc')][_0x0c13('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2eaff3,_0x14bc49,_0x36104f){return new BPromise(function(_0x400c1f,_0x4ba593){return client[_0x0c13('0xe')](_0x2eaff3,_0x36104f)[_0x0c13('0xf')](function(_0x582c1f){logger[_0x0c13('0x10')](_0x0c13('0x11'),_0x14bc49,_0x0c13('0x12'));logger['debug'](_0x0c13('0x13'),_0x14bc49,'request\x20sent',JSON[_0x0c13('0x14')](_0x582c1f));if(_0x582c1f[_0x0c13('0x15')]){if(_0x582c1f[_0x0c13('0x15')][_0x0c13('0x16')]===0x1f4){logger[_0x0c13('0x15')](_0x0c13('0x11'),_0x14bc49,_0x582c1f[_0x0c13('0x15')][_0x0c13('0x17')]);return _0x4ba593(_0x582c1f[_0x0c13('0x15')][_0x0c13('0x17')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x14bc49,_0x582c1f[_0x0c13('0x15')][_0x0c13('0x17')]);return _0x400c1f(_0x582c1f[_0x0c13('0x15')]['message']);}else{logger[_0x0c13('0x10')](_0x0c13('0x11'),_0x14bc49,_0x0c13('0x12'));_0x400c1f(_0x582c1f['result'][_0x0c13('0x17')]);}})[_0x0c13('0x18')](function(_0x2e5791){logger[_0x0c13('0x15')](_0x0c13('0x11'),_0x14bc49,_0x2e5791);_0x4ba593(_0x2e5791);});});}