Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / userFaxQueue / userFaxQueue.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 _0xe6b9=['../../config/environment','jayson/promise','client','request','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4f6289,_0x51b3c0){var _0x433d64=function(_0x3e9087){while(--_0x3e9087){_0x4f6289['push'](_0x4f6289['shift']());}};_0x433d64(++_0x51b3c0);}(_0xe6b9,0xa8));var _0x9e6b=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xe6b9[_0x24237f];return _0x48298e;};'use strict';var _=require('lodash');var util=require(_0x9e6b('0x0'));var moment=require(_0x9e6b('0x1'));var BPromise=require(_0x9e6b('0x2'));var rs=require(_0x9e6b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e6b('0x4'))['db'];var utils=require(_0x9e6b('0x5'));var logger=require(_0x9e6b('0x6'))(_0x9e6b('0x7'));var config=require(_0x9e6b('0x8'));var jayson=require(_0x9e6b('0x9'));var client=jayson[_0x9e6b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c93b9,_0xdd6616,_0x49d3ab){return new BPromise(function(_0x3a2a52,_0x15e874){return client[_0x9e6b('0xb')](_0x1c93b9,_0x49d3ab)['then'](function(_0x3a89d3){logger['info'](_0x9e6b('0xc'),_0xdd6616,_0x9e6b('0xd'));logger[_0x9e6b('0xe')](_0x9e6b('0xf'),_0xdd6616,_0x9e6b('0xd'),JSON[_0x9e6b('0x10')](_0x3a89d3));if(_0x3a89d3[_0x9e6b('0x11')]){if(_0x3a89d3['error'][_0x9e6b('0x12')]===0x1f4){logger[_0x9e6b('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0xdd6616,_0x3a89d3[_0x9e6b('0x11')][_0x9e6b('0x13')]);return _0x15e874(_0x3a89d3[_0x9e6b('0x11')][_0x9e6b('0x13')]);}logger['error'](_0x9e6b('0xc'),_0xdd6616,_0x3a89d3[_0x9e6b('0x11')][_0x9e6b('0x13')]);return _0x3a2a52(_0x3a89d3[_0x9e6b('0x11')][_0x9e6b('0x13')]);}else{logger['info'](_0x9e6b('0xc'),_0xdd6616,_0x9e6b('0xd'));_0x3a2a52(_0x3a89d3[_0x9e6b('0x14')][_0x9e6b('0x13')]);}})[_0x9e6b('0x15')](function(_0x2b2212){logger['error'](_0x9e6b('0xc'),_0xdd6616,_0x2b2212);_0x15e874(_0x2b2212);});});}