Built motion from commit cafec4f3.|2.6.31
[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 _0xfe9a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x498fcb,_0x25d782){var _0x5833db=function(_0x37a9b6){while(--_0x37a9b6){_0x498fcb['push'](_0x498fcb['shift']());}};_0x5833db(++_0x25d782);}(_0xfe9a,0x13a));var _0xafe9=function(_0x591971,_0x3ec945){_0x591971=_0x591971-0x0;var _0x3634de=_0xfe9a[_0x591971];return _0x3634de;};'use strict';var _=require(_0xafe9('0x0'));var util=require('util');var moment=require(_0xafe9('0x1'));var BPromise=require(_0xafe9('0x2'));var rs=require(_0xafe9('0x3'));var fs=require('fs');var Redis=require(_0xafe9('0x4'));var db=require(_0xafe9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xafe9('0x6'))('rpc');var config=require(_0xafe9('0x7'));var jayson=require(_0xafe9('0x8'));var client=jayson[_0xafe9('0x9')][_0xafe9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b01bf,_0x370755,_0x127d03){return new BPromise(function(_0xab9cce,_0x576385){return client[_0xafe9('0xb')](_0x4b01bf,_0x127d03)['then'](function(_0x418aa0){logger[_0xafe9('0xc')](_0xafe9('0xd'),_0x370755,_0xafe9('0xe'));logger[_0xafe9('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x370755,'request\x20sent',JSON[_0xafe9('0x10')](_0x418aa0));if(_0x418aa0['error']){if(_0x418aa0[_0xafe9('0x11')]['code']===0x1f4){logger[_0xafe9('0x11')](_0xafe9('0xd'),_0x370755,_0x418aa0[_0xafe9('0x11')][_0xafe9('0x12')]);return _0x576385(_0x418aa0[_0xafe9('0x11')][_0xafe9('0x12')]);}logger[_0xafe9('0x11')](_0xafe9('0xd'),_0x370755,_0x418aa0['error']['message']);return _0xab9cce(_0x418aa0[_0xafe9('0x11')][_0xafe9('0x12')]);}else{logger[_0xafe9('0xc')](_0xafe9('0xd'),_0x370755,_0xafe9('0xe'));_0xab9cce(_0x418aa0[_0xafe9('0x13')][_0xafe9('0x12')]);}})[_0xafe9('0x14')](function(_0x598b55){logger[_0xafe9('0x11')](_0xafe9('0xd'),_0x370755,_0x598b55);_0x576385(_0x598b55);});});}