Built motion from commit (unavailable).|2.0.74
[motion2.git] / server / api / userSmsQueue / userSmsQueue.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 _0x1cfd=['client','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x194262,_0x54eb5c){var _0x5eaf44=function(_0x454013){while(--_0x454013){_0x194262['push'](_0x194262['shift']());}};_0x5eaf44(++_0x54eb5c);}(_0x1cfd,0x1db));var _0xd1cf=function(_0x347c44,_0x386bb4){_0x347c44=_0x347c44-0x0;var _0x464750=_0x1cfd[_0x347c44];return _0x464750;};'use strict';var _=require(_0xd1cf('0x0'));var util=require(_0xd1cf('0x1'));var moment=require(_0xd1cf('0x2'));var BPromise=require(_0xd1cf('0x3'));var rs=require(_0xd1cf('0x4'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0xd1cf('0x5'));var logger=require(_0xd1cf('0x6'))(_0xd1cf('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd1cf('0x8')][_0xd1cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46ed3b,_0x4a4879,_0x1bf822){return new BPromise(function(_0x123b1d,_0x36e860){return client[_0xd1cf('0xa')](_0x46ed3b,_0x1bf822)['then'](function(_0x1b2d41){logger[_0xd1cf('0xb')](_0xd1cf('0xc'),_0x4a4879,_0xd1cf('0xd'));logger[_0xd1cf('0xe')](_0xd1cf('0xf'),_0x4a4879,_0xd1cf('0xd'),JSON['stringify'](_0x1b2d41));if(_0x1b2d41[_0xd1cf('0x10')]){if(_0x1b2d41[_0xd1cf('0x10')][_0xd1cf('0x11')]===0x1f4){logger[_0xd1cf('0x10')](_0xd1cf('0xc'),_0x4a4879,_0x1b2d41['error'][_0xd1cf('0x12')]);return _0x36e860(_0x1b2d41[_0xd1cf('0x10')][_0xd1cf('0x12')]);}logger[_0xd1cf('0x10')](_0xd1cf('0xc'),_0x4a4879,_0x1b2d41[_0xd1cf('0x10')]['message']);return _0x123b1d(_0x1b2d41[_0xd1cf('0x10')][_0xd1cf('0x12')]);}else{logger['info'](_0xd1cf('0xc'),_0x4a4879,_0xd1cf('0xd'));_0x123b1d(_0x1b2d41[_0xd1cf('0x13')][_0xd1cf('0x12')]);}})[_0xd1cf('0x14')](function(_0x13d45b){logger[_0xd1cf('0x10')](_0xd1cf('0xc'),_0x4a4879,_0x13d45b);_0x36e860(_0x13d45b);});});}