Built motion from commit da617fac.|2.6.6
[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 _0x45cf=['info','UserFaxQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5c4948,_0x4d635f){var _0x36cb2b=function(_0x551a43){while(--_0x551a43){_0x5c4948['push'](_0x5c4948['shift']());}};_0x36cb2b(++_0x4d635f);}(_0x45cf,0x1d7));var _0xf45c=function(_0x5ed8e2,_0x4d1edf){_0x5ed8e2=_0x5ed8e2-0x0;var _0x5056fd=_0x45cf[_0x5ed8e2];return _0x5056fd;};'use strict';var _=require(_0xf45c('0x0'));var util=require(_0xf45c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf45c('0x2'));var fs=require('fs');var Redis=require(_0xf45c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf45c('0x4'));var logger=require(_0xf45c('0x5'))(_0xf45c('0x6'));var config=require(_0xf45c('0x7'));var jayson=require(_0xf45c('0x8'));var client=jayson[_0xf45c('0x9')][_0xf45c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30c867,_0x1abef4,_0x30383c){return new BPromise(function(_0x41f16c,_0xa96d26){return client[_0xf45c('0xb')](_0x30c867,_0x30383c)['then'](function(_0x5927ab){logger[_0xf45c('0xc')](_0xf45c('0xd'),_0x1abef4,'request\x20sent');logger[_0xf45c('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x1abef4,_0xf45c('0xf'),JSON['stringify'](_0x5927ab));if(_0x5927ab[_0xf45c('0x10')]){if(_0x5927ab[_0xf45c('0x10')][_0xf45c('0x11')]===0x1f4){logger[_0xf45c('0x10')](_0xf45c('0xd'),_0x1abef4,_0x5927ab[_0xf45c('0x10')]['message']);return _0xa96d26(_0x5927ab[_0xf45c('0x10')][_0xf45c('0x12')]);}logger[_0xf45c('0x10')](_0xf45c('0xd'),_0x1abef4,_0x5927ab[_0xf45c('0x10')][_0xf45c('0x12')]);return _0x41f16c(_0x5927ab[_0xf45c('0x10')][_0xf45c('0x12')]);}else{logger['info'](_0xf45c('0xd'),_0x1abef4,_0xf45c('0xf'));_0x41f16c(_0x5927ab[_0xf45c('0x13')][_0xf45c('0x12')]);}})[_0xf45c('0x14')](function(_0x2ee021){logger[_0xf45c('0x10')](_0xf45c('0xd'),_0x1abef4,_0x2ee021);_0xa96d26(_0x2ee021);});});}