Built motion from commit f7863d46.|2.5.41
[motion2.git] / server / api / smsMessage / smsMessage.model.js
index fb47651..469d2c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc22f=['%s:%s','toString','http_code','data','queued_count','head','clickSend','remote','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','base64','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','infobip','apiKey','login','timestamp','sort','createHash','md5','digest','signature=','GET','keys','id_sms','csc','Missing\x20parameters:\x20apiKey','uuid','UTF-8','apiMessageId','clickatell','https://messaging.bandwidth.com/api/v2/users/','/messages','bandwidth','intelepeer','Bearer\x20','message','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','SmsInteraction','SmsInteractionId','then','update','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','password','smsMethod','sender','login?username=','username','sms','POST','user_key','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','xCALLY\x20Motion','format'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc22f,0x183));var _0xfc22=function(_0x340151,_0x3f1b6d){_0x340151=_0x340151-0x0;var _0x28c336=_0xc22f[_0x340151];return _0x28c336;};'use strict';var _=require(_0xfc22('0x0'));var util=require(_0xfc22('0x1'));var logger=require(_0xfc22('0x2'))(_0xfc22('0x3'));var moment=require('moment');var BPromise=require(_0xfc22('0x4'));var rp=require(_0xfc22('0x5'));var fs=require('fs');var path=require(_0xfc22('0x6'));var rimraf=require(_0xfc22('0x7'));var config=require(_0xfc22('0x8'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0xbb472b,_0x1b6f09){return _0xbb472b[_0xfc22('0x9')](_0xfc22('0xa'),attributes,{'tableName':_0xfc22('0xb'),'paranoid':![],'indexes':[{'name':_0xfc22('0xc'),'fields':[_0xfc22('0xc')]},{'name':_0xfc22('0xd'),'fields':['body'],'type':_0xfc22('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x24a3ae,_0x44c985,_0x575d42){var _0x16ee36=_0xbb472b[_0xfc22('0xf')];var _0x2532ce=_0x24a3ae[_0xfc22('0x10')]({'plain':!![]});if(_0x2532ce[_0xfc22('0x11')][_0xfc22('0x12')]()==='in'||_0x2532ce[_0xfc22('0x11')]['toLowerCase']()===_0xfc22('0x13')&&!_0x2532ce[_0xfc22('0x14')]&&!_['isNil'](_0x2532ce[_0xfc22('0x15')])&&!_['isNil'](_0x2532ce['SmsInteractionId'])){_0x16ee36[_0xfc22('0x16')]['findOne']({'where':{'id':_0x2532ce[_0xfc22('0x17')]}})[_0xfc22('0x18')](function(_0x3f2fd9){if(_0x3f2fd9){_0x3f2fd9[_0xfc22('0x19')]({'lastMsgAt':_0x2532ce['createdAt'],'lastMsgDirection':_0x2532ce[_0xfc22('0x11')][_0xfc22('0x12')]()});}})['catch'](function(_0x42c2fe){console['error'](_0x42c2fe);});}if(_0x2532ce[_0xfc22('0x11')]===_0xfc22('0x13')&&!_0x2532ce[_0xfc22('0x14')]){var _0x271d1b;_0x16ee36[_0xfc22('0x1a')]['find']({'where':{'id':_0x2532ce[_0xfc22('0x1b')]},'raw':!![]})['then'](function(_0x2bec13){_0x271d1b=_0x2bec13;if(_0x271d1b&&_0x271d1b[_0xfc22('0x1c')]){switch(_0x271d1b['type']){case _0xfc22('0x1d'):var _0x4f5a8c=require(_0xfc22('0x1d'));if(_0x271d1b[_0xfc22('0x1e')]&&_0x271d1b[_0xfc22('0x1f')]&&_0x271d1b[_0xfc22('0x20')]){var _0xd22ba6=new _0x4f5a8c(_0x271d1b[_0xfc22('0x1e')],_0x271d1b['authToken']);_0xd22ba6[_0xfc22('0x21')][_0xfc22('0x22')]({'body':_0x2532ce[_0xfc22('0x23')],'to':_0x2532ce[_0xfc22('0x20')],'from':_0x271d1b[_0xfc22('0x20')],'statusCallback':_0x271d1b['remote']+_0xfc22('0x24')+_0x2532ce['id']+_0xfc22('0x25')+_0x271d1b[_0xfc22('0x26')]})[_0xfc22('0x18')](function(_0x2c4fb5){if(_0x2c4fb5[_0xfc22('0x27')]){return _0x24a3ae[_0xfc22('0x19')]({'messageId':_0x2c4fb5[_0xfc22('0x27')]});}})[_0xfc22('0x28')](function(_0x2b8eb6){logger['error'](_0xfc22('0x29'),_0xfc22('0x2a'),_0xfc22('0x1d'),util[_0xfc22('0x2b')](_0x2b8eb6,{'showHidden':![],'depth':null}));});}else{logger[_0xfc22('0x2c')](_0xfc22('0x29'),_0xfc22('0x2a'),_0xfc22('0x1d'),_0xfc22('0x2d'));}break;case'skebby':var _0x20f20b='https://api.skebby.it/API/v1.0/REST/';if(_0x271d1b['username']&&_0x271d1b[_0xfc22('0x2e')]){var _0x5c2695={'recipient':[_0x2532ce[_0xfc22('0x20')]],'message':_0x2532ce[_0xfc22('0x23')],'message_type':_0x271d1b[_0xfc22('0x2f')]};if(_0x271d1b['smsMethod']&&_0x271d1b[_0xfc22('0x2f')]!=='SI'){_0x5c2695[_0xfc22('0x30')]=_0x271d1b['phone'];}var _0x1bab2d={'url':_0x20f20b+_0xfc22('0x31')+_0x271d1b[_0xfc22('0x32')]+'&password='+_0x271d1b[_0xfc22('0x2e')],'method':'GET'};rp(_0x1bab2d)[_0xfc22('0x18')](function(_0x2f67dc){var _0x3c3804=_0x2f67dc['split'](';');var _0x1fd9b1={'user_key':_0x3c3804[0x0],'session_key':_0x3c3804[0x1]};_0x1bab2d={'url':_0x20f20b+_0xfc22('0x33'),'method':_0xfc22('0x34'),'headers':{'user_key':_0x1fd9b1[_0xfc22('0x35')],'Session_key':_0x1fd9b1['session_key']},'json':!![],'body':_0x5c2695};return rp(_0x1bab2d);})['then'](function(_0x2a8cf3){if(_0x2a8cf3['total_sent']>=0x1){var _0x1261f4={'messageId':_0x2a8cf3[_0xfc22('0x36')]};if(_0x271d1b[_0xfc22('0x2f')]!=='GP'||!_0x271d1b[_0xfc22('0x37')]){_0x1261f4[_0xfc22('0x38')]=!![];}return _0x24a3ae[_0xfc22('0x19')](_0x1261f4);}else{return logger['error'](_0xfc22('0x29'),_0xfc22('0x2a'),'skebby',util[_0xfc22('0x2b')](_0x2a8cf3,{'showHidden':![],'depth':null}));}})[_0xfc22('0x28')](function(_0x5b4dd8){return logger[_0xfc22('0x2c')](_0xfc22('0x29'),_0xfc22('0x2a'),_0xfc22('0x39'),util[_0xfc22('0x2b')](_0x5b4dd8,{'showHidden':![],'depth':null}));});}else{logger[_0xfc22('0x2c')](_0xfc22('0x29'),_0xfc22('0x2a'),_0xfc22('0x39'),_0xfc22('0x3a'));}break;case _0xfc22('0x3b'):if(_0x271d1b[_0xfc22('0x1f')]){var _0x236cfc={'recipient':_0x2532ce[_0xfc22('0x20')],'message':_0x2532ce[_0xfc22('0x23')],'sender':_0x271d1b[_0xfc22('0x3c')]||_0x271d1b[_0xfc22('0x20')],'authorization':_0x271d1b[_0xfc22('0x1f')]};var _0x44c985={'method':_0xfc22('0x34'),'uri':_0xfc22('0x3d'),'body':_0x236cfc,'json':!![]};rp(_0x44c985)['then'](function(_0x3a2e1a){var _0x5dc4e8={'messageId':_0x3a2e1a[_0xfc22('0x3e')]};if(!_0x271d1b['deliveryReport']){_0x5dc4e8[_0xfc22('0x38')]=!![];}return _0x24a3ae[_0xfc22('0x19')](_0x5dc4e8);})['catch'](function(_0x230e7a){logger[_0xfc22('0x2c')](_0xfc22('0x29'),'afterCreate',_0xfc22('0x3b'),util[_0xfc22('0x2b')](_0x230e7a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfc22('0x29'),_0xfc22('0x2a'),'connectel','Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x271d1b[_0xfc22('0x32')]&&_0x271d1b[_0xfc22('0x2e')]){var _0x236cfc={'messages':[{'source':_0xfc22('0x3f'),'to':_0x2532ce[_0xfc22('0x20')],'body':_0x2532ce[_0xfc22('0x23')],'from':_0x271d1b[_0xfc22('0x3c')]||_0x271d1b[_0xfc22('0x20')]}]};var _0x240927=util[_0xfc22('0x40')](_0xfc22('0x41'),_0x271d1b[_0xfc22('0x32')],_0x271d1b[_0xfc22('0x2e')]);var _0x44c985={'method':_0xfc22('0x34'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x236cfc,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x240927)[_0xfc22('0x42')]('base64'))},'json':!![]};rp(_0x44c985)[_0xfc22('0x18')](function(_0x4911a){if(_0x4911a[_0xfc22('0x43')]>=0xc8&&_0x4911a[_0xfc22('0x43')]<=0xce){if(_0x4911a[_0xfc22('0x44')]&&_0x4911a[_0xfc22('0x44')][_0xfc22('0x45')]>0x0){var _0x1bdb95=_[_0xfc22('0x46')](_0x4911a['data'][_0xfc22('0x21')]);var _0x1e244d={'messageId':_0x1bdb95['message_id']};if(!_0x271d1b[_0xfc22('0x37')]){_0x1e244d['read']=!![];}return _0x24a3ae['update'](_0x1e244d);}else{logger[_0xfc22('0x2c')](_0xfc22('0x29'),_0xfc22('0x2a'),_0xfc22('0x47'),util['inspect'](_0x4911a,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfc22('0x2a'),'clickSend',util['inspect'](_0x4911a,{'showHidden':![],'depth':null}));}})[_0xfc22('0x28')](function(_0xcbbc16){logger[_0xfc22('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfc22('0x2a'),_0xfc22('0x47'),util['inspect'](_0xcbbc16,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfc22('0x29'),_0xfc22('0x2a'),_0xfc22('0x47'),_0xfc22('0x3a'));}break;case'plivo':if(_0x271d1b['authId']&&_0x271d1b[_0xfc22('0x1f')]){var _0x236cfc={'dst':_0x2532ce[_0xfc22('0x20')],'text':_0x2532ce[_0xfc22('0x23')],'src':_0x271d1b['senderString']||_0x271d1b['phone'],'url':_0x271d1b[_0xfc22('0x48')]+_0xfc22('0x24')+_0x2532ce['id']+_0xfc22('0x25')+_0x271d1b['token']};var _0x240927=util[_0xfc22('0x40')](_0xfc22('0x41'),_0x271d1b[_0xfc22('0x49')],_0x271d1b[_0xfc22('0x1f')]);var _0x44c985={'method':_0xfc22('0x34'),'uri':util[_0xfc22('0x40')](_0xfc22('0x4a'),_0x271d1b[_0xfc22('0x49')]),'body':_0x236cfc,'headers':{'Authorization':util[_0xfc22('0x40')](_0xfc22('0x4b'),new Buffer(_0x240927)[_0xfc22('0x42')](_0xfc22('0x4c')))},'json':!![]};rp(_0x44c985)[_0xfc22('0x18')](function(_0x20fd63){var _0x10a219={'messageId':_0x20fd63[_0xfc22('0x4d')][0x0]};return _0x24a3ae[_0xfc22('0x19')](_0x10a219);})[_0xfc22('0x28')](function(_0xdc9895){logger[_0xfc22('0x2c')](_0xfc22('0x29'),_0xfc22('0x2a'),'plivo',util[_0xfc22('0x2b')](_0xdc9895,{'showHidden':![],'depth':null}));});}else{logger[_0xfc22('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xfc22('0x4e'),_0xfc22('0x4f'));}break;case'infobip':if(_0x271d1b[_0xfc22('0x32')]&&_0x271d1b[_0xfc22('0x2e')]){if(_0x271d1b['baseUrl']){var _0x49d033={'method':_0xfc22('0x34'),'uri':_0x271d1b[_0xfc22('0x50')]+_0xfc22('0x51'),'body':{'username':_0x271d1b[_0xfc22('0x32')],'password':_0x271d1b[_0xfc22('0x2e')]},'json':!![]};return rp(_0x49d033)[_0xfc22('0x18')](function(_0x1a7c36){var _0x510fdd={'method':_0xfc22('0x34'),'uri':_0x271d1b[_0xfc22('0x50')]+_0xfc22('0x52'),'body':{'messages':[{'from':_0x271d1b['phone'],'destinations':[{'to':_0x2532ce[_0xfc22('0x20')]}],'text':_0x2532ce[_0xfc22('0x23')],'notifyUrl':_0x271d1b[_0xfc22('0x48')]+_0xfc22('0x24')+_0x2532ce['id']+_0xfc22('0x25')+_0x271d1b[_0xfc22('0x26')],'notifyContentType':_0xfc22('0x53'),'callbackData':_0x271d1b['phone']+';'+_0x2532ce[_0xfc22('0x23')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x1a7c36[_0xfc22('0x26')]},'json':!![]};return rp(_0x510fdd)['then'](function(_0x10ee6e){if(_0x10ee6e[_0xfc22('0x21')]){var _0x14a242={'messageId':_0x10ee6e[_0xfc22('0x21')][0x0]['messageId']};if(!_0x271d1b['deliveryReport']){_0x14a242[_0xfc22('0x38')]=!![];}return _0x24a3ae[_0xfc22('0x19')](_0x14a242);}else{return logger['error'](_0xfc22('0x29'),_0xfc22('0x2a'),_0xfc22('0x54'),util[_0xfc22('0x2b')](_0x10ee6e,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x379c8f){return logger[_0xfc22('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfc22('0x2a'),_0xfc22('0x54'),util[_0xfc22('0x2b')](_0x379c8f,{'showHidden':![],'depth':null}));});}else{logger[_0xfc22('0x2c')](_0xfc22('0x29'),'afterCreate',_0xfc22('0x54'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xfc22('0x2c')](_0xfc22('0x29'),_0xfc22('0x2a'),_0xfc22('0x54'),_0xfc22('0x3a'));}break;case'csc':var _0xbd4d7a=require('crypto');if(_0x271d1b[_0xfc22('0x55')]){var _0x4b2b74={};_0x4b2b74[_0xfc22('0x56')]=_0x271d1b['username'];_0x4b2b74['phone']=_0x2532ce[_0xfc22('0x20')];_0x4b2b74[_0xfc22('0x30')]=_0x271d1b[_0xfc22('0x20')];_0x4b2b74['text']=_0x2532ce[_0xfc22('0x23')];_0x4b2b74[_0xfc22('0x57')]=+new Date();var _0x2dcaf6='';var _0x1cca11='';var _0x466f05=Object['keys'](_0x4b2b74);_0x466f05[_0xfc22('0x58')]();for(var _0x423031=0x0;_0x423031<_0x466f05['length'];_0x423031++){if(_0x2dcaf6!=''){_0x2dcaf6+='&';}_0x2dcaf6+=_0x466f05[_0x423031]+'='+encodeURIComponent(_0x4b2b74[_0x466f05[_0x423031]]);_0x1cca11+=_0x4b2b74[_0x466f05[_0x423031]];}_0x1cca11+=_0x271d1b[_0xfc22('0x55')];_0x1cca11=_0xbd4d7a[_0xfc22('0x59')](_0xfc22('0x5a'))['update'](_0x1cca11)[_0xfc22('0x5b')]('hex');if(_0x2dcaf6!==''){_0x2dcaf6+='&';}_0x2dcaf6+=_0xfc22('0x5c')+_0x1cca11;var _0x1bab2d={'method':_0xfc22('0x5d'),'uri':_0x271d1b['baseUrl']+'/external/get/send.php?'+_0x2dcaf6,'json':!![]};return rp(_0x1bab2d)['then'](function(_0x18a641){var _0x9799c4=Object[_0xfc22('0x5e')](_0x18a641);if(_0x18a641[_0x9799c4[0x0]][_0xfc22('0x2c')]&&parseInt(_0x18a641[_0x9799c4[0x0]][_0xfc22('0x2c')])===0x0){var _0x4421e2={'messageId':_0x18a641[_0x9799c4[0x0]][_0xfc22('0x5f')]};if(!_0x271d1b[_0xfc22('0x37')]){_0x4421e2[_0xfc22('0x38')]=!![];}return _0x24a3ae['update'](_0x4421e2);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xfc22('0x60'),util[_0xfc22('0x2b')](_0x18a641[_0xfc22('0x2c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x158ff8){return logger[_0xfc22('0x2c')](_0xfc22('0x29'),_0xfc22('0x2a'),_0xfc22('0x60'),util[_0xfc22('0x2b')](_0x158ff8,{'showHidden':![],'depth':null}));});}else{logger[_0xfc22('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfc22('0x2a'),_0xfc22('0x60'),_0xfc22('0x61'));}break;case'clickatell':if(_0x271d1b[_0xfc22('0x55')]){var _0x10e18b={'method':_0xfc22('0x34'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x271d1b['apiKey']},'body':{'content':_0x2532ce[_0xfc22('0x23')],'to':[_0x2532ce['phone']],'from':_0x271d1b[_0xfc22('0x20')],'binary':![],'clientMessageId':_0xfc22('0x62'),'charset':_0xfc22('0x63')},'json':!![]};rp(_0x10e18b)['then'](function(_0x360a33){if(!_0x360a33['error']){var _0xe8746d={'messageId':_0x360a33[_0xfc22('0x21')][0x0][_0xfc22('0x64')]};if(!_0x271d1b[_0xfc22('0x37')]){_0xe8746d[_0xfc22('0x38')]=!![];}return _0x24a3ae[_0xfc22('0x19')](_0xe8746d);}else{return logger[_0xfc22('0x2c')](_0xfc22('0x29'),'afterCreate',_0xfc22('0x65'),util[_0xfc22('0x2b')](_0x360a33[_0xfc22('0x2c')],{'showHidden':![],'depth':null}));}})[_0xfc22('0x28')](function(_0x1489e5){return logger[_0xfc22('0x2c')](_0xfc22('0x29'),_0xfc22('0x2a'),_0xfc22('0x65'),util[_0xfc22('0x2b')](_0x1489e5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfc22('0x29'),_0xfc22('0x2a'),_0xfc22('0x65'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x271d1b[_0xfc22('0x32')]&&_0x271d1b['password']){var _0x240927=util[_0xfc22('0x40')](_0xfc22('0x41'),_0x271d1b['username'],_0x271d1b[_0xfc22('0x2e')]);var _0x44c985={'method':_0xfc22('0x34'),'uri':_0xfc22('0x66')+_0x271d1b['accountId']+_0xfc22('0x67'),'body':{'to':[_0x2532ce[_0xfc22('0x20')]],'text':_0x2532ce[_0xfc22('0x23')],'from':_0x271d1b[_0xfc22('0x20')],'applicationId':_0x271d1b['applicationId']},'headers':{'Authorization':util[_0xfc22('0x40')](_0xfc22('0x4b'),new Buffer(_0x240927)[_0xfc22('0x42')]('base64'))},'json':!![]};rp(_0x44c985)[_0xfc22('0x18')](function(_0x4200dc){if(_0x4200dc['id']){var _0x1a41a6={'messageId':_0x4200dc['id']};return _0x24a3ae[_0xfc22('0x19')](_0x1a41a6);}else{logger[_0xfc22('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfc22('0x2a'),'bandwidth',util[_0xfc22('0x2b')](_0x4200dc,{'showHidden':![],'depth':null}));}})[_0xfc22('0x28')](function(_0x2db74c){logger[_0xfc22('0x2c')](_0xfc22('0x29'),'afterCreate',_0xfc22('0x68'),util[_0xfc22('0x2b')](_0x2db74c,{'showHidden':![],'depth':null}));});}else{logger[_0xfc22('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfc22('0x2a'),_0xfc22('0x68'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xfc22('0x69'):if(_0x271d1b[_0xfc22('0x55')]){var _0x42bf04={};var _0x1bab2d={'method':_0xfc22('0x34'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xfc22('0x6a')+_0x271d1b[_0xfc22('0x55')],'Content-Type':_0xfc22('0x53')},'body':{'from':_0x271d1b['phone'],'to':_0x2532ce[_0xfc22('0x20')],'text':_0x2532ce[_0xfc22('0x23')]},'json':!![]};return rp(_0x1bab2d)[_0xfc22('0x18')](function(_0x267611){if(_0x267611['code']==0xca){_0x42bf04[_0xfc22('0x6b')]=_0x267611;var _0x1b3b18={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xfc22('0x6a')+_0x271d1b[_0xfc22('0x55')],'Content-Type':'application/json'},'body':{'refid':_0x42bf04[_0xfc22('0x6b')][_0xfc22('0x6c')]},'json':!![]};return rp(_0x1b3b18)[_0xfc22('0x18')](function(_0xb074b){_0x42bf04['status']=_0xb074b;var _0x3ac2e9={'messageId':_0x42bf04['message'][_0xfc22('0x6c')],'read':!![]};return _0x24a3ae[_0xfc22('0x19')](_0x3ac2e9);});}else{return logger[_0xfc22('0x2c')](_0xfc22('0x29'),'afterCreate',_0xfc22('0x69'),util[_0xfc22('0x2b')](_0x267611,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4b514d){return logger[_0xfc22('0x2c')](_0xfc22('0x29'),_0xfc22('0x2a'),_0xfc22('0x69'),util['inspect'](_0x4b514d,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xfc22('0x69'),_0xfc22('0x6d'));}break;}}})[_0xfc22('0x6e')](function(){_0x575d42();});}else{_0x575d42();}}},'charset':_0xfc22('0x6f'),'collate':_0xfc22('0x70')});};
\ No newline at end of file
+var _0xbb34=['update','createdAt','error','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','GET','split','sms','POST','user_key','session_key','total_sent','deliveryReport','read','catch','connectel','requestid','Missing\x20parameters:\x20authToken','clicksend','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','token','authId','https://api.plivo.com/v1/Account/%s/Message/','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','infobip','Missing\x20parameters:\x20base_url','apiKey','login','sender','text','keys','length','createHash','md5','hex','signature=','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','messageId','fti_sms_messages','body','get','direction','toLowerCase','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then'];(function(_0x5354fe,_0x4dc0eb){var _0x444088=function(_0x5a9af4){while(--_0x5a9af4){_0x5354fe['push'](_0x5354fe['shift']());}};_0x444088(++_0x4dc0eb);}(_0xbb34,0x14a));var _0x4bb3=function(_0x37ae2e,_0x35be3a){_0x37ae2e=_0x37ae2e-0x0;var _0x19c50f=_0xbb34[_0x37ae2e];return _0x19c50f;};'use strict';var _=require(_0x4bb3('0x0'));var util=require(_0x4bb3('0x1'));var logger=require(_0x4bb3('0x2'))(_0x4bb3('0x3'));var moment=require(_0x4bb3('0x4'));var BPromise=require(_0x4bb3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4bb3('0x6'));var config=require(_0x4bb3('0x7'));var attributes=require(_0x4bb3('0x8'));module['exports']=function(_0xfde869,_0x236ae4){return _0xfde869[_0x4bb3('0x9')](_0x4bb3('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x4bb3('0xb'),'fields':[_0x4bb3('0xb')]},{'name':_0x4bb3('0xc'),'fields':[_0x4bb3('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47caf4,_0x30a193,_0x2dd92b){var _0x908f13=_0xfde869['models'];var _0x16e22d=_0x47caf4[_0x4bb3('0xe')]({'plain':!![]});if(_0x16e22d[_0x4bb3('0xf')][_0x4bb3('0x10')]()==='in'||_0x16e22d[_0x4bb3('0xf')]['toLowerCase']()==='out'&&!_0x16e22d[_0x4bb3('0x11')]&&!_[_0x4bb3('0x12')](_0x16e22d[_0x4bb3('0x13')])&&!_[_0x4bb3('0x12')](_0x16e22d[_0x4bb3('0x14')])){_0x908f13[_0x4bb3('0x15')][_0x4bb3('0x16')]({'where':{'id':_0x16e22d[_0x4bb3('0x14')]}})[_0x4bb3('0x17')](function(_0x3e7849){if(_0x3e7849){_0x3e7849[_0x4bb3('0x18')]({'lastMsgAt':_0x16e22d[_0x4bb3('0x19')],'lastMsgDirection':_0x16e22d[_0x4bb3('0xf')][_0x4bb3('0x10')]()});}})['catch'](function(_0x16715d){console[_0x4bb3('0x1a')](_0x16715d);});}if(_0x16e22d['direction']==='out'&&!_0x16e22d[_0x4bb3('0x11')]){var _0x4cbb8f;_0x908f13['SmsAccount']['find']({'where':{'id':_0x16e22d[_0x4bb3('0x1b')]},'raw':!![]})[_0x4bb3('0x17')](function(_0x4d1434){_0x4cbb8f=_0x4d1434;if(_0x4cbb8f&&_0x4cbb8f[_0x4bb3('0x1c')]){switch(_0x4cbb8f['type']){case _0x4bb3('0x1d'):var _0x11a33d=require(_0x4bb3('0x1d'));if(_0x4cbb8f[_0x4bb3('0x1e')]&&_0x4cbb8f[_0x4bb3('0x1f')]&&_0x4cbb8f[_0x4bb3('0x20')]){var _0x28b079=new _0x11a33d(_0x4cbb8f[_0x4bb3('0x1e')],_0x4cbb8f['authToken']);_0x28b079[_0x4bb3('0x21')]['create']({'body':_0x16e22d['body'],'to':_0x16e22d[_0x4bb3('0x20')],'from':_0x4cbb8f[_0x4bb3('0x20')],'statusCallback':_0x4cbb8f[_0x4bb3('0x22')]+_0x4bb3('0x23')+_0x16e22d['id']+_0x4bb3('0x24')+_0x4cbb8f['token']})[_0x4bb3('0x17')](function(_0x5d8682){if(_0x5d8682[_0x4bb3('0x25')]){return _0x47caf4[_0x4bb3('0x18')]({'messageId':_0x5d8682['sid']});}})['catch'](function(_0xdb7706){logger['error'](_0x4bb3('0x26'),_0x4bb3('0x27'),'twilio',util[_0x4bb3('0x28')](_0xdb7706,{'showHidden':![],'depth':null}));});}else{logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),'twilio',_0x4bb3('0x29'));}break;case _0x4bb3('0x2a'):var _0x105332=_0x4bb3('0x2b');if(_0x4cbb8f[_0x4bb3('0x2c')]&&_0x4cbb8f[_0x4bb3('0x2d')]){var _0x3bdacf={'recipient':[_0x16e22d[_0x4bb3('0x20')]],'message':_0x16e22d[_0x4bb3('0xd')],'message_type':_0x4cbb8f[_0x4bb3('0x2e')]};if(_0x4cbb8f['smsMethod']&&_0x4cbb8f[_0x4bb3('0x2e')]!=='SI'){_0x3bdacf['sender']=_0x4cbb8f[_0x4bb3('0x20')];}var _0x117115={'url':_0x105332+_0x4bb3('0x2f')+_0x4cbb8f['username']+'&password='+_0x4cbb8f['password'],'method':_0x4bb3('0x30')};rp(_0x117115)[_0x4bb3('0x17')](function(_0x476f22){var _0xb8c3a8=_0x476f22[_0x4bb3('0x31')](';');var _0x34f621={'user_key':_0xb8c3a8[0x0],'session_key':_0xb8c3a8[0x1]};_0x117115={'url':_0x105332+_0x4bb3('0x32'),'method':_0x4bb3('0x33'),'headers':{'user_key':_0x34f621[_0x4bb3('0x34')],'Session_key':_0x34f621[_0x4bb3('0x35')]},'json':!![],'body':_0x3bdacf};return rp(_0x117115);})['then'](function(_0x2c7f58){if(_0x2c7f58[_0x4bb3('0x36')]>=0x1){var _0x456da3={'messageId':_0x2c7f58['internal_order_id']};if(_0x4cbb8f['smsMethod']!=='GP'||!_0x4cbb8f[_0x4bb3('0x37')]){_0x456da3[_0x4bb3('0x38')]=!![];}return _0x47caf4[_0x4bb3('0x18')](_0x456da3);}else{return logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x2a'),util[_0x4bb3('0x28')](_0x2c7f58,{'showHidden':![],'depth':null}));}})[_0x4bb3('0x39')](function(_0x3ab3ec){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4bb3('0x27'),_0x4bb3('0x2a'),util[_0x4bb3('0x28')](_0x3ab3ec,{'showHidden':![],'depth':null}));});}else{logger[_0x4bb3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4bb3('0x27'),_0x4bb3('0x2a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x4bb3('0x3a'):if(_0x4cbb8f[_0x4bb3('0x1f')]){var _0x2f4ab1={'recipient':_0x16e22d[_0x4bb3('0x20')],'message':_0x16e22d[_0x4bb3('0xd')],'sender':_0x4cbb8f['senderString']||_0x4cbb8f[_0x4bb3('0x20')],'authorization':_0x4cbb8f['authToken']};var _0x30a193={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x2f4ab1,'json':!![]};rp(_0x30a193)[_0x4bb3('0x17')](function(_0x1722a4){var _0x4b6063={'messageId':_0x1722a4[_0x4bb3('0x3b')]};if(!_0x4cbb8f[_0x4bb3('0x37')]){_0x4b6063[_0x4bb3('0x38')]=!![];}return _0x47caf4[_0x4bb3('0x18')](_0x4b6063);})[_0x4bb3('0x39')](function(_0xef55a5){logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),'afterCreate',_0x4bb3('0x3a'),util['inspect'](_0xef55a5,{'showHidden':![],'depth':null}));});}else{logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x3a'),_0x4bb3('0x3c'));}break;case _0x4bb3('0x3d'):if(_0x4cbb8f['username']&&_0x4cbb8f[_0x4bb3('0x2d')]){var _0x2f4ab1={'messages':[{'source':'xCALLY\x20Motion','to':_0x16e22d['phone'],'body':_0x16e22d['body'],'from':_0x4cbb8f[_0x4bb3('0x3e')]||_0x4cbb8f['phone']}]};var _0x3206da=util[_0x4bb3('0x3f')](_0x4bb3('0x40'),_0x4cbb8f[_0x4bb3('0x2c')],_0x4cbb8f['password']);var _0x30a193={'method':_0x4bb3('0x33'),'uri':_0x4bb3('0x41'),'body':_0x2f4ab1,'headers':{'Authorization':util[_0x4bb3('0x3f')](_0x4bb3('0x42'),new Buffer(_0x3206da)[_0x4bb3('0x43')](_0x4bb3('0x44')))},'json':!![]};rp(_0x30a193)[_0x4bb3('0x17')](function(_0xecba2d){if(_0xecba2d[_0x4bb3('0x45')]>=0xc8&&_0xecba2d[_0x4bb3('0x45')]<=0xce){if(_0xecba2d[_0x4bb3('0x46')]&&_0xecba2d[_0x4bb3('0x46')]['queued_count']>0x0){var _0x1bbf7b=_[_0x4bb3('0x47')](_0xecba2d['data']['messages']);var _0xe4a141={'messageId':_0x1bbf7b[_0x4bb3('0x48')]};if(!_0x4cbb8f[_0x4bb3('0x37')]){_0xe4a141[_0x4bb3('0x38')]=!![];}return _0x47caf4[_0x4bb3('0x18')](_0xe4a141);}else{logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),'clickSend',util[_0x4bb3('0x28')](_0xecba2d,{'showHidden':![],'depth':null}));}}else{logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x49'),util['inspect'](_0xecba2d,{'showHidden':![],'depth':null}));}})[_0x4bb3('0x39')](function(_0xb92e81){logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),'afterCreate',_0x4bb3('0x49'),util[_0x4bb3('0x28')](_0xb92e81,{'showHidden':![],'depth':null}));});}else{logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x49'),_0x4bb3('0x4a'));}break;case'plivo':if(_0x4cbb8f['authId']&&_0x4cbb8f[_0x4bb3('0x1f')]){var _0x2f4ab1={'dst':_0x16e22d[_0x4bb3('0x20')],'text':_0x16e22d[_0x4bb3('0xd')],'src':_0x4cbb8f[_0x4bb3('0x3e')]||_0x4cbb8f[_0x4bb3('0x20')],'url':_0x4cbb8f[_0x4bb3('0x22')]+_0x4bb3('0x23')+_0x16e22d['id']+_0x4bb3('0x24')+_0x4cbb8f[_0x4bb3('0x4b')]};var _0x3206da=util[_0x4bb3('0x3f')](_0x4bb3('0x40'),_0x4cbb8f[_0x4bb3('0x4c')],_0x4cbb8f[_0x4bb3('0x1f')]);var _0x30a193={'method':_0x4bb3('0x33'),'uri':util[_0x4bb3('0x3f')](_0x4bb3('0x4d'),_0x4cbb8f['authId']),'body':_0x2f4ab1,'headers':{'Authorization':util[_0x4bb3('0x3f')](_0x4bb3('0x42'),new Buffer(_0x3206da)[_0x4bb3('0x43')](_0x4bb3('0x44')))},'json':!![]};rp(_0x30a193)[_0x4bb3('0x17')](function(_0x52ea59){var _0x35764d={'messageId':_0x52ea59['message_uuid'][0x0]};return _0x47caf4['update'](_0x35764d);})['catch'](function(_0x46c8ac){logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),'afterCreate',_0x4bb3('0x4e'),util[_0x4bb3('0x28')](_0x46c8ac,{'showHidden':![],'depth':null}));});}else{logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x4e'),_0x4bb3('0x4f'));}break;case'infobip':if(_0x4cbb8f[_0x4bb3('0x2c')]&&_0x4cbb8f[_0x4bb3('0x2d')]){if(_0x4cbb8f[_0x4bb3('0x50')]){var _0x4c7256={'method':_0x4bb3('0x33'),'uri':_0x4cbb8f[_0x4bb3('0x50')]+_0x4bb3('0x51'),'body':{'username':_0x4cbb8f['username'],'password':_0x4cbb8f['password']},'json':!![]};return rp(_0x4c7256)[_0x4bb3('0x17')](function(_0x200339){var _0x98d6d9={'method':_0x4bb3('0x33'),'uri':_0x4cbb8f[_0x4bb3('0x50')]+_0x4bb3('0x52'),'body':{'messages':[{'from':_0x4cbb8f[_0x4bb3('0x20')],'destinations':[{'to':_0x16e22d[_0x4bb3('0x20')]}],'text':_0x16e22d[_0x4bb3('0xd')],'notifyUrl':_0x4cbb8f['remote']+'/api/sms/messages/'+_0x16e22d['id']+_0x4bb3('0x24')+_0x4cbb8f[_0x4bb3('0x4b')],'notifyContentType':_0x4bb3('0x53'),'callbackData':_0x4cbb8f[_0x4bb3('0x20')]+';'+_0x16e22d[_0x4bb3('0xd')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x200339[_0x4bb3('0x4b')]},'json':!![]};return rp(_0x98d6d9)[_0x4bb3('0x17')](function(_0x1701f2){if(_0x1701f2[_0x4bb3('0x21')]){var _0x8f31a8={'messageId':_0x1701f2[_0x4bb3('0x21')][0x0][_0x4bb3('0xb')]};if(!_0x4cbb8f[_0x4bb3('0x37')]){_0x8f31a8[_0x4bb3('0x38')]=!![];}return _0x47caf4['update'](_0x8f31a8);}else{return logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x54'),util[_0x4bb3('0x28')](_0x1701f2,{'showHidden':![],'depth':null}));}});})[_0x4bb3('0x39')](function(_0x300b71){return logger['error'](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x54'),util[_0x4bb3('0x28')](_0x300b71,{'showHidden':![],'depth':null}));});}else{logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x54'),_0x4bb3('0x55'));}}else{logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x54'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x327503=require('crypto');if(_0x4cbb8f[_0x4bb3('0x56')]){var _0x34e775={};_0x34e775[_0x4bb3('0x57')]=_0x4cbb8f[_0x4bb3('0x2c')];_0x34e775['phone']=_0x16e22d['phone'];_0x34e775[_0x4bb3('0x58')]=_0x4cbb8f[_0x4bb3('0x20')];_0x34e775[_0x4bb3('0x59')]=_0x16e22d[_0x4bb3('0xd')];_0x34e775['timestamp']=+new Date();var _0x57ec59='';var _0x48d336='';var _0x582fd3=Object[_0x4bb3('0x5a')](_0x34e775);_0x582fd3['sort']();for(var _0xdaf21f=0x0;_0xdaf21f<_0x582fd3[_0x4bb3('0x5b')];_0xdaf21f++){if(_0x57ec59!=''){_0x57ec59+='&';}_0x57ec59+=_0x582fd3[_0xdaf21f]+'='+encodeURIComponent(_0x34e775[_0x582fd3[_0xdaf21f]]);_0x48d336+=_0x34e775[_0x582fd3[_0xdaf21f]];}_0x48d336+=_0x4cbb8f[_0x4bb3('0x56')];_0x48d336=_0x327503[_0x4bb3('0x5c')](_0x4bb3('0x5d'))[_0x4bb3('0x18')](_0x48d336)['digest'](_0x4bb3('0x5e'));if(_0x57ec59!==''){_0x57ec59+='&';}_0x57ec59+=_0x4bb3('0x5f')+_0x48d336;var _0x117115={'method':'GET','uri':_0x4cbb8f[_0x4bb3('0x50')]+'/external/get/send.php?'+_0x57ec59,'json':!![]};return rp(_0x117115)[_0x4bb3('0x17')](function(_0x35e446){var _0x555e6a=Object[_0x4bb3('0x5a')](_0x35e446);if(_0x35e446[_0x555e6a[0x0]]['error']&&parseInt(_0x35e446[_0x555e6a[0x0]][_0x4bb3('0x1a')])===0x0){var _0x3c1562={'messageId':_0x35e446[_0x555e6a[0x0]]['id_sms']};if(!_0x4cbb8f[_0x4bb3('0x37')]){_0x3c1562[_0x4bb3('0x38')]=!![];}return _0x47caf4[_0x4bb3('0x18')](_0x3c1562);}else{return logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x60'),util[_0x4bb3('0x28')](_0x35e446[_0x4bb3('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x42dd44){return logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),'afterCreate',_0x4bb3('0x60'),util[_0x4bb3('0x28')](_0x42dd44,{'showHidden':![],'depth':null}));});}else{logger[_0x4bb3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4bb3('0x60'),_0x4bb3('0x61'));}break;case _0x4bb3('0x62'):if(_0x4cbb8f[_0x4bb3('0x56')]){var _0x3eb3fd={'method':_0x4bb3('0x33'),'uri':_0x4bb3('0x63'),'headers':{'Authorization':_0x4cbb8f[_0x4bb3('0x56')]},'body':{'content':_0x16e22d[_0x4bb3('0xd')],'to':[_0x16e22d[_0x4bb3('0x20')]],'from':_0x4cbb8f['phone'],'binary':![],'clientMessageId':_0x4bb3('0x64'),'charset':'UTF-8'},'json':!![]};rp(_0x3eb3fd)['then'](function(_0x3eba9e){if(!_0x3eba9e[_0x4bb3('0x1a')]){var _0x4bf213={'messageId':_0x3eba9e[_0x4bb3('0x21')][0x0][_0x4bb3('0x65')]};if(!_0x4cbb8f['deliveryReport']){_0x4bf213[_0x4bb3('0x38')]=!![];}return _0x47caf4[_0x4bb3('0x18')](_0x4bf213);}else{return logger['error'](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x62'),util[_0x4bb3('0x28')](_0x3eba9e['error'],{'showHidden':![],'depth':null}));}})[_0x4bb3('0x39')](function(_0x5f03bc){return logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),'clickatell',util['inspect'](_0x5f03bc,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell','Missing\x20parameters:\x20apiKey');}break;case _0x4bb3('0x66'):if(_0x4cbb8f['username']&&_0x4cbb8f['password']){var _0x3206da=util['format'](_0x4bb3('0x40'),_0x4cbb8f[_0x4bb3('0x2c')],_0x4cbb8f[_0x4bb3('0x2d')]);var _0x30a193={'method':_0x4bb3('0x33'),'uri':_0x4bb3('0x67')+_0x4cbb8f[_0x4bb3('0x68')]+_0x4bb3('0x69'),'body':{'to':[_0x16e22d[_0x4bb3('0x20')]],'text':_0x16e22d[_0x4bb3('0xd')],'from':_0x4cbb8f[_0x4bb3('0x20')],'applicationId':_0x4cbb8f[_0x4bb3('0x6a')]},'headers':{'Authorization':util['format'](_0x4bb3('0x42'),new Buffer(_0x3206da)[_0x4bb3('0x43')](_0x4bb3('0x44')))},'json':!![]};rp(_0x30a193)['then'](function(_0x1ac917){if(_0x1ac917['id']){var _0x1649ff={'messageId':_0x1ac917['id']};return _0x47caf4[_0x4bb3('0x18')](_0x1649ff);}else{logger['error'](_0x4bb3('0x26'),'afterCreate',_0x4bb3('0x66'),util[_0x4bb3('0x28')](_0x1ac917,{'showHidden':![],'depth':null}));}})[_0x4bb3('0x39')](function(_0x11c2bb){logger['error'](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x66'),util[_0x4bb3('0x28')](_0x11c2bb,{'showHidden':![],'depth':null}));});}else{logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x66'),_0x4bb3('0x4a'));}break;case _0x4bb3('0x6b'):if(_0x4cbb8f[_0x4bb3('0x56')]){var _0x2a4ff2={};var _0x117115={'method':_0x4bb3('0x33'),'uri':_0x4bb3('0x6c'),'headers':{'Authorization':_0x4bb3('0x6d')+_0x4cbb8f[_0x4bb3('0x56')],'Content-Type':_0x4bb3('0x53')},'body':{'from':_0x4cbb8f[_0x4bb3('0x20')],'to':_0x16e22d[_0x4bb3('0x20')],'text':_0x16e22d[_0x4bb3('0xd')]},'json':!![]};return rp(_0x117115)[_0x4bb3('0x17')](function(_0x380f22){if(_0x380f22[_0x4bb3('0x6e')]==0xca){_0x2a4ff2['message']=_0x380f22;var _0x1cde75={'method':_0x4bb3('0x33'),'uri':_0x4bb3('0x6f'),'headers':{'Authorization':_0x4bb3('0x6d')+_0x4cbb8f['apiKey'],'Content-Type':_0x4bb3('0x53')},'body':{'refid':_0x2a4ff2[_0x4bb3('0x70')]['refid']},'json':!![]};return rp(_0x1cde75)[_0x4bb3('0x17')](function(_0x5afa1c){_0x2a4ff2[_0x4bb3('0x71')]=_0x5afa1c;var _0x3813ae={'messageId':_0x2a4ff2[_0x4bb3('0x70')]['refid'],'read':!![]};return _0x47caf4[_0x4bb3('0x18')](_0x3813ae);});}else{return logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x6b'),util['inspect'](_0x380f22,{'showHidden':![],'depth':null}));}})[_0x4bb3('0x39')](function(_0x29ff4d){return logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x6b'),util[_0x4bb3('0x28')](_0x29ff4d,{'showHidden':![],'depth':null}));});}else{return logger[_0x4bb3('0x1a')](_0x4bb3('0x26'),_0x4bb3('0x27'),_0x4bb3('0x6b'),_0x4bb3('0x72'));}break;}}})[_0x4bb3('0x73')](function(){_0x2dd92b();});}else{_0x2dd92b();}}},'charset':_0x4bb3('0x74'),'collate':_0x4bb3('0x75')});};
\ No newline at end of file