Built motion from commit d13fb11b.|2.6.34
[motion2.git] / server / api / userWhatsappQueue / userWhatsappQueue.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 _0x9b6e=['request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x9b6e,0x9e));var _0xe9b6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9b6e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe9b6('0x0'));var util=require(_0xe9b6('0x1'));var moment=require(_0xe9b6('0x2'));var BPromise=require('bluebird');var rs=require(_0xe9b6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9b6('0x4'))['db'];var utils=require(_0xe9b6('0x5'));var logger=require(_0xe9b6('0x6'))(_0xe9b6('0x7'));var config=require(_0xe9b6('0x8'));var jayson=require(_0xe9b6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa3a6fb,_0x2f6633,_0x4b9def){return new BPromise(function(_0x2a7f96,_0x5a5137){return client[_0xe9b6('0xa')](_0xa3a6fb,_0x4b9def)[_0xe9b6('0xb')](function(_0x188d12){logger[_0xe9b6('0xc')](_0xe9b6('0xd'),_0x2f6633,_0xe9b6('0xe'));logger['debug'](_0xe9b6('0xf'),_0x2f6633,'request\x20sent',JSON[_0xe9b6('0x10')](_0x188d12));if(_0x188d12[_0xe9b6('0x11')]){if(_0x188d12[_0xe9b6('0x11')][_0xe9b6('0x12')]===0x1f4){logger['error'](_0xe9b6('0xd'),_0x2f6633,_0x188d12['error'][_0xe9b6('0x13')]);return _0x5a5137(_0x188d12['error'][_0xe9b6('0x13')]);}logger[_0xe9b6('0x11')](_0xe9b6('0xd'),_0x2f6633,_0x188d12[_0xe9b6('0x11')][_0xe9b6('0x13')]);return _0x2a7f96(_0x188d12[_0xe9b6('0x11')][_0xe9b6('0x13')]);}else{logger[_0xe9b6('0xc')](_0xe9b6('0xd'),_0x2f6633,_0xe9b6('0xe'));_0x2a7f96(_0x188d12['result'][_0xe9b6('0x13')]);}})[_0xe9b6('0x14')](function(_0x28bfa4){logger[_0xe9b6('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2f6633,_0x28bfa4);_0x5a5137(_0x28bfa4);});});}