32bbbb4a466c91c9af096c73d88a6d32ca285f71
[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 _0x251f=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5dba5a,_0x5f170c){var _0x256d9b=function(_0x33dae8){while(--_0x33dae8){_0x5dba5a['push'](_0x5dba5a['shift']());}};_0x256d9b(++_0x5f170c);}(_0x251f,0x1b3));var _0xf251=function(_0x4e7abc,_0x2aeca1){_0x4e7abc=_0x4e7abc-0x0;var _0x428796=_0x251f[_0x4e7abc];return _0x428796;};'use strict';var _=require(_0xf251('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf251('0x1'));var rs=require(_0xf251('0x2'));var fs=require('fs');var Redis=require(_0xf251('0x3'));var db=require(_0xf251('0x4'))['db'];var utils=require(_0xf251('0x5'));var logger=require(_0xf251('0x6'))(_0xf251('0x7'));var config=require(_0xf251('0x8'));var jayson=require(_0xf251('0x9'));var client=jayson[_0xf251('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14c219,_0x3cb12f,_0x23273b){return new BPromise(function(_0x9e6bf9,_0x11c21e){return client[_0xf251('0xb')](_0x14c219,_0x23273b)[_0xf251('0xc')](function(_0x5c642b){logger[_0xf251('0xd')](_0xf251('0xe'),_0x3cb12f,_0xf251('0xf'));logger[_0xf251('0x10')](_0xf251('0x11'),_0x3cb12f,_0xf251('0xf'),JSON[_0xf251('0x12')](_0x5c642b));if(_0x5c642b[_0xf251('0x13')]){if(_0x5c642b[_0xf251('0x13')][_0xf251('0x14')]===0x1f4){logger[_0xf251('0x13')](_0xf251('0xe'),_0x3cb12f,_0x5c642b[_0xf251('0x13')]['message']);return _0x11c21e(_0x5c642b[_0xf251('0x13')][_0xf251('0x15')]);}logger[_0xf251('0x13')](_0xf251('0xe'),_0x3cb12f,_0x5c642b[_0xf251('0x13')][_0xf251('0x15')]);return _0x9e6bf9(_0x5c642b[_0xf251('0x13')][_0xf251('0x15')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x3cb12f,_0xf251('0xf'));_0x9e6bf9(_0x5c642b[_0xf251('0x16')][_0xf251('0x15')]);}})[_0xf251('0x17')](function(_0x374a66){logger[_0xf251('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x3cb12f,_0x374a66);_0x11c21e(_0x374a66);});});}