b9db4ea5ed1a5723172f3590f2e05bad0c235512
[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 _0xdc59=['catch','lodash','util','moment','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'];(function(_0x5ecb21,_0x4ea672){var _0x4c925d=function(_0x54a5f4){while(--_0x54a5f4){_0x5ecb21['push'](_0x5ecb21['shift']());}};_0x4c925d(++_0x4ea672);}(_0xdc59,0x12c));var _0x9dc5=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0xdc59[_0x46ae5a];return _0x434986;};'use strict';var _=require(_0x9dc5('0x0'));var util=require(_0x9dc5('0x1'));var moment=require(_0x9dc5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9dc5('0x3'));var db=require(_0x9dc5('0x4'))['db'];var utils=require(_0x9dc5('0x5'));var logger=require(_0x9dc5('0x6'))(_0x9dc5('0x7'));var config=require(_0x9dc5('0x8'));var jayson=require(_0x9dc5('0x9'));var client=jayson[_0x9dc5('0xa')][_0x9dc5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48beee,_0x42941b,_0x10b268){return new BPromise(function(_0x202a8a,_0x3729b6){return client[_0x9dc5('0xc')](_0x48beee,_0x10b268)[_0x9dc5('0xd')](function(_0x174835){logger[_0x9dc5('0xe')](_0x9dc5('0xf'),_0x42941b,_0x9dc5('0x10'));logger['debug'](_0x9dc5('0x11'),_0x42941b,_0x9dc5('0x10'),JSON[_0x9dc5('0x12')](_0x174835));if(_0x174835[_0x9dc5('0x13')]){if(_0x174835['error'][_0x9dc5('0x14')]===0x1f4){logger[_0x9dc5('0x13')](_0x9dc5('0xf'),_0x42941b,_0x174835['error'][_0x9dc5('0x15')]);return _0x3729b6(_0x174835[_0x9dc5('0x13')][_0x9dc5('0x15')]);}logger[_0x9dc5('0x13')](_0x9dc5('0xf'),_0x42941b,_0x174835[_0x9dc5('0x13')][_0x9dc5('0x15')]);return _0x202a8a(_0x174835[_0x9dc5('0x13')][_0x9dc5('0x15')]);}else{logger[_0x9dc5('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x42941b,_0x9dc5('0x10'));_0x202a8a(_0x174835['result'][_0x9dc5('0x15')]);}})[_0x9dc5('0x16')](function(_0x5a9ffb){logger[_0x9dc5('0x13')](_0x9dc5('0xf'),_0x42941b,_0x5a9ffb);_0x3729b6(_0x5a9ffb);});});}