Built motion from commit ddca4d0d.|2.5.47
[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 _0xbc51=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x4bcc83,_0x25f6bb){var _0xb7db90=function(_0x104ac6){while(--_0x104ac6){_0x4bcc83['push'](_0x4bcc83['shift']());}};_0xb7db90(++_0x25f6bb);}(_0xbc51,0xb3));var _0x1bc5=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0xbc51[_0x1d6a82];return _0x5834ac;};'use strict';var _=require(_0x1bc5('0x0'));var util=require(_0x1bc5('0x1'));var moment=require('moment');var BPromise=require(_0x1bc5('0x2'));var rs=require(_0x1bc5('0x3'));var fs=require('fs');var Redis=require(_0x1bc5('0x4'));var db=require(_0x1bc5('0x5'))['db'];var utils=require(_0x1bc5('0x6'));var logger=require('../../config/logger')(_0x1bc5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1bc5('0x8')][_0x1bc5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xee9ed9,_0x5e3862,_0x425a79){return new BPromise(function(_0x39db2c,_0x2f68ca){return client[_0x1bc5('0xa')](_0xee9ed9,_0x425a79)[_0x1bc5('0xb')](function(_0x566a5b){logger['info'](_0x1bc5('0xc'),_0x5e3862,_0x1bc5('0xd'));logger['debug'](_0x1bc5('0xe'),_0x5e3862,'request\x20sent',JSON[_0x1bc5('0xf')](_0x566a5b));if(_0x566a5b[_0x1bc5('0x10')]){if(_0x566a5b[_0x1bc5('0x10')][_0x1bc5('0x11')]===0x1f4){logger[_0x1bc5('0x10')](_0x1bc5('0xc'),_0x5e3862,_0x566a5b[_0x1bc5('0x10')][_0x1bc5('0x12')]);return _0x2f68ca(_0x566a5b['error'][_0x1bc5('0x12')]);}logger[_0x1bc5('0x10')](_0x1bc5('0xc'),_0x5e3862,_0x566a5b[_0x1bc5('0x10')][_0x1bc5('0x12')]);return _0x39db2c(_0x566a5b[_0x1bc5('0x10')][_0x1bc5('0x12')]);}else{logger['info'](_0x1bc5('0xc'),_0x5e3862,_0x1bc5('0xd'));_0x39db2c(_0x566a5b['result'][_0x1bc5('0x12')]);}})[_0x1bc5('0x13')](function(_0x1d6ec4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x5e3862,_0x1d6ec4);_0x2f68ca(_0x1d6ec4);});});}