Built motion from commit (unavailable).|2.5.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 _0x333e=['then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x1c31c6,_0x112488){var _0x497d0b=function(_0x1177f7){while(--_0x1177f7){_0x1c31c6['push'](_0x1c31c6['shift']());}};_0x497d0b(++_0x112488);}(_0x333e,0x113));var _0xe333=function(_0x465c6c,_0x86b98){_0x465c6c=_0x465c6c-0x0;var _0x143188=_0x333e[_0x465c6c];return _0x143188;};'use strict';var _=require(_0xe333('0x0'));var util=require(_0xe333('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe333('0x2'));var fs=require('fs');var Redis=require(_0xe333('0x3'));var db=require(_0xe333('0x4'))['db'];var utils=require(_0xe333('0x5'));var logger=require(_0xe333('0x6'))('rpc');var config=require(_0xe333('0x7'));var jayson=require(_0xe333('0x8'));var client=jayson[_0xe333('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f5144,_0x18f41a,_0x433cd3){return new BPromise(function(_0x48c63e,_0xf65320){return client[_0xe333('0xa')](_0x2f5144,_0x433cd3)[_0xe333('0xb')](function(_0x4c6fd7){logger['info'](_0xe333('0xc'),_0x18f41a,_0xe333('0xd'));logger[_0xe333('0xe')](_0xe333('0xf'),_0x18f41a,_0xe333('0xd'),JSON[_0xe333('0x10')](_0x4c6fd7));if(_0x4c6fd7[_0xe333('0x11')]){if(_0x4c6fd7[_0xe333('0x11')][_0xe333('0x12')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x18f41a,_0x4c6fd7[_0xe333('0x11')][_0xe333('0x13')]);return _0xf65320(_0x4c6fd7[_0xe333('0x11')][_0xe333('0x13')]);}logger[_0xe333('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x18f41a,_0x4c6fd7['error'][_0xe333('0x13')]);return _0x48c63e(_0x4c6fd7[_0xe333('0x11')][_0xe333('0x13')]);}else{logger['info'](_0xe333('0xc'),_0x18f41a,_0xe333('0xd'));_0x48c63e(_0x4c6fd7[_0xe333('0x14')][_0xe333('0x13')]);}})[_0xe333('0x15')](function(_0x5a9658){logger[_0xe333('0x11')](_0xe333('0xc'),_0x18f41a,_0x5a9658);_0xf65320(_0x5a9658);});});}