Built motion from commit e0fa946e.|2.6.5
[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 _0xcd07=['request','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserFaxQueue,\x20%s,\x20%s','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x18623f,_0x341399){var _0x442b26=function(_0x14733e){while(--_0x14733e){_0x18623f['push'](_0x18623f['shift']());}};_0x442b26(++_0x341399);}(_0xcd07,0x144));var _0x7cd0=function(_0x263351,_0x4ce965){_0x263351=_0x263351-0x0;var _0x52595e=_0xcd07[_0x263351];return _0x52595e;};'use strict';var _=require(_0x7cd0('0x0'));var util=require(_0x7cd0('0x1'));var moment=require(_0x7cd0('0x2'));var BPromise=require('bluebird');var rs=require(_0x7cd0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7cd0('0x4'))['db'];var utils=require(_0x7cd0('0x5'));var logger=require(_0x7cd0('0x6'))(_0x7cd0('0x7'));var config=require(_0x7cd0('0x8'));var jayson=require(_0x7cd0('0x9'));var client=jayson[_0x7cd0('0xa')][_0x7cd0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3615e8,_0x5154a8,_0x1ac52a){return new BPromise(function(_0x123383,_0x4c6fcb){return client[_0x7cd0('0xc')](_0x3615e8,_0x1ac52a)[_0x7cd0('0xd')](function(_0x2184ee){logger[_0x7cd0('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x5154a8,_0x7cd0('0xf'));logger[_0x7cd0('0x10')](_0x7cd0('0x11'),_0x5154a8,_0x7cd0('0xf'),JSON[_0x7cd0('0x12')](_0x2184ee));if(_0x2184ee[_0x7cd0('0x13')]){if(_0x2184ee['error'][_0x7cd0('0x14')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x5154a8,_0x2184ee[_0x7cd0('0x13')][_0x7cd0('0x15')]);return _0x4c6fcb(_0x2184ee[_0x7cd0('0x13')]['message']);}logger[_0x7cd0('0x13')](_0x7cd0('0x16'),_0x5154a8,_0x2184ee[_0x7cd0('0x13')][_0x7cd0('0x15')]);return _0x123383(_0x2184ee[_0x7cd0('0x13')]['message']);}else{logger['info'](_0x7cd0('0x16'),_0x5154a8,_0x7cd0('0xf'));_0x123383(_0x2184ee[_0x7cd0('0x17')][_0x7cd0('0x15')]);}})['catch'](function(_0x40e285){logger[_0x7cd0('0x13')](_0x7cd0('0x16'),_0x5154a8,_0x40e285);_0x4c6fcb(_0x40e285);});});}