1dd8ddc149e0681de76775cbabaaf4150d67de81
[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 _0x3bc6=['rpc','../../config/environment','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2c97e1,_0x7e6a2c){var _0x3e83c3=function(_0x423dbb){while(--_0x423dbb){_0x2c97e1['push'](_0x2c97e1['shift']());}};_0x3e83c3(++_0x7e6a2c);}(_0x3bc6,0xe8));var _0x63bc=function(_0x360b69,_0x136e85){_0x360b69=_0x360b69-0x0;var _0x322f4f=_0x3bc6[_0x360b69];return _0x322f4f;};'use strict';var _=require(_0x63bc('0x0'));var util=require(_0x63bc('0x1'));var moment=require('moment');var BPromise=require(_0x63bc('0x2'));var rs=require(_0x63bc('0x3'));var fs=require('fs');var Redis=require(_0x63bc('0x4'));var db=require(_0x63bc('0x5'))['db'];var utils=require(_0x63bc('0x6'));var logger=require(_0x63bc('0x7'))(_0x63bc('0x8'));var config=require(_0x63bc('0x9'));var jayson=require(_0x63bc('0xa'));var client=jayson[_0x63bc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3267a2,_0x319372,_0x435878){return new BPromise(function(_0x13c90f,_0xe8084a){return client[_0x63bc('0xc')](_0x3267a2,_0x435878)[_0x63bc('0xd')](function(_0x225c35){logger[_0x63bc('0xe')](_0x63bc('0xf'),_0x319372,'request\x20sent');logger[_0x63bc('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x319372,_0x63bc('0x11'),JSON[_0x63bc('0x12')](_0x225c35));if(_0x225c35['error']){if(_0x225c35[_0x63bc('0x13')][_0x63bc('0x14')]===0x1f4){logger[_0x63bc('0x13')](_0x63bc('0xf'),_0x319372,_0x225c35[_0x63bc('0x13')]['message']);return _0xe8084a(_0x225c35['error']['message']);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x319372,_0x225c35[_0x63bc('0x13')][_0x63bc('0x15')]);return _0x13c90f(_0x225c35[_0x63bc('0x13')][_0x63bc('0x15')]);}else{logger[_0x63bc('0xe')](_0x63bc('0xf'),_0x319372,_0x63bc('0x11'));_0x13c90f(_0x225c35[_0x63bc('0x16')][_0x63bc('0x15')]);}})[_0x63bc('0x17')](function(_0x1d197d){logger['error'](_0x63bc('0xf'),_0x319372,_0x1d197d);_0xe8084a(_0x1d197d);});});}