Built motion from commit (unavailable).|2.2.0
[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 _0xfc2c=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','moment','randomstring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfc2c,0x128));var _0xcfc2=function(_0x3c8c25,_0x27b96e){_0x3c8c25=_0x3c8c25-0x0;var _0x110f31=_0xfc2c[_0x3c8c25];return _0x110f31;};'use strict';var _=require(_0xcfc2('0x0'));var util=require('util');var moment=require(_0xcfc2('0x1'));var BPromise=require('bluebird');var rs=require(_0xcfc2('0x2'));var fs=require('fs');var Redis=require(_0xcfc2('0x3'));var db=require(_0xcfc2('0x4'))['db'];var utils=require(_0xcfc2('0x5'));var logger=require('../../config/logger')(_0xcfc2('0x6'));var config=require(_0xcfc2('0x7'));var jayson=require(_0xcfc2('0x8'));var client=jayson[_0xcfc2('0x9')][_0xcfc2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x103f9a,_0x1802c6,_0x1c99d3){return new BPromise(function(_0x29cbb4,_0x3d1c48){return client[_0xcfc2('0xb')](_0x103f9a,_0x1c99d3)[_0xcfc2('0xc')](function(_0x2368bc){logger[_0xcfc2('0xd')](_0xcfc2('0xe'),_0x1802c6,_0xcfc2('0xf'));logger[_0xcfc2('0x10')](_0xcfc2('0x11'),_0x1802c6,'request\x20sent',JSON[_0xcfc2('0x12')](_0x2368bc));if(_0x2368bc['error']){if(_0x2368bc['error'][_0xcfc2('0x13')]===0x1f4){logger[_0xcfc2('0x14')](_0xcfc2('0xe'),_0x1802c6,_0x2368bc[_0xcfc2('0x14')][_0xcfc2('0x15')]);return _0x3d1c48(_0x2368bc[_0xcfc2('0x14')]['message']);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x1802c6,_0x2368bc[_0xcfc2('0x14')][_0xcfc2('0x15')]);return _0x29cbb4(_0x2368bc[_0xcfc2('0x14')][_0xcfc2('0x15')]);}else{logger['info'](_0xcfc2('0xe'),_0x1802c6,_0xcfc2('0xf'));_0x29cbb4(_0x2368bc[_0xcfc2('0x16')][_0xcfc2('0x15')]);}})['catch'](function(_0x478e4a){logger[_0xcfc2('0x14')](_0xcfc2('0xe'),_0x1802c6,_0x478e4a);_0x3d1c48(_0x478e4a);});});}