Built motion from commit 5ae82ce5.|2.6.7
[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 _0xebb5=['info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x470961,_0x3315a9){var _0x288382=function(_0x315718){while(--_0x315718){_0x470961['push'](_0x470961['shift']());}};_0x288382(++_0x3315a9);}(_0xebb5,0x11d));var _0x5ebb=function(_0x4e9e63,_0x125d14){_0x4e9e63=_0x4e9e63-0x0;var _0x19b0b9=_0xebb5[_0x4e9e63];return _0x19b0b9;};'use strict';var _=require(_0x5ebb('0x0'));var util=require(_0x5ebb('0x1'));var moment=require(_0x5ebb('0x2'));var BPromise=require(_0x5ebb('0x3'));var rs=require(_0x5ebb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ebb('0x5'))['db'];var utils=require(_0x5ebb('0x6'));var logger=require(_0x5ebb('0x7'))('rpc');var config=require(_0x5ebb('0x8'));var jayson=require(_0x5ebb('0x9'));var client=jayson[_0x5ebb('0xa')][_0x5ebb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a7444,_0x203167,_0xdd8af9){return new BPromise(function(_0x4c5c11,_0x4673fe){return client[_0x5ebb('0xc')](_0x4a7444,_0xdd8af9)[_0x5ebb('0xd')](function(_0x2072ed){logger[_0x5ebb('0xe')](_0x5ebb('0xf'),_0x203167,'request\x20sent');logger[_0x5ebb('0x10')](_0x5ebb('0x11'),_0x203167,'request\x20sent',JSON['stringify'](_0x2072ed));if(_0x2072ed[_0x5ebb('0x12')]){if(_0x2072ed[_0x5ebb('0x12')]['code']===0x1f4){logger[_0x5ebb('0x12')](_0x5ebb('0xf'),_0x203167,_0x2072ed[_0x5ebb('0x12')][_0x5ebb('0x13')]);return _0x4673fe(_0x2072ed[_0x5ebb('0x12')][_0x5ebb('0x13')]);}logger[_0x5ebb('0x12')](_0x5ebb('0xf'),_0x203167,_0x2072ed[_0x5ebb('0x12')][_0x5ebb('0x13')]);return _0x4c5c11(_0x2072ed[_0x5ebb('0x12')][_0x5ebb('0x13')]);}else{logger['info'](_0x5ebb('0xf'),_0x203167,_0x5ebb('0x14'));_0x4c5c11(_0x2072ed[_0x5ebb('0x15')][_0x5ebb('0x13')]);}})[_0x5ebb('0x16')](function(_0x65b1fe){logger[_0x5ebb('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x203167,_0x65b1fe);_0x4673fe(_0x65b1fe);});});}