Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / smsMessage / smsMessage.model.js
index 42e7fac..8fcbd7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a2e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','body','FULLTEXT','models','toLowerCase','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','direction','catch','error','out','find','SmsAccountId','type','twilio','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','smsMethod','sender','login?username=','&password=','password','GET','POST','user_key','session_key','total_sent','update','SmsMessage,\x20%s,\x20%s,\x20%s','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','username','https://rest.clicksend.com/v3/sms/send','base64','http_code','data','queued_count','head','message_id','clickSend','authId','Basic\x20%s','toString','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','Missing\x20parameters:\x20username,\x20password','csc','crypto','login','timestamp','keys','sort','apiKey','createHash','md5','digest','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x12c7c4,_0x445b21){var _0x30bbdb=function(_0x3b9a58){while(--_0x3b9a58){_0x12c7c4['push'](_0x12c7c4['shift']());}};_0x30bbdb(++_0x445b21);}(_0x2a2e,0x76));var _0xe2a2=function(_0x584967,_0x5ab620){_0x584967=_0x584967-0x0;var _0x546acc=_0x2a2e[_0x584967];return _0x546acc;};'use strict';var _=require(_0xe2a2('0x0'));var util=require(_0xe2a2('0x1'));var logger=require(_0xe2a2('0x2'))(_0xe2a2('0x3'));var moment=require(_0xe2a2('0x4'));var BPromise=require(_0xe2a2('0x5'));var rp=require(_0xe2a2('0x6'));var fs=require('fs');var path=require(_0xe2a2('0x7'));var rimraf=require(_0xe2a2('0x8'));var config=require(_0xe2a2('0x9'));var attributes=require(_0xe2a2('0xa'));module[_0xe2a2('0xb')]=function(_0x3f1d8a,_0x11286a){return _0x3f1d8a[_0xe2a2('0xc')]('SmsMessage',attributes,{'tableName':_0xe2a2('0xd'),'paranoid':![],'indexes':[{'name':_0xe2a2('0xe'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0xe2a2('0xf')],'type':_0xe2a2('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d2595,_0xd7e12f,_0x2d5d9c){var _0x1603e4=_0x3f1d8a[_0xe2a2('0x11')];var _0x1ceb67=_0x4d2595['get']({'plain':!![]});if(_0x1ceb67['direction'][_0xe2a2('0x12')]()==='in'||_0x1ceb67['direction'][_0xe2a2('0x12')]()==='out'&&!_0x1ceb67[_0xe2a2('0x13')]&&!_[_0xe2a2('0x14')](_0x1ceb67[_0xe2a2('0x15')])){_0x1603e4[_0xe2a2('0x16')][_0xe2a2('0x17')]({'where':{'id':_0x1ceb67[_0xe2a2('0x18')]}})[_0xe2a2('0x19')](function(_0x221e82){if(_0x221e82){_0x221e82['update']({'lastMsgAt':_0x1ceb67['createdAt'],'lastMsgDirection':_0x1ceb67[_0xe2a2('0x1a')][_0xe2a2('0x12')]()});}})[_0xe2a2('0x1b')](function(_0x49840b){console[_0xe2a2('0x1c')](_0x49840b);});}if(_0x1ceb67[_0xe2a2('0x1a')]===_0xe2a2('0x1d')&&!_0x1ceb67[_0xe2a2('0x13')]){var _0x3da1b4;_0x1603e4['SmsAccount'][_0xe2a2('0x1e')]({'where':{'id':_0x1ceb67[_0xe2a2('0x1f')]},'raw':!![]})['then'](function(_0x28ffef){_0x3da1b4=_0x28ffef;if(_0x3da1b4&&_0x3da1b4[_0xe2a2('0x20')]){switch(_0x3da1b4['type']){case _0xe2a2('0x21'):var _0x4e7bc5=require(_0xe2a2('0x21'));if(_0x3da1b4['accountSid']&&_0x3da1b4[_0xe2a2('0x22')]&&_0x3da1b4[_0xe2a2('0x23')]){var _0x305a6e=new _0x4e7bc5(_0x3da1b4['accountSid'],_0x3da1b4[_0xe2a2('0x22')]);_0x305a6e[_0xe2a2('0x24')][_0xe2a2('0x25')]({'body':_0x1ceb67[_0xe2a2('0xf')],'to':_0x1ceb67[_0xe2a2('0x23')],'from':_0x3da1b4[_0xe2a2('0x23')],'statusCallback':_0x3da1b4[_0xe2a2('0x26')]+_0xe2a2('0x27')+_0x1ceb67['id']+_0xe2a2('0x28')+_0x3da1b4[_0xe2a2('0x29')]})[_0xe2a2('0x19')](function(_0x436e5e){if(_0x436e5e[_0xe2a2('0x2a')]){return _0x4d2595['update']({'messageId':_0x436e5e[_0xe2a2('0x2a')]});}})[_0xe2a2('0x1b')](function(_0x2b4b27){logger[_0xe2a2('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe2a2('0x21'),util[_0xe2a2('0x2b')](_0x2b4b27,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe2a2('0x2c'),_0xe2a2('0x21'),_0xe2a2('0x2d'));}break;case _0xe2a2('0x2e'):var _0x5a535a=_0xe2a2('0x2f');if(_0x3da1b4['username']&&_0x3da1b4['password']){var _0x263d9b={'recipient':[_0x1ceb67[_0xe2a2('0x23')]],'message':_0x1ceb67[_0xe2a2('0xf')],'message_type':_0x3da1b4[_0xe2a2('0x30')]};if(_0x3da1b4['smsMethod']&&_0x3da1b4['smsMethod']!=='SI'){_0x263d9b[_0xe2a2('0x31')]=_0x3da1b4[_0xe2a2('0x23')];}var _0x414f16={'url':_0x5a535a+_0xe2a2('0x32')+_0x3da1b4['username']+_0xe2a2('0x33')+_0x3da1b4[_0xe2a2('0x34')],'method':_0xe2a2('0x35')};rp(_0x414f16)[_0xe2a2('0x19')](function(_0x1335b1){var _0x179200=_0x1335b1['split'](';');var _0x1117c5={'user_key':_0x179200[0x0],'session_key':_0x179200[0x1]};_0x414f16={'url':_0x5a535a+'sms','method':_0xe2a2('0x36'),'headers':{'user_key':_0x1117c5[_0xe2a2('0x37')],'Session_key':_0x1117c5[_0xe2a2('0x38')]},'json':!![],'body':_0x263d9b};return rp(_0x414f16);})[_0xe2a2('0x19')](function(_0x4ed145){if(_0x4ed145[_0xe2a2('0x39')]>=0x1){var _0x1573a8={'messageId':_0x4ed145['internal_order_id']};if(_0x3da1b4[_0xe2a2('0x30')]!=='GP'||!_0x3da1b4['deliveryReport']){_0x1573a8['read']=!![];}return _0x4d2595[_0xe2a2('0x3a')](_0x1573a8);}else{return logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),'skebby',util[_0xe2a2('0x2b')](_0x4ed145,{'showHidden':![],'depth':null}));}})['catch'](function(_0x6694da){return logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),_0xe2a2('0x2e'),util[_0xe2a2('0x2b')](_0x6694da,{'showHidden':![],'depth':null}));});}else{logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),_0xe2a2('0x2e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xe2a2('0x3c'):if(_0x3da1b4[_0xe2a2('0x22')]){var _0x56fe1a={'recipient':_0x1ceb67[_0xe2a2('0x23')],'message':_0x1ceb67[_0xe2a2('0xf')],'sender':_0x3da1b4[_0xe2a2('0x3d')]||_0x3da1b4[_0xe2a2('0x23')],'authorization':_0x3da1b4[_0xe2a2('0x22')]};var _0xd7e12f={'method':_0xe2a2('0x36'),'uri':_0xe2a2('0x3e'),'body':_0x56fe1a,'json':!![]};rp(_0xd7e12f)[_0xe2a2('0x19')](function(_0x1fca3b){var _0x256062={'messageId':_0x1fca3b[_0xe2a2('0x3f')]};if(!_0x3da1b4[_0xe2a2('0x40')]){_0x256062[_0xe2a2('0x41')]=!![];}return _0x4d2595[_0xe2a2('0x3a')](_0x256062);})['catch'](function(_0x28ca4a){logger[_0xe2a2('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe2a2('0x2c'),_0xe2a2('0x3c'),util[_0xe2a2('0x2b')](_0x28ca4a,{'showHidden':![],'depth':null}));});}else{logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),_0xe2a2('0x3c'),_0xe2a2('0x42'));}break;case _0xe2a2('0x43'):if(_0x3da1b4['username']&&_0x3da1b4[_0xe2a2('0x34')]){var _0x56fe1a={'messages':[{'source':_0xe2a2('0x44'),'to':_0x1ceb67[_0xe2a2('0x23')],'body':_0x1ceb67[_0xe2a2('0xf')],'from':_0x3da1b4[_0xe2a2('0x3d')]||_0x3da1b4['phone']}]};var _0x3a1297=util[_0xe2a2('0x45')](_0xe2a2('0x46'),_0x3da1b4[_0xe2a2('0x47')],_0x3da1b4['password']);var _0xd7e12f={'method':_0xe2a2('0x36'),'uri':_0xe2a2('0x48'),'body':_0x56fe1a,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x3a1297)['toString'](_0xe2a2('0x49')))},'json':!![]};rp(_0xd7e12f)[_0xe2a2('0x19')](function(_0x2c1a39){if(_0x2c1a39[_0xe2a2('0x4a')]>=0xc8&&_0x2c1a39['http_code']<=0xce){if(_0x2c1a39[_0xe2a2('0x4b')]&&_0x2c1a39[_0xe2a2('0x4b')][_0xe2a2('0x4c')]>0x0){var _0x54d9eb=_[_0xe2a2('0x4d')](_0x2c1a39[_0xe2a2('0x4b')][_0xe2a2('0x24')]);var _0x394818={'messageId':_0x54d9eb[_0xe2a2('0x4e')]};if(!_0x3da1b4['deliveryReport']){_0x394818['read']=!![];}return _0x4d2595[_0xe2a2('0x3a')](_0x394818);}else{logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),_0xe2a2('0x4f'),util['inspect'](_0x2c1a39,{'showHidden':![],'depth':null}));}}else{logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),_0xe2a2('0x4f'),util[_0xe2a2('0x2b')](_0x2c1a39,{'showHidden':![],'depth':null}));}})['catch'](function(_0xc366d6){logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),_0xe2a2('0x4f'),util[_0xe2a2('0x2b')](_0xc366d6,{'showHidden':![],'depth':null}));});}else{logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),_0xe2a2('0x4f'),'Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x3da1b4[_0xe2a2('0x50')]&&_0x3da1b4['authToken']){var _0x56fe1a={'dst':_0x1ceb67[_0xe2a2('0x23')],'text':_0x1ceb67[_0xe2a2('0xf')],'src':_0x3da1b4[_0xe2a2('0x3d')]||_0x3da1b4['phone'],'url':_0x3da1b4[_0xe2a2('0x26')]+_0xe2a2('0x27')+_0x1ceb67['id']+'/status?token='+_0x3da1b4[_0xe2a2('0x29')]};var _0x3a1297=util[_0xe2a2('0x45')](_0xe2a2('0x46'),_0x3da1b4[_0xe2a2('0x50')],_0x3da1b4[_0xe2a2('0x22')]);var _0xd7e12f={'method':_0xe2a2('0x36'),'uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x3da1b4[_0xe2a2('0x50')]),'body':_0x56fe1a,'headers':{'Authorization':util[_0xe2a2('0x45')](_0xe2a2('0x51'),new Buffer(_0x3a1297)[_0xe2a2('0x52')](_0xe2a2('0x49')))},'json':!![]};rp(_0xd7e12f)['then'](function(_0x127f27){var _0x2a65dc={'messageId':_0x127f27[_0xe2a2('0x53')][0x0]};return _0x4d2595[_0xe2a2('0x3a')](_0x2a65dc);})[_0xe2a2('0x1b')](function(_0x1c6622){logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),'plivo',util['inspect'](_0x1c6622,{'showHidden':![],'depth':null}));});}else{logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),_0xe2a2('0x54'),_0xe2a2('0x55'));}break;case _0xe2a2('0x56'):if(_0x3da1b4[_0xe2a2('0x47')]&&_0x3da1b4[_0xe2a2('0x34')]){if(_0x3da1b4[_0xe2a2('0x57')]){var _0xdf45da={'method':_0xe2a2('0x36'),'uri':_0x3da1b4['baseUrl']+_0xe2a2('0x58'),'body':{'username':_0x3da1b4[_0xe2a2('0x47')],'password':_0x3da1b4[_0xe2a2('0x34')]},'json':!![]};return rp(_0xdf45da)[_0xe2a2('0x19')](function(_0x4e04ea){var _0x381923={'method':_0xe2a2('0x36'),'uri':_0x3da1b4[_0xe2a2('0x57')]+_0xe2a2('0x59'),'body':{'messages':[{'from':_0x3da1b4[_0xe2a2('0x23')],'destinations':[{'to':_0x1ceb67[_0xe2a2('0x23')]}],'text':_0x1ceb67[_0xe2a2('0xf')],'notifyUrl':_0x3da1b4['remote']+_0xe2a2('0x27')+_0x1ceb67['id']+'/status?token='+_0x3da1b4['token'],'notifyContentType':_0xe2a2('0x5a'),'callbackData':_0x3da1b4['phone']+';'+_0x1ceb67[_0xe2a2('0xf')]}]},'headers':{'Authorization':_0xe2a2('0x5b')+_0x4e04ea[_0xe2a2('0x29')]},'json':!![]};return rp(_0x381923)['then'](function(_0xeb98f9){if(_0xeb98f9[_0xe2a2('0x24')]){var _0x33ab87={'messageId':_0xeb98f9[_0xe2a2('0x24')][0x0][_0xe2a2('0xe')]};if(!_0x3da1b4['deliveryReport']){_0x33ab87['read']=!![];}return _0x4d2595[_0xe2a2('0x3a')](_0x33ab87);}else{return logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),_0xe2a2('0x56'),util[_0xe2a2('0x2b')](_0xeb98f9,{'showHidden':![],'depth':null}));}});})[_0xe2a2('0x1b')](function(_0x21ad8a){return logger['error'](_0xe2a2('0x3b'),_0xe2a2('0x2c'),'infobip',util['inspect'](_0x21ad8a,{'showHidden':![],'depth':null}));});}else{logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),_0xe2a2('0x56'),_0xe2a2('0x5c'));}}else{logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),_0xe2a2('0x56'),_0xe2a2('0x5d'));}break;case _0xe2a2('0x5e'):var _0x10de73=require(_0xe2a2('0x5f'));if(_0x3da1b4['apiKey']){var _0x3165c9={};_0x3165c9[_0xe2a2('0x60')]=_0x3da1b4['username'];_0x3165c9[_0xe2a2('0x23')]=_0x1ceb67['phone'];_0x3165c9[_0xe2a2('0x31')]=_0x3da1b4[_0xe2a2('0x23')];_0x3165c9['text']=_0x1ceb67[_0xe2a2('0xf')];_0x3165c9[_0xe2a2('0x61')]=+new Date();var _0xe5b317='';var _0x105f23='';var _0x126092=Object[_0xe2a2('0x62')](_0x3165c9);_0x126092[_0xe2a2('0x63')]();for(var _0x3c8f02=0x0;_0x3c8f02<_0x126092['length'];_0x3c8f02++){if(_0xe5b317!=''){_0xe5b317+='&';}_0xe5b317+=_0x126092[_0x3c8f02]+'='+encodeURIComponent(_0x3165c9[_0x126092[_0x3c8f02]]);_0x105f23+=_0x3165c9[_0x126092[_0x3c8f02]];}_0x105f23+=_0x3da1b4[_0xe2a2('0x64')];_0x105f23=_0x10de73[_0xe2a2('0x65')](_0xe2a2('0x66'))[_0xe2a2('0x3a')](_0x105f23)[_0xe2a2('0x67')]('hex');if(_0xe5b317!==''){_0xe5b317+='&';}_0xe5b317+=_0xe2a2('0x68')+_0x105f23;var _0x414f16={'method':_0xe2a2('0x35'),'uri':_0x3da1b4['baseUrl']+'/external/get/send.php?'+_0xe5b317,'json':!![]};return rp(_0x414f16)['then'](function(_0x3acf9e){var _0x6c014=Object[_0xe2a2('0x62')](_0x3acf9e);if(_0x3acf9e[_0x6c014[0x0]]['error']&&parseInt(_0x3acf9e[_0x6c014[0x0]]['error'])===0x0){var _0x1f01b6={'messageId':_0x3acf9e[_0x6c014[0x0]][_0xe2a2('0x69')]};if(!_0x3da1b4[_0xe2a2('0x40')]){_0x1f01b6[_0xe2a2('0x41')]=!![];}return _0x4d2595[_0xe2a2('0x3a')](_0x1f01b6);}else{return logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),'csc',util[_0xe2a2('0x2b')](_0x3acf9e['error'],{'showHidden':![],'depth':null}));}})[_0xe2a2('0x1b')](function(_0x55f08c){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe2a2('0x2c'),_0xe2a2('0x5e'),util['inspect'](_0x55f08c,{'showHidden':![],'depth':null}));});}else{logger[_0xe2a2('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe2a2('0x2c'),_0xe2a2('0x5e'),_0xe2a2('0x6a'));}break;case _0xe2a2('0x6b'):if(_0x3da1b4['apiKey']){var _0x214281={'method':_0xe2a2('0x36'),'uri':_0xe2a2('0x6c'),'headers':{'Authorization':_0x3da1b4['apiKey']},'body':{'content':_0x1ceb67[_0xe2a2('0xf')],'to':[_0x1ceb67[_0xe2a2('0x23')]],'from':_0x3da1b4[_0xe2a2('0x23')],'binary':![],'clientMessageId':_0xe2a2('0x6d'),'charset':'UTF-8'},'json':!![]};rp(_0x214281)['then'](function(_0x56f6b0){if(!_0x56f6b0[_0xe2a2('0x1c')]){var _0x475da0={'messageId':_0x56f6b0[_0xe2a2('0x24')][0x0][_0xe2a2('0x6e')]};if(!_0x3da1b4['deliveryReport']){_0x475da0[_0xe2a2('0x41')]=!![];}return _0x4d2595[_0xe2a2('0x3a')](_0x475da0);}else{return logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),_0xe2a2('0x6b'),util[_0xe2a2('0x2b')](_0x56f6b0[_0xe2a2('0x1c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x219e64){return logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),'afterCreate',_0xe2a2('0x6b'),util[_0xe2a2('0x2b')](_0x219e64,{'showHidden':![],'depth':null}));});}else{logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),_0xe2a2('0x2c'),'clickatell',_0xe2a2('0x6a'));}break;case _0xe2a2('0x6f'):if(_0x3da1b4[_0xe2a2('0x64')]){var _0x4a7aac={};var _0x414f16={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xe2a2('0x70')+_0x3da1b4[_0xe2a2('0x64')],'Content-Type':'application/json'},'body':{'from':_0x3da1b4[_0xe2a2('0x23')],'to':_0x1ceb67[_0xe2a2('0x23')],'text':_0x1ceb67[_0xe2a2('0xf')]},'json':!![]};return rp(_0x414f16)[_0xe2a2('0x19')](function(_0xaeb309){if(_0xaeb309[_0xe2a2('0x71')]==0xca){_0x4a7aac[_0xe2a2('0x72')]=_0xaeb309;var _0x48bc04={'method':_0xe2a2('0x36'),'uri':_0xe2a2('0x73'),'headers':{'Authorization':_0xe2a2('0x70')+_0x3da1b4[_0xe2a2('0x64')],'Content-Type':_0xe2a2('0x5a')},'body':{'refid':_0x4a7aac[_0xe2a2('0x72')][_0xe2a2('0x74')]},'json':!![]};return rp(_0x48bc04)[_0xe2a2('0x19')](function(_0x2b79d8){_0x4a7aac[_0xe2a2('0x75')]=_0x2b79d8;var _0x34210c={'messageId':_0x4a7aac[_0xe2a2('0x72')][_0xe2a2('0x74')],'read':!![]};return _0x4d2595[_0xe2a2('0x3a')](_0x34210c);});}else{return logger[_0xe2a2('0x1c')](_0xe2a2('0x3b'),'afterCreate',_0xe2a2('0x6f'),util[_0xe2a2('0x2b')](_0xaeb309,{'showHidden':![],'depth':null}));}})[_0xe2a2('0x1b')](function(_0x528c45){return logger[_0xe2a2('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe2a2('0x2c'),_0xe2a2('0x6f'),util[_0xe2a2('0x2b')](_0x528c45,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xe2a2('0x3b'),'afterCreate',_0xe2a2('0x6f'),_0xe2a2('0x76'));}break;}}})[_0xe2a2('0x77')](function(){_0x2d5d9c();});}else{_0x2d5d9c();}}},'charset':_0xe2a2('0x78'),'collate':_0xe2a2('0x79')});};
\ No newline at end of file
+var _0x8e0d=['clickSend','plivo','authId','%s:%s','base64','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','IBSSO\x20','read','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','signature=','id_sms','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','Missing\x20parameters:\x20apiKey','bandwidth','accountId','/messages','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','application/json','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','then','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','body','smsMethod','sender','login?username=','&password=','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','update','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','http_code','data','queued_count','head','message_id'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0x8e0d,0x117));var _0xd8e0=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x8e0d[_0x5678b5];return _0x4c09a5;};'use strict';var _=require(_0xd8e0('0x0'));var util=require(_0xd8e0('0x1'));var logger=require(_0xd8e0('0x2'))(_0xd8e0('0x3'));var moment=require(_0xd8e0('0x4'));var BPromise=require('bluebird');var rp=require(_0xd8e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd8e0('0x6'));var config=require(_0xd8e0('0x7'));var attributes=require(_0xd8e0('0x8'));module[_0xd8e0('0x9')]=function(_0xb377fb,_0x477452){return _0xb377fb['define'](_0xd8e0('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xd8e0('0xb'),'fields':['messageId']},{'name':_0xd8e0('0xc'),'fields':['body'],'type':_0xd8e0('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x523ff7,_0x54ead5,_0x225092){var _0x3c3f18=_0xb377fb[_0xd8e0('0xe')];var _0xa5f71b=_0x523ff7[_0xd8e0('0xf')]({'plain':!![]});if(_0xa5f71b[_0xd8e0('0x10')][_0xd8e0('0x11')]()==='in'||_0xa5f71b['direction'][_0xd8e0('0x11')]()===_0xd8e0('0x12')&&!_0xa5f71b[_0xd8e0('0x13')]&&!_['isNil'](_0xa5f71b['UserId'])&&!_[_0xd8e0('0x14')](_0xa5f71b[_0xd8e0('0x15')])){_0x3c3f18['SmsInteraction']['findOne']({'where':{'id':_0xa5f71b[_0xd8e0('0x15')]}})[_0xd8e0('0x16')](function(_0x1cca87){if(_0x1cca87){_0x1cca87['update']({'lastMsgAt':_0xa5f71b['createdAt'],'lastMsgDirection':_0xa5f71b[_0xd8e0('0x10')]['toLowerCase']()});}})[_0xd8e0('0x17')](function(_0x16f2d7){console['error'](_0x16f2d7);});}if(_0xa5f71b[_0xd8e0('0x10')]===_0xd8e0('0x12')&&!_0xa5f71b[_0xd8e0('0x13')]){var _0x4c5a84;_0x3c3f18[_0xd8e0('0x18')][_0xd8e0('0x19')]({'where':{'id':_0xa5f71b[_0xd8e0('0x1a')]},'raw':!![]})[_0xd8e0('0x16')](function(_0x3be526){_0x4c5a84=_0x3be526;if(_0x4c5a84&&_0x4c5a84[_0xd8e0('0x1b')]){switch(_0x4c5a84['type']){case _0xd8e0('0x1c'):var _0x3f41fb=require(_0xd8e0('0x1c'));if(_0x4c5a84[_0xd8e0('0x1d')]&&_0x4c5a84[_0xd8e0('0x1e')]&&_0x4c5a84['phone']){var _0x58c21b=new _0x3f41fb(_0x4c5a84[_0xd8e0('0x1d')],_0x4c5a84[_0xd8e0('0x1e')]);_0x58c21b[_0xd8e0('0x1f')][_0xd8e0('0x20')]({'body':_0xa5f71b['body'],'to':_0xa5f71b['phone'],'from':_0x4c5a84[_0xd8e0('0x21')],'statusCallback':_0x4c5a84[_0xd8e0('0x22')]+_0xd8e0('0x23')+_0xa5f71b['id']+'/status?token='+_0x4c5a84[_0xd8e0('0x24')]})[_0xd8e0('0x16')](function(_0x4216fd){if(_0x4216fd[_0xd8e0('0x25')]){return _0x523ff7['update']({'messageId':_0x4216fd[_0xd8e0('0x25')]});}})[_0xd8e0('0x17')](function(_0x29b398){logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x1c'),util[_0xd8e0('0x29')](_0x29b398,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd8e0('0x27'),_0xd8e0('0x28'),'twilio',_0xd8e0('0x2a'));}break;case _0xd8e0('0x2b'):var _0x5840ef='https://api.skebby.it/API/v1.0/REST/';if(_0x4c5a84[_0xd8e0('0x2c')]&&_0x4c5a84[_0xd8e0('0x2d')]){var _0x3ca87a={'recipient':[_0xa5f71b[_0xd8e0('0x21')]],'message':_0xa5f71b[_0xd8e0('0x2e')],'message_type':_0x4c5a84[_0xd8e0('0x2f')]};if(_0x4c5a84[_0xd8e0('0x2f')]&&_0x4c5a84[_0xd8e0('0x2f')]!=='SI'){_0x3ca87a[_0xd8e0('0x30')]=_0x4c5a84[_0xd8e0('0x21')];}var _0x5ad25e={'url':_0x5840ef+_0xd8e0('0x31')+_0x4c5a84[_0xd8e0('0x2c')]+_0xd8e0('0x32')+_0x4c5a84[_0xd8e0('0x2d')],'method':'GET'};rp(_0x5ad25e)[_0xd8e0('0x16')](function(_0x5e4073){var _0x2d00a1=_0x5e4073[_0xd8e0('0x33')](';');var _0x2e091e={'user_key':_0x2d00a1[0x0],'session_key':_0x2d00a1[0x1]};_0x5ad25e={'url':_0x5840ef+_0xd8e0('0x34'),'method':_0xd8e0('0x35'),'headers':{'user_key':_0x2e091e[_0xd8e0('0x36')],'Session_key':_0x2e091e['session_key']},'json':!![],'body':_0x3ca87a};return rp(_0x5ad25e);})[_0xd8e0('0x16')](function(_0x116d10){if(_0x116d10[_0xd8e0('0x37')]>=0x1){var _0x3904c0={'messageId':_0x116d10[_0xd8e0('0x38')]};if(_0x4c5a84[_0xd8e0('0x2f')]!=='GP'||!_0x4c5a84[_0xd8e0('0x39')]){_0x3904c0['read']=!![];}return _0x523ff7['update'](_0x3904c0);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd8e0('0x2b'),util[_0xd8e0('0x29')](_0x116d10,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1993db){return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x2b'),util['inspect'](_0x1993db,{'showHidden':![],'depth':null}));});}else{logger[_0xd8e0('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd8e0('0x28'),_0xd8e0('0x2b'),_0xd8e0('0x3a'));}break;case _0xd8e0('0x3b'):if(_0x4c5a84[_0xd8e0('0x1e')]){var _0x42797e={'recipient':_0xa5f71b[_0xd8e0('0x21')],'message':_0xa5f71b[_0xd8e0('0x2e')],'sender':_0x4c5a84[_0xd8e0('0x3c')]||_0x4c5a84[_0xd8e0('0x21')],'authorization':_0x4c5a84[_0xd8e0('0x1e')]};var _0x54ead5={'method':_0xd8e0('0x35'),'uri':_0xd8e0('0x3d'),'body':_0x42797e,'json':!![]};rp(_0x54ead5)[_0xd8e0('0x16')](function(_0x3ece17){var _0x544e05={'messageId':_0x3ece17['requestid']};if(!_0x4c5a84[_0xd8e0('0x39')]){_0x544e05['read']=!![];}return _0x523ff7[_0xd8e0('0x3e')](_0x544e05);})['catch'](function(_0x2b97f8){logger[_0xd8e0('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd8e0('0x28'),_0xd8e0('0x3b'),util[_0xd8e0('0x29')](_0x2b97f8,{'showHidden':![],'depth':null}));});}else{logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x3b'),_0xd8e0('0x3f'));}break;case _0xd8e0('0x40'):if(_0x4c5a84[_0xd8e0('0x2c')]&&_0x4c5a84[_0xd8e0('0x2d')]){var _0x42797e={'messages':[{'source':_0xd8e0('0x41'),'to':_0xa5f71b[_0xd8e0('0x21')],'body':_0xa5f71b[_0xd8e0('0x2e')],'from':_0x4c5a84[_0xd8e0('0x3c')]||_0x4c5a84[_0xd8e0('0x21')]}]};var _0x5ba9a4=util['format']('%s:%s',_0x4c5a84[_0xd8e0('0x2c')],_0x4c5a84[_0xd8e0('0x2d')]);var _0x54ead5={'method':_0xd8e0('0x35'),'uri':_0xd8e0('0x42'),'body':_0x42797e,'headers':{'Authorization':util[_0xd8e0('0x43')](_0xd8e0('0x44'),new Buffer(_0x5ba9a4)[_0xd8e0('0x45')]('base64'))},'json':!![]};rp(_0x54ead5)[_0xd8e0('0x16')](function(_0x2e53d4){if(_0x2e53d4[_0xd8e0('0x46')]>=0xc8&&_0x2e53d4[_0xd8e0('0x46')]<=0xce){if(_0x2e53d4[_0xd8e0('0x47')]&&_0x2e53d4[_0xd8e0('0x47')][_0xd8e0('0x48')]>0x0){var _0x3778e3=_[_0xd8e0('0x49')](_0x2e53d4['data'][_0xd8e0('0x1f')]);var _0x3752a8={'messageId':_0x3778e3[_0xd8e0('0x4a')]};if(!_0x4c5a84[_0xd8e0('0x39')]){_0x3752a8['read']=!![];}return _0x523ff7['update'](_0x3752a8);}else{logger[_0xd8e0('0x26')](_0xd8e0('0x27'),'afterCreate','clickSend',util[_0xd8e0('0x29')](_0x2e53d4,{'showHidden':![],'depth':null}));}}else{logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x4b'),util[_0xd8e0('0x29')](_0x2e53d4,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1b579){logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x4b'),util[_0xd8e0('0x29')](_0x1b579,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x4b'),_0xd8e0('0x3a'));}break;case _0xd8e0('0x4c'):if(_0x4c5a84[_0xd8e0('0x4d')]&&_0x4c5a84['authToken']){var _0x42797e={'dst':_0xa5f71b[_0xd8e0('0x21')],'text':_0xa5f71b[_0xd8e0('0x2e')],'src':_0x4c5a84[_0xd8e0('0x3c')]||_0x4c5a84[_0xd8e0('0x21')],'url':_0x4c5a84[_0xd8e0('0x22')]+_0xd8e0('0x23')+_0xa5f71b['id']+'/status?token='+_0x4c5a84[_0xd8e0('0x24')]};var _0x5ba9a4=util[_0xd8e0('0x43')](_0xd8e0('0x4e'),_0x4c5a84[_0xd8e0('0x4d')],_0x4c5a84[_0xd8e0('0x1e')]);var _0x54ead5={'method':_0xd8e0('0x35'),'uri':util[_0xd8e0('0x43')]('https://api.plivo.com/v1/Account/%s/Message/',_0x4c5a84[_0xd8e0('0x4d')]),'body':_0x42797e,'headers':{'Authorization':util[_0xd8e0('0x43')](_0xd8e0('0x44'),new Buffer(_0x5ba9a4)[_0xd8e0('0x45')](_0xd8e0('0x4f')))},'json':!![]};rp(_0x54ead5)[_0xd8e0('0x16')](function(_0x749a21){var _0x506bba={'messageId':_0x749a21['message_uuid'][0x0]};return _0x523ff7[_0xd8e0('0x3e')](_0x506bba);})[_0xd8e0('0x17')](function(_0x56127b){logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x4c'),util[_0xd8e0('0x29')](_0x56127b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd8e0('0x27'),'afterCreate',_0xd8e0('0x4c'),_0xd8e0('0x50'));}break;case _0xd8e0('0x51'):if(_0x4c5a84['username']&&_0x4c5a84[_0xd8e0('0x2d')]){if(_0x4c5a84[_0xd8e0('0x52')]){var _0x3eb8f3={'method':_0xd8e0('0x35'),'uri':_0x4c5a84[_0xd8e0('0x52')]+_0xd8e0('0x53'),'body':{'username':_0x4c5a84[_0xd8e0('0x2c')],'password':_0x4c5a84[_0xd8e0('0x2d')]},'json':!![]};return rp(_0x3eb8f3)[_0xd8e0('0x16')](function(_0x5b2bcb){var _0x7cc5ac={'method':_0xd8e0('0x35'),'uri':_0x4c5a84[_0xd8e0('0x52')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x4c5a84[_0xd8e0('0x21')],'destinations':[{'to':_0xa5f71b[_0xd8e0('0x21')]}],'text':_0xa5f71b['body'],'notifyUrl':_0x4c5a84[_0xd8e0('0x22')]+_0xd8e0('0x23')+_0xa5f71b['id']+'/status?token='+_0x4c5a84[_0xd8e0('0x24')],'notifyContentType':'application/json','callbackData':_0x4c5a84[_0xd8e0('0x21')]+';'+_0xa5f71b['body']}]},'headers':{'Authorization':_0xd8e0('0x54')+_0x5b2bcb[_0xd8e0('0x24')]},'json':!![]};return rp(_0x7cc5ac)['then'](function(_0x20e6a7){if(_0x20e6a7[_0xd8e0('0x1f')]){var _0x156df5={'messageId':_0x20e6a7[_0xd8e0('0x1f')][0x0][_0xd8e0('0xb')]};if(!_0x4c5a84[_0xd8e0('0x39')]){_0x156df5[_0xd8e0('0x55')]=!![];}return _0x523ff7[_0xd8e0('0x3e')](_0x156df5);}else{return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),'infobip',util[_0xd8e0('0x29')](_0x20e6a7,{'showHidden':![],'depth':null}));}});})[_0xd8e0('0x17')](function(_0x53d493){return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),'infobip',util[_0xd8e0('0x29')](_0x53d493,{'showHidden':![],'depth':null}));});}else{logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x51'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x51'),_0xd8e0('0x3a'));}break;case _0xd8e0('0x56'):var _0x330a36=require(_0xd8e0('0x57'));if(_0x4c5a84[_0xd8e0('0x58')]){var _0x29b3f0={};_0x29b3f0[_0xd8e0('0x59')]=_0x4c5a84['username'];_0x29b3f0[_0xd8e0('0x21')]=_0xa5f71b[_0xd8e0('0x21')];_0x29b3f0['sender']=_0x4c5a84['phone'];_0x29b3f0[_0xd8e0('0x5a')]=_0xa5f71b[_0xd8e0('0x2e')];_0x29b3f0[_0xd8e0('0x5b')]=+new Date();var _0x2fb9f5='';var _0x53c7b3='';var _0xf209c9=Object[_0xd8e0('0x5c')](_0x29b3f0);_0xf209c9[_0xd8e0('0x5d')]();for(var _0x490023=0x0;_0x490023<_0xf209c9[_0xd8e0('0x5e')];_0x490023++){if(_0x2fb9f5!=''){_0x2fb9f5+='&';}_0x2fb9f5+=_0xf209c9[_0x490023]+'='+encodeURIComponent(_0x29b3f0[_0xf209c9[_0x490023]]);_0x53c7b3+=_0x29b3f0[_0xf209c9[_0x490023]];}_0x53c7b3+=_0x4c5a84[_0xd8e0('0x58')];_0x53c7b3=_0x330a36[_0xd8e0('0x5f')](_0xd8e0('0x60'))['update'](_0x53c7b3)[_0xd8e0('0x61')]('hex');if(_0x2fb9f5!==''){_0x2fb9f5+='&';}_0x2fb9f5+=_0xd8e0('0x62')+_0x53c7b3;var _0x5ad25e={'method':'GET','uri':_0x4c5a84['baseUrl']+'/external/get/send.php?'+_0x2fb9f5,'json':!![]};return rp(_0x5ad25e)[_0xd8e0('0x16')](function(_0x12c723){var _0x2e4b95=Object[_0xd8e0('0x5c')](_0x12c723);if(_0x12c723[_0x2e4b95[0x0]][_0xd8e0('0x26')]&&parseInt(_0x12c723[_0x2e4b95[0x0]][_0xd8e0('0x26')])===0x0){var _0x2a8985={'messageId':_0x12c723[_0x2e4b95[0x0]][_0xd8e0('0x63')]};if(!_0x4c5a84[_0xd8e0('0x39')]){_0x2a8985[_0xd8e0('0x55')]=!![];}return _0x523ff7[_0xd8e0('0x3e')](_0x2a8985);}else{return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),'csc',util[_0xd8e0('0x29')](_0x12c723[_0xd8e0('0x26')],{'showHidden':![],'depth':null}));}})[_0xd8e0('0x17')](function(_0x1a8cd7){return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x56'),util[_0xd8e0('0x29')](_0x1a8cd7,{'showHidden':![],'depth':null}));});}else{logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x56'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x4c5a84['apiKey']){var _0x2a78e6={'method':_0xd8e0('0x35'),'uri':_0xd8e0('0x64'),'headers':{'Authorization':_0x4c5a84[_0xd8e0('0x58')]},'body':{'content':_0xa5f71b['body'],'to':[_0xa5f71b[_0xd8e0('0x21')]],'from':_0x4c5a84[_0xd8e0('0x21')],'binary':![],'clientMessageId':'uuid','charset':_0xd8e0('0x65')},'json':!![]};rp(_0x2a78e6)['then'](function(_0x5552de){if(!_0x5552de[_0xd8e0('0x26')]){var _0x163ad8={'messageId':_0x5552de[_0xd8e0('0x1f')][0x0][_0xd8e0('0x66')]};if(!_0x4c5a84[_0xd8e0('0x39')]){_0x163ad8[_0xd8e0('0x55')]=!![];}return _0x523ff7[_0xd8e0('0x3e')](_0x163ad8);}else{return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x67'),util[_0xd8e0('0x29')](_0x5552de[_0xd8e0('0x26')],{'showHidden':![],'depth':null}));}})[_0xd8e0('0x17')](function(_0x43f023){return logger[_0xd8e0('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd8e0('0x28'),_0xd8e0('0x67'),util[_0xd8e0('0x29')](_0x43f023,{'showHidden':![],'depth':null}));});}else{logger[_0xd8e0('0x26')](_0xd8e0('0x27'),'afterCreate',_0xd8e0('0x67'),_0xd8e0('0x68'));}break;case _0xd8e0('0x69'):if(_0x4c5a84[_0xd8e0('0x2c')]&&_0x4c5a84['password']){var _0x5ba9a4=util[_0xd8e0('0x43')]('%s:%s',_0x4c5a84[_0xd8e0('0x2c')],_0x4c5a84[_0xd8e0('0x2d')]);var _0x54ead5={'method':_0xd8e0('0x35'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x4c5a84[_0xd8e0('0x6a')]+_0xd8e0('0x6b'),'body':{'to':[_0xa5f71b[_0xd8e0('0x21')]],'text':_0xa5f71b[_0xd8e0('0x2e')],'from':_0x4c5a84[_0xd8e0('0x21')],'applicationId':_0x4c5a84['applicationId']},'headers':{'Authorization':util[_0xd8e0('0x43')](_0xd8e0('0x44'),new Buffer(_0x5ba9a4)[_0xd8e0('0x45')](_0xd8e0('0x4f')))},'json':!![]};rp(_0x54ead5)[_0xd8e0('0x16')](function(_0x157a60){if(_0x157a60['id']){var _0x5be6de={'messageId':_0x157a60['id']};return _0x523ff7[_0xd8e0('0x3e')](_0x5be6de);}else{logger['error'](_0xd8e0('0x27'),_0xd8e0('0x28'),'bandwidth',util[_0xd8e0('0x29')](_0x157a60,{'showHidden':![],'depth':null}));}})[_0xd8e0('0x17')](function(_0x5afc20){logger[_0xd8e0('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd8e0('0x28'),_0xd8e0('0x69'),util[_0xd8e0('0x29')](_0x5afc20,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x69'),_0xd8e0('0x3a'));}break;case'intelepeer':if(_0x4c5a84['apiKey']){var _0x51e67f={};var _0x5ad25e={'method':_0xd8e0('0x35'),'uri':_0xd8e0('0x6c'),'headers':{'Authorization':_0xd8e0('0x6d')+_0x4c5a84[_0xd8e0('0x58')],'Content-Type':'application/json'},'body':{'from':_0x4c5a84[_0xd8e0('0x21')],'to':_0xa5f71b[_0xd8e0('0x21')],'text':_0xa5f71b[_0xd8e0('0x2e')]},'json':!![]};return rp(_0x5ad25e)['then'](function(_0x103607){if(_0x103607['code']==0xca){_0x51e67f[_0xd8e0('0x6e')]=_0x103607;var _0x3e107a={'method':_0xd8e0('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xd8e0('0x6d')+_0x4c5a84[_0xd8e0('0x58')],'Content-Type':_0xd8e0('0x6f')},'body':{'refid':_0x51e67f[_0xd8e0('0x6e')][_0xd8e0('0x70')]},'json':!![]};return rp(_0x3e107a)[_0xd8e0('0x16')](function(_0x3d9ad7){_0x51e67f[_0xd8e0('0x71')]=_0x3d9ad7;var _0x5adcbc={'messageId':_0x51e67f[_0xd8e0('0x6e')]['refid'],'read':!![]};return _0x523ff7[_0xd8e0('0x3e')](_0x5adcbc);});}else{return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),'afterCreate',_0xd8e0('0x72'),util[_0xd8e0('0x29')](_0x103607,{'showHidden':![],'depth':null}));}})['catch'](function(_0x23a2e9){return logger[_0xd8e0('0x26')](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x72'),util[_0xd8e0('0x29')](_0x23a2e9,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xd8e0('0x27'),_0xd8e0('0x28'),_0xd8e0('0x72'),_0xd8e0('0x73'));}break;}}})[_0xd8e0('0x74')](function(){_0x225092();});}else{_0x225092();}}},'charset':'utf8mb4','collate':_0xd8e0('0x75')});};
\ No newline at end of file