Built motion from commit 3c2ce842.|2.6.31
[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 _0x1d60=['UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x1d60,0x160));var _0x01d6=function(_0x106216,_0x3ea0fd){_0x106216=_0x106216-0x0;var _0xb37a3e=_0x1d60[_0x106216];return _0xb37a3e;};'use strict';var _=require(_0x01d6('0x0'));var util=require(_0x01d6('0x1'));var moment=require(_0x01d6('0x2'));var BPromise=require(_0x01d6('0x3'));var rs=require(_0x01d6('0x4'));var fs=require('fs');var Redis=require(_0x01d6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x01d6('0x6'));var logger=require(_0x01d6('0x7'))(_0x01d6('0x8'));var config=require(_0x01d6('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x01d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fa70f,_0x3b19c9,_0x2e0a0b){return new BPromise(function(_0x4b2267,_0x576e7d){return client['request'](_0x2fa70f,_0x2e0a0b)[_0x01d6('0xb')](function(_0x5c7782){logger[_0x01d6('0xc')](_0x01d6('0xd'),_0x3b19c9,_0x01d6('0xe'));logger[_0x01d6('0xf')](_0x01d6('0x10'),_0x3b19c9,_0x01d6('0xe'),JSON[_0x01d6('0x11')](_0x5c7782));if(_0x5c7782[_0x01d6('0x12')]){if(_0x5c7782['error'][_0x01d6('0x13')]===0x1f4){logger[_0x01d6('0x12')](_0x01d6('0xd'),_0x3b19c9,_0x5c7782[_0x01d6('0x12')][_0x01d6('0x14')]);return _0x576e7d(_0x5c7782[_0x01d6('0x12')][_0x01d6('0x14')]);}logger[_0x01d6('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3b19c9,_0x5c7782[_0x01d6('0x12')][_0x01d6('0x14')]);return _0x4b2267(_0x5c7782[_0x01d6('0x12')][_0x01d6('0x14')]);}else{logger[_0x01d6('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3b19c9,_0x01d6('0xe'));_0x4b2267(_0x5c7782[_0x01d6('0x15')][_0x01d6('0x14')]);}})[_0x01d6('0x16')](function(_0x5ad805){logger[_0x01d6('0x12')](_0x01d6('0xd'),_0x3b19c9,_0x5ad805);_0x576e7d(_0x5ad805);});});}