Built motion from commit 52c8a02d.|2.6.29
[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 _0x6b1c=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x425183,_0x552cce){var _0x1d6c9f=function(_0x337efd){while(--_0x337efd){_0x425183['push'](_0x425183['shift']());}};_0x1d6c9f(++_0x552cce);}(_0x6b1c,0x90));var _0xc6b1=function(_0x573c3b,_0x4637dd){_0x573c3b=_0x573c3b-0x0;var _0x44b950=_0x6b1c[_0x573c3b];return _0x44b950;};'use strict';var _=require(_0xc6b1('0x0'));var util=require(_0xc6b1('0x1'));var moment=require(_0xc6b1('0x2'));var BPromise=require(_0xc6b1('0x3'));var rs=require(_0xc6b1('0x4'));var fs=require('fs');var Redis=require(_0xc6b1('0x5'));var db=require(_0xc6b1('0x6'))['db'];var utils=require(_0xc6b1('0x7'));var logger=require(_0xc6b1('0x8'))(_0xc6b1('0x9'));var config=require(_0xc6b1('0xa'));var jayson=require(_0xc6b1('0xb'));var client=jayson[_0xc6b1('0xc')][_0xc6b1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x358165,_0x43e4da,_0x592c8b){return new BPromise(function(_0x18c12e,_0x1cc631){return client[_0xc6b1('0xe')](_0x358165,_0x592c8b)[_0xc6b1('0xf')](function(_0x50f670){logger[_0xc6b1('0x10')](_0xc6b1('0x11'),_0x43e4da,_0xc6b1('0x12'));logger[_0xc6b1('0x13')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x43e4da,_0xc6b1('0x12'),JSON['stringify'](_0x50f670));if(_0x50f670['error']){if(_0x50f670[_0xc6b1('0x14')][_0xc6b1('0x15')]===0x1f4){logger[_0xc6b1('0x14')](_0xc6b1('0x11'),_0x43e4da,_0x50f670[_0xc6b1('0x14')][_0xc6b1('0x16')]);return _0x1cc631(_0x50f670[_0xc6b1('0x14')][_0xc6b1('0x16')]);}logger[_0xc6b1('0x14')](_0xc6b1('0x11'),_0x43e4da,_0x50f670[_0xc6b1('0x14')][_0xc6b1('0x16')]);return _0x18c12e(_0x50f670['error']['message']);}else{logger[_0xc6b1('0x10')](_0xc6b1('0x11'),_0x43e4da,'request\x20sent');_0x18c12e(_0x50f670[_0xc6b1('0x17')][_0xc6b1('0x16')]);}})['catch'](function(_0x316bab){logger[_0xc6b1('0x14')](_0xc6b1('0x11'),_0x43e4da,_0x316bab);_0x1cc631(_0x316bab);});});}