Built motion from commit ddca4d0d.|2.5.47
[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 _0xab20=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4a62ea,_0x3446b4){var _0xa6ad3=function(_0x318029){while(--_0x318029){_0x4a62ea['push'](_0x4a62ea['shift']());}};_0xa6ad3(++_0x3446b4);}(_0xab20,0x149));var _0x0ab2=function(_0x2a41d7,_0x3fc5c8){_0x2a41d7=_0x2a41d7-0x0;var _0x19c7de=_0xab20[_0x2a41d7];return _0x19c7de;};'use strict';var _=require(_0x0ab2('0x0'));var util=require(_0x0ab2('0x1'));var moment=require(_0x0ab2('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ab2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ab2('0x4'))['db'];var utils=require(_0x0ab2('0x5'));var logger=require(_0x0ab2('0x6'))(_0x0ab2('0x7'));var config=require(_0x0ab2('0x8'));var jayson=require(_0x0ab2('0x9'));var client=jayson[_0x0ab2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x359d88,_0x3c3498,_0x451dc5){return new BPromise(function(_0x19bb74,_0x463522){return client['request'](_0x359d88,_0x451dc5)[_0x0ab2('0xb')](function(_0x3e7f11){logger['info'](_0x0ab2('0xc'),_0x3c3498,_0x0ab2('0xd'));logger[_0x0ab2('0xe')](_0x0ab2('0xf'),_0x3c3498,'request\x20sent',JSON[_0x0ab2('0x10')](_0x3e7f11));if(_0x3e7f11[_0x0ab2('0x11')]){if(_0x3e7f11[_0x0ab2('0x11')][_0x0ab2('0x12')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x3c3498,_0x3e7f11['error']['message']);return _0x463522(_0x3e7f11[_0x0ab2('0x11')][_0x0ab2('0x13')]);}logger['error'](_0x0ab2('0xc'),_0x3c3498,_0x3e7f11[_0x0ab2('0x11')][_0x0ab2('0x13')]);return _0x19bb74(_0x3e7f11[_0x0ab2('0x11')][_0x0ab2('0x13')]);}else{logger['info'](_0x0ab2('0xc'),_0x3c3498,_0x0ab2('0xd'));_0x19bb74(_0x3e7f11[_0x0ab2('0x14')]['message']);}})[_0x0ab2('0x15')](function(_0x14a472){logger[_0x0ab2('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x3c3498,_0x14a472);_0x463522(_0x14a472);});});}