Built motion from commit eddce310.|2.6.12
[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 _0x8bb3=['util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x7cb10c,_0x2fcc3a){var _0x11df59=function(_0x75305f){while(--_0x75305f){_0x7cb10c['push'](_0x7cb10c['shift']());}};_0x11df59(++_0x2fcc3a);}(_0x8bb3,0x149));var _0x38bb=function(_0xff1836,_0x1dc03f){_0xff1836=_0xff1836-0x0;var _0x8e7741=_0x8bb3[_0xff1836];return _0x8e7741;};'use strict';var _=require(_0x38bb('0x0'));var util=require(_0x38bb('0x1'));var moment=require(_0x38bb('0x2'));var BPromise=require(_0x38bb('0x3'));var rs=require(_0x38bb('0x4'));var fs=require('fs');var Redis=require(_0x38bb('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x38bb('0x6'))('rpc');var config=require(_0x38bb('0x7'));var jayson=require(_0x38bb('0x8'));var client=jayson[_0x38bb('0x9')][_0x38bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a1f77,_0x459dd3,_0x281c65){return new BPromise(function(_0x591636,_0xeeb83e){return client[_0x38bb('0xb')](_0x1a1f77,_0x281c65)[_0x38bb('0xc')](function(_0x46f6b1){logger[_0x38bb('0xd')](_0x38bb('0xe'),_0x459dd3,_0x38bb('0xf'));logger[_0x38bb('0x10')](_0x38bb('0x11'),_0x459dd3,_0x38bb('0xf'),JSON[_0x38bb('0x12')](_0x46f6b1));if(_0x46f6b1[_0x38bb('0x13')]){if(_0x46f6b1['error']['code']===0x1f4){logger[_0x38bb('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x459dd3,_0x46f6b1[_0x38bb('0x13')][_0x38bb('0x14')]);return _0xeeb83e(_0x46f6b1[_0x38bb('0x13')][_0x38bb('0x14')]);}logger[_0x38bb('0x13')](_0x38bb('0xe'),_0x459dd3,_0x46f6b1[_0x38bb('0x13')][_0x38bb('0x14')]);return _0x591636(_0x46f6b1['error']['message']);}else{logger[_0x38bb('0xd')](_0x38bb('0xe'),_0x459dd3,_0x38bb('0xf'));_0x591636(_0x46f6b1[_0x38bb('0x15')][_0x38bb('0x14')]);}})['catch'](function(_0x2132c3){logger['error'](_0x38bb('0xe'),_0x459dd3,_0x2132c3);_0xeeb83e(_0x2132c3);});});}