Built motion from commit 1fa89557.|2.6.10
[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 _0xe817=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','moment'];(function(_0x4aabc1,_0x41f219){var _0x40d45e=function(_0x526edc){while(--_0x526edc){_0x4aabc1['push'](_0x4aabc1['shift']());}};_0x40d45e(++_0x41f219);}(_0xe817,0x1b2));var _0x7e81=function(_0x37ae84,_0x341102){_0x37ae84=_0x37ae84-0x0;var _0x5d90e0=_0xe817[_0x37ae84];return _0x5d90e0;};'use strict';var _=require(_0x7e81('0x0'));var util=require(_0x7e81('0x1'));var moment=require(_0x7e81('0x2'));var BPromise=require(_0x7e81('0x3'));var rs=require(_0x7e81('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e81('0x5'))['db'];var utils=require(_0x7e81('0x6'));var logger=require(_0x7e81('0x7'))(_0x7e81('0x8'));var config=require(_0x7e81('0x9'));var jayson=require(_0x7e81('0xa'));var client=jayson[_0x7e81('0xb')][_0x7e81('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12127e,_0x2f6d10,_0xd6a467){return new BPromise(function(_0x13cc5c,_0x5dcb56){return client[_0x7e81('0xd')](_0x12127e,_0xd6a467)[_0x7e81('0xe')](function(_0x157d53){logger[_0x7e81('0xf')](_0x7e81('0x10'),_0x2f6d10,_0x7e81('0x11'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x2f6d10,_0x7e81('0x11'),JSON['stringify'](_0x157d53));if(_0x157d53['error']){if(_0x157d53['error'][_0x7e81('0x12')]===0x1f4){logger['error'](_0x7e81('0x10'),_0x2f6d10,_0x157d53[_0x7e81('0x13')][_0x7e81('0x14')]);return _0x5dcb56(_0x157d53[_0x7e81('0x13')][_0x7e81('0x14')]);}logger[_0x7e81('0x13')](_0x7e81('0x10'),_0x2f6d10,_0x157d53[_0x7e81('0x13')][_0x7e81('0x14')]);return _0x13cc5c(_0x157d53[_0x7e81('0x13')][_0x7e81('0x14')]);}else{logger[_0x7e81('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x2f6d10,'request\x20sent');_0x13cc5c(_0x157d53[_0x7e81('0x15')]['message']);}})[_0x7e81('0x16')](function(_0x14bab3){logger[_0x7e81('0x13')](_0x7e81('0x10'),_0x2f6d10,_0x14bab3);_0x5dcb56(_0x14bab3);});});}