Built motion from commit (unavailable).|2.5.29
[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 _0x6afd=['UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x6afd,0xe3));var _0xd6af=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x6afd[_0x43d11d];return _0x38cd08;};'use strict';var _=require('lodash');var util=require(_0xd6af('0x0'));var moment=require(_0xd6af('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6af('0x2'));var db=require(_0xd6af('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd6af('0x4'));var config=require(_0xd6af('0x5'));var jayson=require(_0xd6af('0x6'));var client=jayson[_0xd6af('0x7')][_0xd6af('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a6ed3,_0x54e8b3,_0x224637){return new BPromise(function(_0xa71030,_0x3e71cf){return client[_0xd6af('0x9')](_0x2a6ed3,_0x224637)[_0xd6af('0xa')](function(_0x14960f){logger[_0xd6af('0xb')](_0xd6af('0xc'),_0x54e8b3,_0xd6af('0xd'));logger[_0xd6af('0xe')](_0xd6af('0xf'),_0x54e8b3,_0xd6af('0xd'),JSON[_0xd6af('0x10')](_0x14960f));if(_0x14960f[_0xd6af('0x11')]){if(_0x14960f[_0xd6af('0x11')][_0xd6af('0x12')]===0x1f4){logger['error'](_0xd6af('0xc'),_0x54e8b3,_0x14960f['error'][_0xd6af('0x13')]);return _0x3e71cf(_0x14960f['error']['message']);}logger[_0xd6af('0x11')](_0xd6af('0xc'),_0x54e8b3,_0x14960f['error'][_0xd6af('0x13')]);return _0xa71030(_0x14960f['error']['message']);}else{logger[_0xd6af('0xb')](_0xd6af('0xc'),_0x54e8b3,_0xd6af('0xd'));_0xa71030(_0x14960f[_0xd6af('0x14')]['message']);}})[_0xd6af('0x15')](function(_0xdc5188){logger['error'](_0xd6af('0xc'),_0x54e8b3,_0xdc5188);_0x3e71cf(_0xdc5188);});});}