Built motion from commit (unavailable).|2.4.20
[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 _0xa8d9=['jayson/promise','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x45a313,_0x37a410){var _0x53c9e8=function(_0x311a93){while(--_0x311a93){_0x45a313['push'](_0x45a313['shift']());}};_0x53c9e8(++_0x37a410);}(_0xa8d9,0x1f1));var _0x9a8d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa8d9[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9a8d('0x0'));var util=require(_0x9a8d('0x1'));var moment=require(_0x9a8d('0x2'));var BPromise=require(_0x9a8d('0x3'));var rs=require(_0x9a8d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a8d('0x5'))['db'];var utils=require(_0x9a8d('0x6'));var logger=require('../../config/logger')(_0x9a8d('0x7'));var config=require(_0x9a8d('0x8'));var jayson=require(_0x9a8d('0x9'));var client=jayson[_0x9a8d('0xa')][_0x9a8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x538ab5,_0x973340,_0x22df55){return new BPromise(function(_0x45e151,_0x2ef1c7){return client[_0x9a8d('0xc')](_0x538ab5,_0x22df55)['then'](function(_0x2af4cb){logger[_0x9a8d('0xd')](_0x9a8d('0xe'),_0x973340,_0x9a8d('0xf'));logger[_0x9a8d('0x10')](_0x9a8d('0x11'),_0x973340,_0x9a8d('0xf'),JSON[_0x9a8d('0x12')](_0x2af4cb));if(_0x2af4cb[_0x9a8d('0x13')]){if(_0x2af4cb[_0x9a8d('0x13')]['code']===0x1f4){logger['error'](_0x9a8d('0xe'),_0x973340,_0x2af4cb[_0x9a8d('0x13')][_0x9a8d('0x14')]);return _0x2ef1c7(_0x2af4cb[_0x9a8d('0x13')][_0x9a8d('0x14')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x973340,_0x2af4cb[_0x9a8d('0x13')][_0x9a8d('0x14')]);return _0x45e151(_0x2af4cb[_0x9a8d('0x13')][_0x9a8d('0x14')]);}else{logger[_0x9a8d('0xd')](_0x9a8d('0xe'),_0x973340,'request\x20sent');_0x45e151(_0x2af4cb[_0x9a8d('0x15')][_0x9a8d('0x14')]);}})[_0x9a8d('0x16')](function(_0x290fb7){logger[_0x9a8d('0x13')](_0x9a8d('0xe'),_0x973340,_0x290fb7);_0x2ef1c7(_0x290fb7);});});}