Built motion from commit c738b9ac.|2.6.25
[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 _0xd916=['request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','UserFaxQueue,\x20%s,\x20%s'];(function(_0xf87ceb,_0x1bb4fe){var _0x34878d=function(_0x443a58){while(--_0x443a58){_0xf87ceb['push'](_0xf87ceb['shift']());}};_0x34878d(++_0x1bb4fe);}(_0xd916,0x110));var _0x6d91=function(_0x1570e0,_0x271bdf){_0x1570e0=_0x1570e0-0x0;var _0x424cba=_0xd916[_0x1570e0];return _0x424cba;};'use strict';var _=require(_0x6d91('0x0'));var util=require(_0x6d91('0x1'));var moment=require(_0x6d91('0x2'));var BPromise=require(_0x6d91('0x3'));var rs=require(_0x6d91('0x4'));var fs=require('fs');var Redis=require(_0x6d91('0x5'));var db=require(_0x6d91('0x6'))['db'];var utils=require(_0x6d91('0x7'));var logger=require(_0x6d91('0x8'))(_0x6d91('0x9'));var config=require(_0x6d91('0xa'));var jayson=require(_0x6d91('0xb'));var client=jayson[_0x6d91('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf6f407,_0x526edb,_0x94c4e5){return new BPromise(function(_0x6eee9a,_0x495903){return client[_0x6d91('0xd')](_0xf6f407,_0x94c4e5)[_0x6d91('0xe')](function(_0x1ae9ab){logger['info'](_0x6d91('0xf'),_0x526edb,_0x6d91('0x10'));logger[_0x6d91('0x11')](_0x6d91('0x12'),_0x526edb,_0x6d91('0x10'),JSON[_0x6d91('0x13')](_0x1ae9ab));if(_0x1ae9ab[_0x6d91('0x14')]){if(_0x1ae9ab[_0x6d91('0x14')]['code']===0x1f4){logger[_0x6d91('0x14')](_0x6d91('0xf'),_0x526edb,_0x1ae9ab['error'][_0x6d91('0x15')]);return _0x495903(_0x1ae9ab[_0x6d91('0x14')]['message']);}logger[_0x6d91('0x14')](_0x6d91('0xf'),_0x526edb,_0x1ae9ab[_0x6d91('0x14')][_0x6d91('0x15')]);return _0x6eee9a(_0x1ae9ab[_0x6d91('0x14')][_0x6d91('0x15')]);}else{logger[_0x6d91('0x16')]('UserFaxQueue,\x20%s,\x20%s',_0x526edb,'request\x20sent');_0x6eee9a(_0x1ae9ab['result']['message']);}})[_0x6d91('0x17')](function(_0x40c608){logger[_0x6d91('0x14')](_0x6d91('0xf'),_0x526edb,_0x40c608);_0x495903(_0x40c608);});});}