Built motion from commit ff78e754.|2.6.29
[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 _0xd51b=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3cbb14,_0x3c95a7){var _0x2bfb35=function(_0x384c4d){while(--_0x384c4d){_0x3cbb14['push'](_0x3cbb14['shift']());}};_0x2bfb35(++_0x3c95a7);}(_0xd51b,0x121));var _0xbd51=function(_0x21ddf2,_0x170dc9){_0x21ddf2=_0x21ddf2-0x0;var _0x105611=_0xd51b[_0x21ddf2];return _0x105611;};'use strict';var _=require(_0xbd51('0x0'));var util=require(_0xbd51('0x1'));var moment=require(_0xbd51('0x2'));var BPromise=require(_0xbd51('0x3'));var rs=require(_0xbd51('0x4'));var fs=require('fs');var Redis=require(_0xbd51('0x5'));var db=require(_0xbd51('0x6'))['db'];var utils=require(_0xbd51('0x7'));var logger=require(_0xbd51('0x8'))(_0xbd51('0x9'));var config=require(_0xbd51('0xa'));var jayson=require(_0xbd51('0xb'));var client=jayson['client'][_0xbd51('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x560880,_0x212d83,_0x41451a){return new BPromise(function(_0x1f3c55,_0xdc23b1){return client['request'](_0x560880,_0x41451a)[_0xbd51('0xd')](function(_0xa19a84){logger[_0xbd51('0xe')](_0xbd51('0xf'),_0x212d83,_0xbd51('0x10'));logger[_0xbd51('0x11')](_0xbd51('0x12'),_0x212d83,_0xbd51('0x10'),JSON['stringify'](_0xa19a84));if(_0xa19a84[_0xbd51('0x13')]){if(_0xa19a84[_0xbd51('0x13')][_0xbd51('0x14')]===0x1f4){logger[_0xbd51('0x13')](_0xbd51('0xf'),_0x212d83,_0xa19a84[_0xbd51('0x13')][_0xbd51('0x15')]);return _0xdc23b1(_0xa19a84[_0xbd51('0x13')][_0xbd51('0x15')]);}logger[_0xbd51('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x212d83,_0xa19a84['error']['message']);return _0x1f3c55(_0xa19a84[_0xbd51('0x13')][_0xbd51('0x15')]);}else{logger[_0xbd51('0xe')](_0xbd51('0xf'),_0x212d83,'request\x20sent');_0x1f3c55(_0xa19a84[_0xbd51('0x16')][_0xbd51('0x15')]);}})[_0xbd51('0x17')](function(_0x57cfd9){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x212d83,_0x57cfd9);_0xdc23b1(_0x57cfd9);});});}