Built motion from commit 639a1a7f.|2.6.19
[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 _0x53a5=['request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserFaxQueue,\x20%s,\x20%s'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x53a5,0xaa));var _0x553a=function(_0x40dcc2,_0x473444){_0x40dcc2=_0x40dcc2-0x0;var _0x5f96a3=_0x53a5[_0x40dcc2];return _0x5f96a3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x553a('0x0'));var BPromise=require(_0x553a('0x1'));var rs=require(_0x553a('0x2'));var fs=require('fs');var Redis=require(_0x553a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x553a('0x4'));var logger=require(_0x553a('0x5'))(_0x553a('0x6'));var config=require(_0x553a('0x7'));var jayson=require(_0x553a('0x8'));var client=jayson[_0x553a('0x9')][_0x553a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc3f75f,_0x191a20,_0xac6b98){return new BPromise(function(_0x107a4d,_0x52b09c){return client[_0x553a('0xb')](_0xc3f75f,_0xac6b98)['then'](function(_0x5989cd){logger[_0x553a('0xc')](_0x553a('0xd'),_0x191a20,_0x553a('0xe'));logger[_0x553a('0xf')](_0x553a('0x10'),_0x191a20,_0x553a('0xe'),JSON[_0x553a('0x11')](_0x5989cd));if(_0x5989cd[_0x553a('0x12')]){if(_0x5989cd[_0x553a('0x12')][_0x553a('0x13')]===0x1f4){logger[_0x553a('0x12')](_0x553a('0xd'),_0x191a20,_0x5989cd[_0x553a('0x12')][_0x553a('0x14')]);return _0x52b09c(_0x5989cd[_0x553a('0x12')][_0x553a('0x14')]);}logger[_0x553a('0x12')](_0x553a('0xd'),_0x191a20,_0x5989cd[_0x553a('0x12')][_0x553a('0x14')]);return _0x107a4d(_0x5989cd['error']['message']);}else{logger[_0x553a('0xc')](_0x553a('0xd'),_0x191a20,_0x553a('0xe'));_0x107a4d(_0x5989cd[_0x553a('0x15')][_0x553a('0x14')]);}})[_0x553a('0x16')](function(_0x3539d4){logger[_0x553a('0x12')](_0x553a('0xd'),_0x191a20,_0x3539d4);_0x52b09c(_0x3539d4);});});}