Built motion from commit (unavailable).|2.5.21
[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 _0x5943=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util'];(function(_0x2c76d7,_0x2464be){var _0x267fcc=function(_0x31c09f){while(--_0x31c09f){_0x2c76d7['push'](_0x2c76d7['shift']());}};_0x267fcc(++_0x2464be);}(_0x5943,0x1f2));var _0x3594=function(_0x5da98d,_0xf2e9d2){_0x5da98d=_0x5da98d-0x0;var _0x53e107=_0x5943[_0x5da98d];return _0x53e107;};'use strict';var _=require(_0x3594('0x0'));var util=require(_0x3594('0x1'));var moment=require(_0x3594('0x2'));var BPromise=require(_0x3594('0x3'));var rs=require(_0x3594('0x4'));var fs=require('fs');var Redis=require(_0x3594('0x5'));var db=require(_0x3594('0x6'))['db'];var utils=require(_0x3594('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3594('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3594('0x9')][_0x3594('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x80b96e,_0x1d8c91,_0x18ef03){return new BPromise(function(_0x8bbf95,_0x4261a9){return client['request'](_0x80b96e,_0x18ef03)['then'](function(_0x52694b){logger[_0x3594('0xb')](_0x3594('0xc'),_0x1d8c91,'request\x20sent');logger[_0x3594('0xd')](_0x3594('0xe'),_0x1d8c91,_0x3594('0xf'),JSON[_0x3594('0x10')](_0x52694b));if(_0x52694b[_0x3594('0x11')]){if(_0x52694b[_0x3594('0x11')]['code']===0x1f4){logger[_0x3594('0x11')](_0x3594('0xc'),_0x1d8c91,_0x52694b[_0x3594('0x11')][_0x3594('0x12')]);return _0x4261a9(_0x52694b[_0x3594('0x11')][_0x3594('0x12')]);}logger[_0x3594('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x1d8c91,_0x52694b[_0x3594('0x11')][_0x3594('0x12')]);return _0x8bbf95(_0x52694b[_0x3594('0x11')][_0x3594('0x12')]);}else{logger[_0x3594('0xb')](_0x3594('0xc'),_0x1d8c91,_0x3594('0xf'));_0x8bbf95(_0x52694b['result'][_0x3594('0x12')]);}})[_0x3594('0x13')](function(_0x1605b3){logger[_0x3594('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x1d8c91,_0x1605b3);_0x4261a9(_0x1605b3);});});}