Built motion from commit 3c2ce842.|2.6.31
[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 _0xab4a=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x12273a,_0x20b902){var _0x57f970=function(_0x4420a5){while(--_0x4420a5){_0x12273a['push'](_0x12273a['shift']());}};_0x57f970(++_0x20b902);}(_0xab4a,0x1a1));var _0xaab4=function(_0x556634,_0x520958){_0x556634=_0x556634-0x0;var _0x4429fd=_0xab4a[_0x556634];return _0x4429fd;};'use strict';var _=require(_0xaab4('0x0'));var util=require(_0xaab4('0x1'));var moment=require('moment');var BPromise=require(_0xaab4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaab4('0x3'));var db=require(_0xaab4('0x4'))['db'];var utils=require(_0xaab4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xaab4('0x6'));var jayson=require(_0xaab4('0x7'));var client=jayson['client'][_0xaab4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14abde,_0x4e7fd2,_0x1bcb09){return new BPromise(function(_0x5b6206,_0x3076e6){return client[_0xaab4('0x9')](_0x14abde,_0x1bcb09)[_0xaab4('0xa')](function(_0xdc40b7){logger[_0xaab4('0xb')](_0xaab4('0xc'),_0x4e7fd2,_0xaab4('0xd'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x4e7fd2,_0xaab4('0xd'),JSON[_0xaab4('0xe')](_0xdc40b7));if(_0xdc40b7[_0xaab4('0xf')]){if(_0xdc40b7[_0xaab4('0xf')][_0xaab4('0x10')]===0x1f4){logger[_0xaab4('0xf')](_0xaab4('0xc'),_0x4e7fd2,_0xdc40b7[_0xaab4('0xf')][_0xaab4('0x11')]);return _0x3076e6(_0xdc40b7[_0xaab4('0xf')][_0xaab4('0x11')]);}logger[_0xaab4('0xf')](_0xaab4('0xc'),_0x4e7fd2,_0xdc40b7[_0xaab4('0xf')][_0xaab4('0x11')]);return _0x5b6206(_0xdc40b7['error'][_0xaab4('0x11')]);}else{logger[_0xaab4('0xb')](_0xaab4('0xc'),_0x4e7fd2,_0xaab4('0xd'));_0x5b6206(_0xdc40b7[_0xaab4('0x12')]['message']);}})[_0xaab4('0x13')](function(_0x1ca019){logger[_0xaab4('0xf')](_0xaab4('0xc'),_0x4e7fd2,_0x1ca019);_0x3076e6(_0x1ca019);});});}