Built motion from commit e02f907f.|2.6.14
[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 _0x63ff=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','code','error','message','UserFaxQueue,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x63ff,0x116));var _0xf63f=function(_0x2b2d2c,_0x5cccef){_0x2b2d2c=_0x2b2d2c-0x0;var _0x4d70aa=_0x63ff[_0x2b2d2c];return _0x4d70aa;};'use strict';var _=require(_0xf63f('0x0'));var util=require(_0xf63f('0x1'));var moment=require(_0xf63f('0x2'));var BPromise=require(_0xf63f('0x3'));var rs=require(_0xf63f('0x4'));var fs=require('fs');var Redis=require(_0xf63f('0x5'));var db=require(_0xf63f('0x6'))['db'];var utils=require(_0xf63f('0x7'));var logger=require('../../config/logger')(_0xf63f('0x8'));var config=require(_0xf63f('0x9'));var jayson=require(_0xf63f('0xa'));var client=jayson[_0xf63f('0xb')][_0xf63f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e502c,_0x2c6daf,_0x469b60){return new BPromise(function(_0x734b94,_0xa27f85){return client[_0xf63f('0xd')](_0x5e502c,_0x469b60)['then'](function(_0x52a551){logger[_0xf63f('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x2c6daf,_0xf63f('0xf'));logger[_0xf63f('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x2c6daf,_0xf63f('0xf'),JSON[_0xf63f('0x11')](_0x52a551));if(_0x52a551['error']){if(_0x52a551['error'][_0xf63f('0x12')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x2c6daf,_0x52a551['error']['message']);return _0xa27f85(_0x52a551[_0xf63f('0x13')][_0xf63f('0x14')]);}logger[_0xf63f('0x13')](_0xf63f('0x15'),_0x2c6daf,_0x52a551['error'][_0xf63f('0x14')]);return _0x734b94(_0x52a551[_0xf63f('0x13')][_0xf63f('0x14')]);}else{logger[_0xf63f('0xe')](_0xf63f('0x15'),_0x2c6daf,_0xf63f('0xf'));_0x734b94(_0x52a551['result']['message']);}})['catch'](function(_0x2a2a19){logger[_0xf63f('0x13')](_0xf63f('0x15'),_0x2c6daf,_0x2a2a19);_0xa27f85(_0x2a2a19);});});}