Built motion from commit d5e4af8c.|2.6.23
[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 _0xf8e1=['debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x46b1c9,_0x169f87){var _0x17569c=function(_0x4b7c45){while(--_0x4b7c45){_0x46b1c9['push'](_0x46b1c9['shift']());}};_0x17569c(++_0x169f87);}(_0xf8e1,0x15c));var _0x1f8e=function(_0x1dd524,_0x22ce03){_0x1dd524=_0x1dd524-0x0;var _0x2ad2a7=_0xf8e1[_0x1dd524];return _0x2ad2a7;};'use strict';var _=require(_0x1f8e('0x0'));var util=require(_0x1f8e('0x1'));var moment=require('moment');var BPromise=require(_0x1f8e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f8e('0x3'));var db=require(_0x1f8e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1f8e('0x5'));var config=require(_0x1f8e('0x6'));var jayson=require(_0x1f8e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bfbb3,_0x3c1185,_0x51bbcd){return new BPromise(function(_0x514a06,_0x89d62f){return client[_0x1f8e('0x8')](_0x2bfbb3,_0x51bbcd)[_0x1f8e('0x9')](function(_0x3580e8){logger[_0x1f8e('0xa')](_0x1f8e('0xb'),_0x3c1185,_0x1f8e('0xc'));logger[_0x1f8e('0xd')](_0x1f8e('0xe'),_0x3c1185,_0x1f8e('0xc'),JSON[_0x1f8e('0xf')](_0x3580e8));if(_0x3580e8[_0x1f8e('0x10')]){if(_0x3580e8['error']['code']===0x1f4){logger[_0x1f8e('0x10')](_0x1f8e('0xb'),_0x3c1185,_0x3580e8[_0x1f8e('0x10')][_0x1f8e('0x11')]);return _0x89d62f(_0x3580e8[_0x1f8e('0x10')][_0x1f8e('0x11')]);}logger[_0x1f8e('0x10')](_0x1f8e('0xb'),_0x3c1185,_0x3580e8[_0x1f8e('0x10')][_0x1f8e('0x11')]);return _0x514a06(_0x3580e8[_0x1f8e('0x10')][_0x1f8e('0x11')]);}else{logger[_0x1f8e('0xa')](_0x1f8e('0xb'),_0x3c1185,_0x1f8e('0xc'));_0x514a06(_0x3580e8['result'][_0x1f8e('0x11')]);}})[_0x1f8e('0x12')](function(_0x20a372){logger[_0x1f8e('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x3c1185,_0x20a372);_0x89d62f(_0x20a372);});});}