Built motion from commit (unavailable).|2.5.4
[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 _0xb7f0=['debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x4706a6,_0x5a1c63){var _0x1bb705=function(_0x484ebb){while(--_0x484ebb){_0x4706a6['push'](_0x4706a6['shift']());}};_0x1bb705(++_0x5a1c63);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x10784b,_0x59bd34){_0x10784b=_0x10784b-0x0;var _0x3123b4=_0xb7f0[_0x10784b];return _0x3123b4;};'use strict';var _=require(_0x0b7f('0x0'));var util=require(_0x0b7f('0x1'));var moment=require(_0x0b7f('0x2'));var BPromise=require(_0x0b7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b7f('0x4'))['db'];var utils=require(_0x0b7f('0x5'));var logger=require(_0x0b7f('0x6'))(_0x0b7f('0x7'));var config=require(_0x0b7f('0x8'));var jayson=require(_0x0b7f('0x9'));var client=jayson[_0x0b7f('0xa')][_0x0b7f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10dc6c,_0x36ff5c,_0x53f9a5){return new BPromise(function(_0x98065a,_0x65287){return client['request'](_0x10dc6c,_0x53f9a5)[_0x0b7f('0xc')](function(_0x3b44bd){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x36ff5c,'request\x20sent');logger[_0x0b7f('0xd')](_0x0b7f('0xe'),_0x36ff5c,_0x0b7f('0xf'),JSON[_0x0b7f('0x10')](_0x3b44bd));if(_0x3b44bd[_0x0b7f('0x11')]){if(_0x3b44bd[_0x0b7f('0x11')][_0x0b7f('0x12')]===0x1f4){logger[_0x0b7f('0x11')](_0x0b7f('0x13'),_0x36ff5c,_0x3b44bd[_0x0b7f('0x11')][_0x0b7f('0x14')]);return _0x65287(_0x3b44bd['error'][_0x0b7f('0x14')]);}logger[_0x0b7f('0x11')](_0x0b7f('0x13'),_0x36ff5c,_0x3b44bd[_0x0b7f('0x11')][_0x0b7f('0x14')]);return _0x98065a(_0x3b44bd[_0x0b7f('0x11')][_0x0b7f('0x14')]);}else{logger[_0x0b7f('0x15')]('UserFaxQueue,\x20%s,\x20%s',_0x36ff5c,_0x0b7f('0xf'));_0x98065a(_0x3b44bd[_0x0b7f('0x16')][_0x0b7f('0x14')]);}})[_0x0b7f('0x17')](function(_0x58c901){logger[_0x0b7f('0x11')](_0x0b7f('0x13'),_0x36ff5c,_0x58c901);_0x65287(_0x58c901);});});}