Built motion from commit (unavailable).|2.5.9
[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 _0xc8fa=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash'];(function(_0x385ea1,_0xe4b715){var _0x43b649=function(_0x281607){while(--_0x281607){_0x385ea1['push'](_0x385ea1['shift']());}};_0x43b649(++_0xe4b715);}(_0xc8fa,0x1e3));var _0xac8f=function(_0x2a3f76,_0x5d2266){_0x2a3f76=_0x2a3f76-0x0;var _0x433746=_0xc8fa[_0x2a3f76];return _0x433746;};'use strict';var _=require(_0xac8f('0x0'));var util=require(_0xac8f('0x1'));var moment=require(_0xac8f('0x2'));var BPromise=require('bluebird');var rs=require(_0xac8f('0x3'));var fs=require('fs');var Redis=require(_0xac8f('0x4'));var db=require(_0xac8f('0x5'))['db'];var utils=require(_0xac8f('0x6'));var logger=require(_0xac8f('0x7'))(_0xac8f('0x8'));var config=require(_0xac8f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xac8f('0xa')][_0xac8f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1965e8,_0x429368,_0x49c9c1){return new BPromise(function(_0x34e80c,_0x5502c2){return client[_0xac8f('0xc')](_0x1965e8,_0x49c9c1)[_0xac8f('0xd')](function(_0x11869d){logger['info'](_0xac8f('0xe'),_0x429368,_0xac8f('0xf'));logger[_0xac8f('0x10')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x429368,_0xac8f('0xf'),JSON['stringify'](_0x11869d));if(_0x11869d[_0xac8f('0x11')]){if(_0x11869d[_0xac8f('0x11')][_0xac8f('0x12')]===0x1f4){logger[_0xac8f('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x429368,_0x11869d['error'][_0xac8f('0x13')]);return _0x5502c2(_0x11869d[_0xac8f('0x11')][_0xac8f('0x13')]);}logger[_0xac8f('0x11')](_0xac8f('0xe'),_0x429368,_0x11869d[_0xac8f('0x11')]['message']);return _0x34e80c(_0x11869d[_0xac8f('0x11')]['message']);}else{logger['info'](_0xac8f('0xe'),_0x429368,_0xac8f('0xf'));_0x34e80c(_0x11869d[_0xac8f('0x14')]['message']);}})[_0xac8f('0x15')](function(_0xbc7eda){logger[_0xac8f('0x11')](_0xac8f('0xe'),_0x429368,_0xbc7eda);_0x5502c2(_0xbc7eda);});});}