1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0xb458=['SmsApplication,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','SmsApplication,\x20%s,\x20%s','debug'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xb458,0x103));var _0x8b45=function(_0x2161e,_0x30f769){_0x2161e=_0x2161e-0x0;var _0x377e75=_0xb458[_0x2161e];return _0x377e75;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var moment=require(_0x8b45('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b45('0x3'));var db=require(_0x8b45('0x4'))['db'];var utils=require(_0x8b45('0x5'));var logger=require(_0x8b45('0x6'))('rpc');var config=require(_0x8b45('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8b45('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12bd05,_0x2daa9a,_0x3a8ccb){return new BPromise(function(_0x32342f,_0x4d1718){return client[_0x8b45('0x9')](_0x12bd05,_0x3a8ccb)[_0x8b45('0xa')](function(_0x33f30e){logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,'request\x20sent');logger[_0x8b45('0xd')](_0x8b45('0xe'),_0x2daa9a,'request\x20sent',JSON['stringify'](_0x33f30e));if(_0x33f30e['error']){if(_0x33f30e['error'][_0x8b45('0xf')]===0x1f4){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e['error'][_0x8b45('0x11')]);return _0x4d1718(_0x33f30e[_0x8b45('0x10')][_0x8b45('0x11')]);}logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e[_0x8b45('0x10')]['message']);return _0x32342f(_0x33f30e['error'][_0x8b45('0x11')]);}else{logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,_0x8b45('0x12'));_0x32342f(_0x33f30e[_0x8b45('0x13')][_0x8b45('0x11')]);}})[_0x8b45('0x14')](function(_0x147d6b){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x147d6b);_0x4d1718(_0x147d6b);});});}