Built motion from commit 67e5df37.|2.0.66
[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 _0x867f=['then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request'];(function(_0x190725,_0x4c879f){var _0x4fe2de=function(_0x1d7d72){while(--_0x1d7d72){_0x190725['push'](_0x190725['shift']());}};_0x4fe2de(++_0x4c879f);}(_0x867f,0xdc));var _0xf867=function(_0x4eb832,_0x324bff){_0x4eb832=_0x4eb832-0x0;var _0x2e5927=_0x867f[_0x4eb832];return _0x2e5927;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var moment=require(_0xf867('0x2'));var BPromise=require('bluebird');var rs=require(_0xf867('0x3'));var fs=require('fs');var db=require(_0xf867('0x4'))['db'];var utils=require(_0xf867('0x5'));var logger=require('../../config/logger')(_0xf867('0x6'));var config=require('../../config/environment');var jayson=require(_0xf867('0x7'));var client=jayson[_0xf867('0x8')][_0xf867('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x287b67,_0x333ea2,_0x390ca5){return new BPromise(function(_0xd82c8c,_0x3cf8db){return client[_0xf867('0xa')](_0x287b67,_0x390ca5)[_0xf867('0xb')](function(_0x48f3bb){logger['info'](_0xf867('0xc'),_0x333ea2,_0xf867('0xd'));logger[_0xf867('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x333ea2,'request\x20sent',JSON[_0xf867('0xf')](_0x48f3bb));if(_0x48f3bb[_0xf867('0x10')]){if(_0x48f3bb['error'][_0xf867('0x11')]===0x1f4){logger[_0xf867('0x10')](_0xf867('0xc'),_0x333ea2,_0x48f3bb[_0xf867('0x10')]['message']);return _0x3cf8db(_0x48f3bb[_0xf867('0x10')][_0xf867('0x12')]);}logger[_0xf867('0x10')](_0xf867('0xc'),_0x333ea2,_0x48f3bb[_0xf867('0x10')][_0xf867('0x12')]);return _0xd82c8c(_0x48f3bb[_0xf867('0x10')][_0xf867('0x12')]);}else{logger[_0xf867('0x13')](_0xf867('0xc'),_0x333ea2,'request\x20sent');_0xd82c8c(_0x48f3bb['result']['message']);}})[_0xf867('0x14')](function(_0x45541a){logger[_0xf867('0x10')](_0xf867('0xc'),_0x333ea2,_0x45541a);_0x3cf8db(_0x45541a);});});}