10994357c7551d56f7805db52a198040d5311647
[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 _0xccbb=['UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x97b61c,_0x30f42c){var _0xa87f74=function(_0x2851a2){while(--_0x2851a2){_0x97b61c['push'](_0x97b61c['shift']());}};_0xa87f74(++_0x30f42c);}(_0xccbb,0x18c));var _0xbccb=function(_0x488b60,_0x2e9978){_0x488b60=_0x488b60-0x0;var _0x5c63be=_0xccbb[_0x488b60];return _0x5c63be;};'use strict';var _=require(_0xbccb('0x0'));var util=require(_0xbccb('0x1'));var moment=require(_0xbccb('0x2'));var BPromise=require(_0xbccb('0x3'));var rs=require(_0xbccb('0x4'));var fs=require('fs');var Redis=require(_0xbccb('0x5'));var db=require(_0xbccb('0x6'))['db'];var utils=require(_0xbccb('0x7'));var logger=require(_0xbccb('0x8'))(_0xbccb('0x9'));var config=require(_0xbccb('0xa'));var jayson=require(_0xbccb('0xb'));var client=jayson[_0xbccb('0xc')][_0xbccb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5c7594,_0x477f1a,_0x28a21f){return new BPromise(function(_0x5168f5,_0x341317){return client['request'](_0x5c7594,_0x28a21f)['then'](function(_0x303529){logger[_0xbccb('0xe')](_0xbccb('0xf'),_0x477f1a,_0xbccb('0x10'));logger[_0xbccb('0x11')](_0xbccb('0x12'),_0x477f1a,_0xbccb('0x10'),JSON[_0xbccb('0x13')](_0x303529));if(_0x303529[_0xbccb('0x14')]){if(_0x303529[_0xbccb('0x14')][_0xbccb('0x15')]===0x1f4){logger[_0xbccb('0x14')](_0xbccb('0xf'),_0x477f1a,_0x303529[_0xbccb('0x14')]['message']);return _0x341317(_0x303529[_0xbccb('0x14')][_0xbccb('0x16')]);}logger[_0xbccb('0x14')](_0xbccb('0xf'),_0x477f1a,_0x303529[_0xbccb('0x14')]['message']);return _0x5168f5(_0x303529[_0xbccb('0x14')]['message']);}else{logger[_0xbccb('0xe')](_0xbccb('0xf'),_0x477f1a,_0xbccb('0x10'));_0x5168f5(_0x303529['result']['message']);}})['catch'](function(_0x298d97){logger['error'](_0xbccb('0xf'),_0x477f1a,_0x298d97);_0x341317(_0x298d97);});});}