Built motion from commit 639a1a7f.|2.6.19
[motion2.git] / server / api / smsMessage / smsMessage.model.js
index 62f859e..c69ef0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcb7=['id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','accountId','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','findOne','then','createdAt','catch','error','find','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','remote','/status?token=','token','update','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','&password=','password','split','sms','POST','user_key','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','authId','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','csc','crypto','login','text','keys','sort','length','apiKey','createHash','md5','digest','GET','/external/get/send.php?'];(function(_0x1b708d,_0x549f08){var _0x45d59b=function(_0x2e1c73){while(--_0x2e1c73){_0x1b708d['push'](_0x1b708d['shift']());}};_0x45d59b(++_0x549f08);}(_0xfcb7,0x8f));var _0x7fcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfcb7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7fcb('0x0'));var util=require('util');var logger=require(_0x7fcb('0x1'))(_0x7fcb('0x2'));var moment=require('moment');var BPromise=require(_0x7fcb('0x3'));var rp=require(_0x7fcb('0x4'));var fs=require('fs');var path=require(_0x7fcb('0x5'));var rimraf=require(_0x7fcb('0x6'));var config=require(_0x7fcb('0x7'));var attributes=require(_0x7fcb('0x8'));module['exports']=function(_0x1906ee,_0x50c9f6){return _0x1906ee[_0x7fcb('0x9')](_0x7fcb('0xa'),attributes,{'tableName':_0x7fcb('0xb'),'paranoid':![],'indexes':[{'name':_0x7fcb('0xc'),'fields':[_0x7fcb('0xc')]},{'name':_0x7fcb('0xd'),'fields':[_0x7fcb('0xe')],'type':_0x7fcb('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x15d2ac,_0x423756,_0x8566e5){var _0x554460=_0x1906ee[_0x7fcb('0x10')];var _0x38543d=_0x15d2ac[_0x7fcb('0x11')]({'plain':!![]});if(_0x38543d[_0x7fcb('0x12')][_0x7fcb('0x13')]()==='in'||_0x38543d[_0x7fcb('0x12')]['toLowerCase']()===_0x7fcb('0x14')&&!_0x38543d[_0x7fcb('0x15')]&&!_[_0x7fcb('0x16')](_0x38543d[_0x7fcb('0x17')])&&!_['isNil'](_0x38543d[_0x7fcb('0x18')])){_0x554460['SmsInteraction'][_0x7fcb('0x19')]({'where':{'id':_0x38543d[_0x7fcb('0x18')]}})[_0x7fcb('0x1a')](function(_0x2eb7e6){if(_0x2eb7e6){_0x2eb7e6['update']({'lastMsgAt':_0x38543d[_0x7fcb('0x1b')],'lastMsgDirection':_0x38543d[_0x7fcb('0x12')][_0x7fcb('0x13')]()});}})[_0x7fcb('0x1c')](function(_0x3586be){console[_0x7fcb('0x1d')](_0x3586be);});}if(_0x38543d[_0x7fcb('0x12')]===_0x7fcb('0x14')&&!_0x38543d[_0x7fcb('0x15')]){var _0x9c86d3;_0x554460['SmsAccount'][_0x7fcb('0x1e')]({'where':{'id':_0x38543d[_0x7fcb('0x1f')]},'raw':!![]})[_0x7fcb('0x1a')](function(_0x502a26){_0x9c86d3=_0x502a26;if(_0x9c86d3&&_0x9c86d3[_0x7fcb('0x20')]){switch(_0x9c86d3[_0x7fcb('0x20')]){case'twilio':var _0x16f4c9=require(_0x7fcb('0x21'));if(_0x9c86d3['accountSid']&&_0x9c86d3[_0x7fcb('0x22')]&&_0x9c86d3[_0x7fcb('0x23')]){var _0x5207a4=new _0x16f4c9(_0x9c86d3[_0x7fcb('0x24')],_0x9c86d3[_0x7fcb('0x22')]);_0x5207a4[_0x7fcb('0x25')][_0x7fcb('0x26')]({'body':_0x38543d[_0x7fcb('0xe')],'to':_0x38543d[_0x7fcb('0x23')],'from':_0x9c86d3[_0x7fcb('0x23')],'statusCallback':_0x9c86d3[_0x7fcb('0x27')]+'/api/sms/messages/'+_0x38543d['id']+_0x7fcb('0x28')+_0x9c86d3[_0x7fcb('0x29')]})[_0x7fcb('0x1a')](function(_0x2e39ec){if(_0x2e39ec['sid']){return _0x15d2ac[_0x7fcb('0x2a')]({'messageId':_0x2e39ec['sid']});}})[_0x7fcb('0x1c')](function(_0x282d4f){logger[_0x7fcb('0x1d')](_0x7fcb('0x2b'),'afterCreate',_0x7fcb('0x21'),util[_0x7fcb('0x2c')](_0x282d4f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7fcb('0x2b'),_0x7fcb('0x2d'),_0x7fcb('0x21'),_0x7fcb('0x2e'));}break;case _0x7fcb('0x2f'):var _0x3c1bd4=_0x7fcb('0x30');if(_0x9c86d3[_0x7fcb('0x31')]&&_0x9c86d3['password']){var _0x469820={'recipient':[_0x38543d[_0x7fcb('0x23')]],'message':_0x38543d[_0x7fcb('0xe')],'message_type':_0x9c86d3[_0x7fcb('0x32')]};if(_0x9c86d3[_0x7fcb('0x32')]&&_0x9c86d3[_0x7fcb('0x32')]!=='SI'){_0x469820[_0x7fcb('0x33')]=_0x9c86d3[_0x7fcb('0x23')];}var _0xdb2662={'url':_0x3c1bd4+_0x7fcb('0x34')+_0x9c86d3[_0x7fcb('0x31')]+_0x7fcb('0x35')+_0x9c86d3[_0x7fcb('0x36')],'method':'GET'};rp(_0xdb2662)[_0x7fcb('0x1a')](function(_0x3e17cc){var _0x15d99a=_0x3e17cc[_0x7fcb('0x37')](';');var _0x578794={'user_key':_0x15d99a[0x0],'session_key':_0x15d99a[0x1]};_0xdb2662={'url':_0x3c1bd4+_0x7fcb('0x38'),'method':_0x7fcb('0x39'),'headers':{'user_key':_0x578794[_0x7fcb('0x3a')],'Session_key':_0x578794['session_key']},'json':!![],'body':_0x469820};return rp(_0xdb2662);})['then'](function(_0x4e88d1){if(_0x4e88d1['total_sent']>=0x1){var _0x3cc7cc={'messageId':_0x4e88d1['internal_order_id']};if(_0x9c86d3[_0x7fcb('0x32')]!=='GP'||!_0x9c86d3['deliveryReport']){_0x3cc7cc[_0x7fcb('0x3b')]=!![];}return _0x15d2ac[_0x7fcb('0x2a')](_0x3cc7cc);}else{return logger[_0x7fcb('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7fcb('0x2d'),_0x7fcb('0x2f'),util[_0x7fcb('0x2c')](_0x4e88d1,{'showHidden':![],'depth':null}));}})[_0x7fcb('0x1c')](function(_0x4cfdbf){return logger[_0x7fcb('0x1d')](_0x7fcb('0x2b'),_0x7fcb('0x2d'),_0x7fcb('0x2f'),util[_0x7fcb('0x2c')](_0x4cfdbf,{'showHidden':![],'depth':null}));});}else{logger[_0x7fcb('0x1d')](_0x7fcb('0x2b'),'afterCreate',_0x7fcb('0x2f'),_0x7fcb('0x3c'));}break;case _0x7fcb('0x3d'):if(_0x9c86d3[_0x7fcb('0x22')]){var _0x5b5a16={'recipient':_0x38543d['phone'],'message':_0x38543d[_0x7fcb('0xe')],'sender':_0x9c86d3[_0x7fcb('0x3e')]||_0x9c86d3['phone'],'authorization':_0x9c86d3[_0x7fcb('0x22')]};var _0x423756={'method':_0x7fcb('0x39'),'uri':_0x7fcb('0x3f'),'body':_0x5b5a16,'json':!![]};rp(_0x423756)[_0x7fcb('0x1a')](function(_0x1423db){var _0x11cec9={'messageId':_0x1423db[_0x7fcb('0x40')]};if(!_0x9c86d3[_0x7fcb('0x41')]){_0x11cec9[_0x7fcb('0x3b')]=!![];}return _0x15d2ac['update'](_0x11cec9);})[_0x7fcb('0x1c')](function(_0x1e0d65){logger['error'](_0x7fcb('0x2b'),_0x7fcb('0x2d'),_0x7fcb('0x3d'),util[_0x7fcb('0x2c')](_0x1e0d65,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7fcb('0x2b'),_0x7fcb('0x2d'),'connectel',_0x7fcb('0x42'));}break;case _0x7fcb('0x43'):if(_0x9c86d3[_0x7fcb('0x31')]&&_0x9c86d3[_0x7fcb('0x36')]){var _0x5b5a16={'messages':[{'source':_0x7fcb('0x44'),'to':_0x38543d[_0x7fcb('0x23')],'body':_0x38543d[_0x7fcb('0xe')],'from':_0x9c86d3['senderString']||_0x9c86d3[_0x7fcb('0x23')]}]};var _0xa848cc=util['format']('%s:%s',_0x9c86d3[_0x7fcb('0x31')],_0x9c86d3[_0x7fcb('0x36')]);var _0x423756={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x5b5a16,'headers':{'Authorization':util[_0x7fcb('0x45')](_0x7fcb('0x46'),new Buffer(_0xa848cc)[_0x7fcb('0x47')](_0x7fcb('0x48')))},'json':!![]};rp(_0x423756)[_0x7fcb('0x1a')](function(_0x526b8e){if(_0x526b8e['http_code']>=0xc8&&_0x526b8e[_0x7fcb('0x49')]<=0xce){if(_0x526b8e[_0x7fcb('0x4a')]&&_0x526b8e[_0x7fcb('0x4a')][_0x7fcb('0x4b')]>0x0){var _0x4570b2=_[_0x7fcb('0x4c')](_0x526b8e[_0x7fcb('0x4a')]['messages']);var _0x1cf5d4={'messageId':_0x4570b2[_0x7fcb('0x4d')]};if(!_0x9c86d3['deliveryReport']){_0x1cf5d4[_0x7fcb('0x3b')]=!![];}return _0x15d2ac[_0x7fcb('0x2a')](_0x1cf5d4);}else{logger['error'](_0x7fcb('0x2b'),'afterCreate',_0x7fcb('0x4e'),util[_0x7fcb('0x2c')](_0x526b8e,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x7fcb('0x2b'),_0x7fcb('0x2d'),_0x7fcb('0x4e'),util['inspect'](_0x526b8e,{'showHidden':![],'depth':null}));}})[_0x7fcb('0x1c')](function(_0x58e047){logger[_0x7fcb('0x1d')](_0x7fcb('0x2b'),_0x7fcb('0x2d'),'clickSend',util[_0x7fcb('0x2c')](_0x58e047,{'showHidden':![],'depth':null}));});}else{logger[_0x7fcb('0x1d')](_0x7fcb('0x2b'),_0x7fcb('0x2d'),_0x7fcb('0x4e'),_0x7fcb('0x3c'));}break;case'plivo':if(_0x9c86d3[_0x7fcb('0x4f')]&&_0x9c86d3['authToken']){var _0x5b5a16={'dst':_0x38543d[_0x7fcb('0x23')],'text':_0x38543d[_0x7fcb('0xe')],'src':_0x9c86d3['senderString']||_0x9c86d3['phone'],'url':_0x9c86d3[_0x7fcb('0x27')]+_0x7fcb('0x50')+_0x38543d['id']+_0x7fcb('0x28')+_0x9c86d3[_0x7fcb('0x29')]};var _0xa848cc=util[_0x7fcb('0x45')]('%s:%s',_0x9c86d3[_0x7fcb('0x4f')],_0x9c86d3['authToken']);var _0x423756={'method':_0x7fcb('0x39'),'uri':util['format'](_0x7fcb('0x51'),_0x9c86d3['authId']),'body':_0x5b5a16,'headers':{'Authorization':util['format'](_0x7fcb('0x46'),new Buffer(_0xa848cc)[_0x7fcb('0x47')](_0x7fcb('0x48')))},'json':!![]};rp(_0x423756)['then'](function(_0xd05d9){var _0x1a7557={'messageId':_0xd05d9[_0x7fcb('0x52')][0x0]};return _0x15d2ac['update'](_0x1a7557);})['catch'](function(_0x2ee5ae){logger['error'](_0x7fcb('0x2b'),_0x7fcb('0x2d'),_0x7fcb('0x53'),util[_0x7fcb('0x2c')](_0x2ee5ae,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7fcb('0x2b'),_0x7fcb('0x2d'),'plivo',_0x7fcb('0x54'));}break;case _0x7fcb('0x55'):if(_0x9c86d3[_0x7fcb('0x31')]&&_0x9c86d3[_0x7fcb('0x36')]){if(_0x9c86d3['baseUrl']){var _0x59eaf6={'method':_0x7fcb('0x39'),'uri':_0x9c86d3[_0x7fcb('0x56')]+_0x7fcb('0x57'),'body':{'username':_0x9c86d3['username'],'password':_0x9c86d3['password']},'json':!![]};return rp(_0x59eaf6)['then'](function(_0x480c1c){var _0x42bb30={'method':'POST','uri':_0x9c86d3[_0x7fcb('0x56')]+_0x7fcb('0x58'),'body':{'messages':[{'from':_0x9c86d3[_0x7fcb('0x23')],'destinations':[{'to':_0x38543d[_0x7fcb('0x23')]}],'text':_0x38543d['body'],'notifyUrl':_0x9c86d3['remote']+'/api/sms/messages/'+_0x38543d['id']+_0x7fcb('0x28')+_0x9c86d3[_0x7fcb('0x29')],'notifyContentType':_0x7fcb('0x59'),'callbackData':_0x9c86d3[_0x7fcb('0x23')]+';'+_0x38543d[_0x7fcb('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x480c1c['token']},'json':!![]};return rp(_0x42bb30)[_0x7fcb('0x1a')](function(_0x5825b1){if(_0x5825b1[_0x7fcb('0x25')]){var _0x2c9421={'messageId':_0x5825b1[_0x7fcb('0x25')][0x0][_0x7fcb('0xc')]};if(!_0x9c86d3[_0x7fcb('0x41')]){_0x2c9421['read']=!![];}return _0x15d2ac[_0x7fcb('0x2a')](_0x2c9421);}else{return logger[_0x7fcb('0x1d')](_0x7fcb('0x2b'),_0x7fcb('0x2d'),_0x7fcb('0x55'),util['inspect'](_0x5825b1,{'showHidden':![],'depth':null}));}});})[_0x7fcb('0x1c')](function(_0x4397e0){return logger[_0x7fcb('0x1d')](_0x7fcb('0x2b'),_0x7fcb('0x2d'),_0x7fcb('0x55'),util['inspect'](_0x4397e0,{'showHidden':![],'depth':null}));});}else{logger[_0x7fcb('0x1d')](_0x7fcb('0x2b'),_0x7fcb('0x2d'),_0x7fcb('0x55'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x7fcb('0x1d')](_0x7fcb('0x2b'),_0x7fcb('0x2d'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case _0x7fcb('0x5a'):var _0x59dfe2=require(_0x7fcb('0x5b'));if(_0x9c86d3['apiKey']){var _0x2588fc={};_0x2588fc[_0x7fcb('0x5c')]=_0x9c86d3[_0x7fcb('0x31')];_0x2588fc[_0x7fcb('0x23')]=_0x38543d[_0x7fcb('0x23')];_0x2588fc[_0x7fcb('0x33')]=_0x9c86d3[_0x7fcb('0x23')];_0x2588fc[_0x7fcb('0x5d')]=_0x38543d['body'];_0x2588fc['timestamp']=+new Date();var _0x26c711='';var _0x4c1234='';var _0x11382b=Object[_0x7fcb('0x5e')](_0x2588fc);_0x11382b[_0x7fcb('0x5f')]();for(var _0x3a13e7=0x0;_0x3a13e7<_0x11382b[_0x7fcb('0x60')];_0x3a13e7++){if(_0x26c711!=''){_0x26c711+='&';}_0x26c711+=_0x11382b[_0x3a13e7]+'='+encodeURIComponent(_0x2588fc[_0x11382b[_0x3a13e7]]);_0x4c1234+=_0x2588fc[_0x11382b[_0x3a13e7]];}_0x4c1234+=_0x9c86d3[_0x7fcb('0x61')];_0x4c1234=_0x59dfe2[_0x7fcb('0x62')](_0x7fcb('0x63'))[_0x7fcb('0x2a')](_0x4c1234)[_0x7fcb('0x64')]('hex');if(_0x26c711!==''){_0x26c711+='&';}_0x26c711+='signature='+_0x4c1234;var _0xdb2662={'method':_0x7fcb('0x65'),'uri':_0x9c86d3[_0x7fcb('0x56')]+_0x7fcb('0x66')+_0x26c711,'json':!![]};return rp(_0xdb2662)[_0x7fcb('0x1a')](function(_0x54d714){var _0x5acbee=Object[_0x7fcb('0x5e')](_0x54d714);if(_0x54d714[_0x5acbee[0x0]][_0x7fcb('0x1d')]&&parseInt(_0x54d714[_0x5acbee[0x0]][_0x7fcb('0x1d')])===0x0){var _0x13f026={'messageId':_0x54d714[_0x5acbee[0x0]][_0x7fcb('0x67')]};if(!_0x9c86d3[_0x7fcb('0x41')]){_0x13f026[_0x7fcb('0x3b')]=!![];}return _0x15d2ac[_0x7fcb('0x2a')](_0x13f026);}else{return logger[_0x7fcb('0x1d')](_0x7fcb('0x2b'),_0x7fcb('0x2d'),_0x7fcb('0x5a'),util[_0x7fcb('0x2c')](_0x54d714['error'],{'showHidden':![],'depth':null}));}})[_0x7fcb('0x1c')](function(_0x41f5fb){return logger[_0x7fcb('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7fcb('0x2d'),'csc',util[_0x7fcb('0x2c')](_0x41f5fb,{'showHidden':![],'depth':null}));});}else{logger[_0x7fcb('0x1d')](_0x7fcb('0x2b'),_0x7fcb('0x2d'),'csc',_0x7fcb('0x68'));}break;case _0x7fcb('0x69'):if(_0x9c86d3[_0x7fcb('0x61')]){var _0x31533d={'method':_0x7fcb('0x39'),'uri':_0x7fcb('0x6a'),'headers':{'Authorization':_0x9c86d3[_0x7fcb('0x61')]},'body':{'content':_0x38543d[_0x7fcb('0xe')],'to':[_0x38543d[_0x7fcb('0x23')]],'from':_0x9c86d3[_0x7fcb('0x23')],'binary':![],'clientMessageId':_0x7fcb('0x6b'),'charset':_0x7fcb('0x6c')},'json':!![]};rp(_0x31533d)[_0x7fcb('0x1a')](function(_0x20979f){if(!_0x20979f['error']){var _0x5900ec={'messageId':_0x20979f['messages'][0x0]['apiMessageId']};if(!_0x9c86d3[_0x7fcb('0x41')]){_0x5900ec[_0x7fcb('0x3b')]=!![];}return _0x15d2ac['update'](_0x5900ec);}else{return logger[_0x7fcb('0x1d')](_0x7fcb('0x2b'),_0x7fcb('0x2d'),_0x7fcb('0x69'),util[_0x7fcb('0x2c')](_0x20979f[_0x7fcb('0x1d')],{'showHidden':![],'depth':null}));}})[_0x7fcb('0x1c')](function(_0x405d89){return logger[_0x7fcb('0x1d')](_0x7fcb('0x2b'),'afterCreate','clickatell',util[_0x7fcb('0x2c')](_0x405d89,{'showHidden':![],'depth':null}));});}else{logger[_0x7fcb('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7fcb('0x2d'),'clickatell','Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x9c86d3[_0x7fcb('0x31')]&&_0x9c86d3[_0x7fcb('0x36')]){var _0xa848cc=util['format']('%s:%s',_0x9c86d3[_0x7fcb('0x31')],_0x9c86d3[_0x7fcb('0x36')]);var _0x423756={'method':_0x7fcb('0x39'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x9c86d3[_0x7fcb('0x6d')]+_0x7fcb('0x6e'),'body':{'to':[_0x38543d[_0x7fcb('0x23')]],'text':_0x38543d[_0x7fcb('0xe')],'from':_0x9c86d3[_0x7fcb('0x23')],'applicationId':_0x9c86d3[_0x7fcb('0x6f')]},'headers':{'Authorization':util['format'](_0x7fcb('0x46'),new Buffer(_0xa848cc)[_0x7fcb('0x47')](_0x7fcb('0x48')))},'json':!![]};rp(_0x423756)[_0x7fcb('0x1a')](function(_0x56debc){if(_0x56debc['id']){var _0x25a73c={'messageId':_0x56debc['id']};return _0x15d2ac[_0x7fcb('0x2a')](_0x25a73c);}else{logger['error'](_0x7fcb('0x2b'),_0x7fcb('0x2d'),'bandwidth',util[_0x7fcb('0x2c')](_0x56debc,{'showHidden':![],'depth':null}));}})[_0x7fcb('0x1c')](function(_0x285dfb){logger[_0x7fcb('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7fcb('0x2d'),_0x7fcb('0x70'),util[_0x7fcb('0x2c')](_0x285dfb,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7fcb('0x2d'),'bandwidth',_0x7fcb('0x3c'));}break;case _0x7fcb('0x71'):if(_0x9c86d3[_0x7fcb('0x61')]){var _0x5db4ce={};var _0xdb2662={'method':_0x7fcb('0x39'),'uri':_0x7fcb('0x72'),'headers':{'Authorization':_0x7fcb('0x73')+_0x9c86d3[_0x7fcb('0x61')],'Content-Type':'application/json'},'body':{'from':_0x9c86d3[_0x7fcb('0x23')],'to':_0x38543d[_0x7fcb('0x23')],'text':_0x38543d['body']},'json':!![]};return rp(_0xdb2662)[_0x7fcb('0x1a')](function(_0x1adb51){if(_0x1adb51[_0x7fcb('0x74')]==0xca){_0x5db4ce[_0x7fcb('0x75')]=_0x1adb51;var _0x3a7702={'method':_0x7fcb('0x39'),'uri':_0x7fcb('0x76'),'headers':{'Authorization':'Bearer\x20'+_0x9c86d3['apiKey'],'Content-Type':_0x7fcb('0x59')},'body':{'refid':_0x5db4ce[_0x7fcb('0x75')][_0x7fcb('0x77')]},'json':!![]};return rp(_0x3a7702)[_0x7fcb('0x1a')](function(_0x3c03e3){_0x5db4ce['status']=_0x3c03e3;var _0x12508a={'messageId':_0x5db4ce[_0x7fcb('0x75')][_0x7fcb('0x77')],'read':!![]};return _0x15d2ac[_0x7fcb('0x2a')](_0x12508a);});}else{return logger[_0x7fcb('0x1d')](_0x7fcb('0x2b'),_0x7fcb('0x2d'),_0x7fcb('0x71'),util[_0x7fcb('0x2c')](_0x1adb51,{'showHidden':![],'depth':null}));}})[_0x7fcb('0x1c')](function(_0x3a5c9b){return logger['error'](_0x7fcb('0x2b'),'afterCreate',_0x7fcb('0x71'),util[_0x7fcb('0x2c')](_0x3a5c9b,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x7fcb('0x2b'),_0x7fcb('0x2d'),'intelepeer','Token\x20not\x20received');}break;}}})[_0x7fcb('0x78')](function(){_0x8566e5();});}else{_0x8566e5();}}},'charset':_0x7fcb('0x79'),'collate':_0x7fcb('0x7a')});};
\ No newline at end of file
+var _0x27b0=['requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','clickSend','Missing\x20parameters:\x20username,\x20password','https://api.plivo.com/v1/Account/%s/Message/','authId','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','login','text','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','messageId','body','FULLTEXT','get','toLowerCase','direction','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','SmsAccount','find','SmsAccountId','type','authToken','phone','accountSid','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','GET','split','sms','user_key','session_key','internal_order_id','deliveryReport','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/'];(function(_0x4653d4,_0x17c5c1){var _0x55e8b6=function(_0x46dbe4){while(--_0x46dbe4){_0x4653d4['push'](_0x4653d4['shift']());}};_0x55e8b6(++_0x17c5c1);}(_0x27b0,0x139));var _0x027b=function(_0x55c00d,_0x520cb6){_0x55c00d=_0x55c00d-0x0;var _0x254a8f=_0x27b0[_0x55c00d];return _0x254a8f;};'use strict';var _=require('lodash');var util=require(_0x027b('0x0'));var logger=require(_0x027b('0x1'))('api');var moment=require(_0x027b('0x2'));var BPromise=require(_0x027b('0x3'));var rp=require(_0x027b('0x4'));var fs=require('fs');var path=require(_0x027b('0x5'));var rimraf=require(_0x027b('0x6'));var config=require(_0x027b('0x7'));var attributes=require(_0x027b('0x8'));module['exports']=function(_0x534539,_0x40ece1){return _0x534539[_0x027b('0x9')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x027b('0xa'),'fields':[_0x027b('0xa')]},{'name':'fti_sms_messages','fields':[_0x027b('0xb')],'type':_0x027b('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x314078,_0x166b15,_0x2ef243){var _0x31f831=_0x534539['models'];var _0x151211=_0x314078[_0x027b('0xd')]({'plain':!![]});if(_0x151211['direction'][_0x027b('0xe')]()==='in'||_0x151211[_0x027b('0xf')]['toLowerCase']()===_0x027b('0x10')&&!_0x151211[_0x027b('0x11')]&&!_[_0x027b('0x12')](_0x151211[_0x027b('0x13')])&&!_['isNil'](_0x151211[_0x027b('0x14')])){_0x31f831[_0x027b('0x15')][_0x027b('0x16')]({'where':{'id':_0x151211[_0x027b('0x14')]}})[_0x027b('0x17')](function(_0x188f67){if(_0x188f67){_0x188f67[_0x027b('0x18')]({'lastMsgAt':_0x151211[_0x027b('0x19')],'lastMsgDirection':_0x151211[_0x027b('0xf')]['toLowerCase']()});}})[_0x027b('0x1a')](function(_0x1e0611){console['error'](_0x1e0611);});}if(_0x151211['direction']===_0x027b('0x10')&&!_0x151211[_0x027b('0x11')]){var _0xf61891;_0x31f831[_0x027b('0x1b')][_0x027b('0x1c')]({'where':{'id':_0x151211[_0x027b('0x1d')]},'raw':!![]})[_0x027b('0x17')](function(_0x243063){_0xf61891=_0x243063;if(_0xf61891&&_0xf61891[_0x027b('0x1e')]){switch(_0xf61891[_0x027b('0x1e')]){case'twilio':var _0x532af5=require('twilio');if(_0xf61891['accountSid']&&_0xf61891[_0x027b('0x1f')]&&_0xf61891[_0x027b('0x20')]){var _0x30ff47=new _0x532af5(_0xf61891[_0x027b('0x21')],_0xf61891[_0x027b('0x1f')]);_0x30ff47[_0x027b('0x22')][_0x027b('0x23')]({'body':_0x151211[_0x027b('0xb')],'to':_0x151211['phone'],'from':_0xf61891[_0x027b('0x20')],'statusCallback':_0xf61891[_0x027b('0x24')]+_0x027b('0x25')+_0x151211['id']+_0x027b('0x26')+_0xf61891[_0x027b('0x27')]})['then'](function(_0x3b2bfe){if(_0x3b2bfe['sid']){return _0x314078[_0x027b('0x18')]({'messageId':_0x3b2bfe[_0x027b('0x28')]});}})[_0x027b('0x1a')](function(_0x4619d1){logger['error'](_0x027b('0x29'),_0x027b('0x2a'),_0x027b('0x2b'),util[_0x027b('0x2c')](_0x4619d1,{'showHidden':![],'depth':null}));});}else{logger[_0x027b('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x027b('0x2a'),_0x027b('0x2b'),_0x027b('0x2e'));}break;case _0x027b('0x2f'):var _0x337377=_0x027b('0x30');if(_0xf61891[_0x027b('0x31')]&&_0xf61891[_0x027b('0x32')]){var _0x3cda99={'recipient':[_0x151211['phone']],'message':_0x151211[_0x027b('0xb')],'message_type':_0xf61891[_0x027b('0x33')]};if(_0xf61891[_0x027b('0x33')]&&_0xf61891[_0x027b('0x33')]!=='SI'){_0x3cda99[_0x027b('0x34')]=_0xf61891[_0x027b('0x20')];}var _0x41193a={'url':_0x337377+'login?username='+_0xf61891['username']+_0x027b('0x35')+_0xf61891[_0x027b('0x32')],'method':_0x027b('0x36')};rp(_0x41193a)[_0x027b('0x17')](function(_0x53ac9c){var _0xcc10e5=_0x53ac9c[_0x027b('0x37')](';');var _0x2e7217={'user_key':_0xcc10e5[0x0],'session_key':_0xcc10e5[0x1]};_0x41193a={'url':_0x337377+_0x027b('0x38'),'method':'POST','headers':{'user_key':_0x2e7217[_0x027b('0x39')],'Session_key':_0x2e7217[_0x027b('0x3a')]},'json':!![],'body':_0x3cda99};return rp(_0x41193a);})[_0x027b('0x17')](function(_0x485881){if(_0x485881['total_sent']>=0x1){var _0x1a0198={'messageId':_0x485881[_0x027b('0x3b')]};if(_0xf61891[_0x027b('0x33')]!=='GP'||!_0xf61891[_0x027b('0x3c')]){_0x1a0198['read']=!![];}return _0x314078[_0x027b('0x18')](_0x1a0198);}else{return logger['error'](_0x027b('0x29'),'afterCreate',_0x027b('0x2f'),util[_0x027b('0x2c')](_0x485881,{'showHidden':![],'depth':null}));}})[_0x027b('0x1a')](function(_0x14b12c){return logger[_0x027b('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x027b('0x2a'),'skebby',util[_0x027b('0x2c')](_0x14b12c,{'showHidden':![],'depth':null}));});}else{logger[_0x027b('0x2d')](_0x027b('0x29'),_0x027b('0x2a'),_0x027b('0x2f'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x027b('0x3d'):if(_0xf61891[_0x027b('0x1f')]){var _0x7fde28={'recipient':_0x151211['phone'],'message':_0x151211[_0x027b('0xb')],'sender':_0xf61891[_0x027b('0x3e')]||_0xf61891[_0x027b('0x20')],'authorization':_0xf61891[_0x027b('0x1f')]};var _0x166b15={'method':_0x027b('0x3f'),'uri':_0x027b('0x40'),'body':_0x7fde28,'json':!![]};rp(_0x166b15)[_0x027b('0x17')](function(_0x1ae731){var _0x37f713={'messageId':_0x1ae731[_0x027b('0x41')]};if(!_0xf61891['deliveryReport']){_0x37f713[_0x027b('0x42')]=!![];}return _0x314078[_0x027b('0x18')](_0x37f713);})[_0x027b('0x1a')](function(_0x2e8d27){logger[_0x027b('0x2d')](_0x027b('0x29'),_0x027b('0x2a'),_0x027b('0x3d'),util[_0x027b('0x2c')](_0x2e8d27,{'showHidden':![],'depth':null}));});}else{logger[_0x027b('0x2d')](_0x027b('0x29'),'afterCreate',_0x027b('0x3d'),_0x027b('0x43'));}break;case _0x027b('0x44'):if(_0xf61891['username']&&_0xf61891['password']){var _0x7fde28={'messages':[{'source':_0x027b('0x45'),'to':_0x151211[_0x027b('0x20')],'body':_0x151211['body'],'from':_0xf61891[_0x027b('0x3e')]||_0xf61891[_0x027b('0x20')]}]};var _0x13c391=util[_0x027b('0x46')](_0x027b('0x47'),_0xf61891['username'],_0xf61891[_0x027b('0x32')]);var _0x166b15={'method':_0x027b('0x3f'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x7fde28,'headers':{'Authorization':util[_0x027b('0x46')](_0x027b('0x48'),new Buffer(_0x13c391)[_0x027b('0x49')](_0x027b('0x4a')))},'json':!![]};rp(_0x166b15)[_0x027b('0x17')](function(_0x5cc6ce){if(_0x5cc6ce[_0x027b('0x4b')]>=0xc8&&_0x5cc6ce[_0x027b('0x4b')]<=0xce){if(_0x5cc6ce[_0x027b('0x4c')]&&_0x5cc6ce[_0x027b('0x4c')][_0x027b('0x4d')]>0x0){var _0x17aa81=_['head'](_0x5cc6ce['data'][_0x027b('0x22')]);var _0x43055e={'messageId':_0x17aa81['message_id']};if(!_0xf61891[_0x027b('0x3c')]){_0x43055e['read']=!![];}return _0x314078[_0x027b('0x18')](_0x43055e);}else{logger[_0x027b('0x2d')](_0x027b('0x29'),_0x027b('0x2a'),_0x027b('0x4e'),util[_0x027b('0x2c')](_0x5cc6ce,{'showHidden':![],'depth':null}));}}else{logger[_0x027b('0x2d')](_0x027b('0x29'),_0x027b('0x2a'),_0x027b('0x4e'),util[_0x027b('0x2c')](_0x5cc6ce,{'showHidden':![],'depth':null}));}})[_0x027b('0x1a')](function(_0x80026a){logger[_0x027b('0x2d')](_0x027b('0x29'),'afterCreate',_0x027b('0x4e'),util[_0x027b('0x2c')](_0x80026a,{'showHidden':![],'depth':null}));});}else{logger[_0x027b('0x2d')](_0x027b('0x29'),'afterCreate','clickSend',_0x027b('0x4f'));}break;case'plivo':if(_0xf61891['authId']&&_0xf61891[_0x027b('0x1f')]){var _0x7fde28={'dst':_0x151211['phone'],'text':_0x151211['body'],'src':_0xf61891['senderString']||_0xf61891[_0x027b('0x20')],'url':_0xf61891[_0x027b('0x24')]+_0x027b('0x25')+_0x151211['id']+_0x027b('0x26')+_0xf61891['token']};var _0x13c391=util[_0x027b('0x46')](_0x027b('0x47'),_0xf61891['authId'],_0xf61891[_0x027b('0x1f')]);var _0x166b15={'method':'POST','uri':util[_0x027b('0x46')](_0x027b('0x50'),_0xf61891[_0x027b('0x51')]),'body':_0x7fde28,'headers':{'Authorization':util[_0x027b('0x46')](_0x027b('0x48'),new Buffer(_0x13c391)[_0x027b('0x49')](_0x027b('0x4a')))},'json':!![]};rp(_0x166b15)[_0x027b('0x17')](function(_0x3ea56f){var _0xaedf69={'messageId':_0x3ea56f[_0x027b('0x52')][0x0]};return _0x314078['update'](_0xaedf69);})[_0x027b('0x1a')](function(_0x32b858){logger[_0x027b('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x027b('0x2a'),_0x027b('0x53'),util['inspect'](_0x32b858,{'showHidden':![],'depth':null}));});}else{logger[_0x027b('0x2d')](_0x027b('0x29'),_0x027b('0x2a'),_0x027b('0x53'),_0x027b('0x54'));}break;case _0x027b('0x55'):if(_0xf61891[_0x027b('0x31')]&&_0xf61891[_0x027b('0x32')]){if(_0xf61891[_0x027b('0x56')]){var _0x4b9319={'method':_0x027b('0x3f'),'uri':_0xf61891['baseUrl']+_0x027b('0x57'),'body':{'username':_0xf61891[_0x027b('0x31')],'password':_0xf61891['password']},'json':!![]};return rp(_0x4b9319)['then'](function(_0x3fedff){var _0x1e8e57={'method':_0x027b('0x3f'),'uri':_0xf61891['baseUrl']+_0x027b('0x58'),'body':{'messages':[{'from':_0xf61891[_0x027b('0x20')],'destinations':[{'to':_0x151211[_0x027b('0x20')]}],'text':_0x151211['body'],'notifyUrl':_0xf61891[_0x027b('0x24')]+_0x027b('0x25')+_0x151211['id']+_0x027b('0x26')+_0xf61891[_0x027b('0x27')],'notifyContentType':_0x027b('0x59'),'callbackData':_0xf61891[_0x027b('0x20')]+';'+_0x151211[_0x027b('0xb')]}]},'headers':{'Authorization':_0x027b('0x5a')+_0x3fedff[_0x027b('0x27')]},'json':!![]};return rp(_0x1e8e57)[_0x027b('0x17')](function(_0x24362b){if(_0x24362b[_0x027b('0x22')]){var _0x1f251a={'messageId':_0x24362b['messages'][0x0]['messageId']};if(!_0xf61891[_0x027b('0x3c')]){_0x1f251a['read']=!![];}return _0x314078[_0x027b('0x18')](_0x1f251a);}else{return logger['error'](_0x027b('0x29'),_0x027b('0x2a'),_0x027b('0x55'),util[_0x027b('0x2c')](_0x24362b,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2014dc){return logger[_0x027b('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x027b('0x2a'),_0x027b('0x55'),util[_0x027b('0x2c')](_0x2014dc,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x027b('0x2a'),'infobip',_0x027b('0x5b'));}}else{logger[_0x027b('0x2d')](_0x027b('0x29'),'afterCreate',_0x027b('0x55'),_0x027b('0x4f'));}break;case _0x027b('0x5c'):var _0x741002=require('crypto');if(_0xf61891['apiKey']){var _0x1cc950={};_0x1cc950[_0x027b('0x5d')]=_0xf61891['username'];_0x1cc950['phone']=_0x151211['phone'];_0x1cc950[_0x027b('0x34')]=_0xf61891[_0x027b('0x20')];_0x1cc950[_0x027b('0x5e')]=_0x151211[_0x027b('0xb')];_0x1cc950['timestamp']=+new Date();var _0x13a06d='';var _0x2603d7='';var _0x2d6c3b=Object[_0x027b('0x5f')](_0x1cc950);_0x2d6c3b[_0x027b('0x60')]();for(var _0x1da69b=0x0;_0x1da69b<_0x2d6c3b[_0x027b('0x61')];_0x1da69b++){if(_0x13a06d!=''){_0x13a06d+='&';}_0x13a06d+=_0x2d6c3b[_0x1da69b]+'='+encodeURIComponent(_0x1cc950[_0x2d6c3b[_0x1da69b]]);_0x2603d7+=_0x1cc950[_0x2d6c3b[_0x1da69b]];}_0x2603d7+=_0xf61891['apiKey'];_0x2603d7=_0x741002[_0x027b('0x62')](_0x027b('0x63'))[_0x027b('0x18')](_0x2603d7)[_0x027b('0x64')](_0x027b('0x65'));if(_0x13a06d!==''){_0x13a06d+='&';}_0x13a06d+=_0x027b('0x66')+_0x2603d7;var _0x41193a={'method':_0x027b('0x36'),'uri':_0xf61891['baseUrl']+_0x027b('0x67')+_0x13a06d,'json':!![]};return rp(_0x41193a)['then'](function(_0x50bcfa){var _0x40010b=Object[_0x027b('0x5f')](_0x50bcfa);if(_0x50bcfa[_0x40010b[0x0]]['error']&&parseInt(_0x50bcfa[_0x40010b[0x0]][_0x027b('0x2d')])===0x0){var _0x50ba98={'messageId':_0x50bcfa[_0x40010b[0x0]]['id_sms']};if(!_0xf61891[_0x027b('0x3c')]){_0x50ba98['read']=!![];}return _0x314078[_0x027b('0x18')](_0x50ba98);}else{return logger['error'](_0x027b('0x29'),_0x027b('0x2a'),_0x027b('0x5c'),util['inspect'](_0x50bcfa[_0x027b('0x2d')],{'showHidden':![],'depth':null}));}})[_0x027b('0x1a')](function(_0x34753f){return logger[_0x027b('0x2d')](_0x027b('0x29'),_0x027b('0x2a'),_0x027b('0x5c'),util[_0x027b('0x2c')](_0x34753f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x027b('0x29'),'afterCreate','csc',_0x027b('0x68'));}break;case'clickatell':if(_0xf61891[_0x027b('0x69')]){var _0x13946b={'method':_0x027b('0x3f'),'uri':_0x027b('0x6a'),'headers':{'Authorization':_0xf61891['apiKey']},'body':{'content':_0x151211[_0x027b('0xb')],'to':[_0x151211[_0x027b('0x20')]],'from':_0xf61891[_0x027b('0x20')],'binary':![],'clientMessageId':_0x027b('0x6b'),'charset':_0x027b('0x6c')},'json':!![]};rp(_0x13946b)[_0x027b('0x17')](function(_0x395b63){if(!_0x395b63['error']){var _0x393230={'messageId':_0x395b63['messages'][0x0][_0x027b('0x6d')]};if(!_0xf61891[_0x027b('0x3c')]){_0x393230[_0x027b('0x42')]=!![];}return _0x314078[_0x027b('0x18')](_0x393230);}else{return logger[_0x027b('0x2d')](_0x027b('0x29'),_0x027b('0x2a'),'clickatell',util[_0x027b('0x2c')](_0x395b63['error'],{'showHidden':![],'depth':null}));}})[_0x027b('0x1a')](function(_0x2c0413){return logger[_0x027b('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x027b('0x6e'),util[_0x027b('0x2c')](_0x2c0413,{'showHidden':![],'depth':null}));});}else{logger[_0x027b('0x2d')](_0x027b('0x29'),_0x027b('0x2a'),_0x027b('0x6e'),_0x027b('0x68'));}break;case _0x027b('0x6f'):if(_0xf61891['username']&&_0xf61891[_0x027b('0x32')]){var _0x13c391=util[_0x027b('0x46')](_0x027b('0x47'),_0xf61891[_0x027b('0x31')],_0xf61891['password']);var _0x166b15={'method':_0x027b('0x3f'),'uri':_0x027b('0x70')+_0xf61891[_0x027b('0x71')]+'/messages','body':{'to':[_0x151211['phone']],'text':_0x151211[_0x027b('0xb')],'from':_0xf61891['phone'],'applicationId':_0xf61891[_0x027b('0x72')]},'headers':{'Authorization':util['format'](_0x027b('0x48'),new Buffer(_0x13c391)['toString'](_0x027b('0x4a')))},'json':!![]};rp(_0x166b15)['then'](function(_0x4d5a2e){if(_0x4d5a2e['id']){var _0x5e2003={'messageId':_0x4d5a2e['id']};return _0x314078['update'](_0x5e2003);}else{logger[_0x027b('0x2d')](_0x027b('0x29'),_0x027b('0x2a'),_0x027b('0x6f'),util[_0x027b('0x2c')](_0x4d5a2e,{'showHidden':![],'depth':null}));}})[_0x027b('0x1a')](function(_0x471a46){logger[_0x027b('0x2d')](_0x027b('0x29'),_0x027b('0x2a'),'bandwidth',util[_0x027b('0x2c')](_0x471a46,{'showHidden':![],'depth':null}));});}else{logger[_0x027b('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x027b('0x2a'),_0x027b('0x6f'),_0x027b('0x4f'));}break;case'intelepeer':if(_0xf61891[_0x027b('0x69')]){var _0x2e72ed={};var _0x41193a={'method':_0x027b('0x3f'),'uri':_0x027b('0x73'),'headers':{'Authorization':_0x027b('0x74')+_0xf61891[_0x027b('0x69')],'Content-Type':'application/json'},'body':{'from':_0xf61891[_0x027b('0x20')],'to':_0x151211[_0x027b('0x20')],'text':_0x151211[_0x027b('0xb')]},'json':!![]};return rp(_0x41193a)[_0x027b('0x17')](function(_0x374053){if(_0x374053[_0x027b('0x75')]==0xca){_0x2e72ed['message']=_0x374053;var _0x198bc9={'method':_0x027b('0x3f'),'uri':_0x027b('0x76'),'headers':{'Authorization':_0x027b('0x74')+_0xf61891['apiKey'],'Content-Type':_0x027b('0x59')},'body':{'refid':_0x2e72ed[_0x027b('0x77')][_0x027b('0x78')]},'json':!![]};return rp(_0x198bc9)[_0x027b('0x17')](function(_0x54aa94){_0x2e72ed['status']=_0x54aa94;var _0x336f3b={'messageId':_0x2e72ed[_0x027b('0x77')][_0x027b('0x78')],'read':!![]};return _0x314078[_0x027b('0x18')](_0x336f3b);});}else{return logger[_0x027b('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x027b('0x2a'),_0x027b('0x79'),util[_0x027b('0x2c')](_0x374053,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3a52c2){return logger[_0x027b('0x2d')](_0x027b('0x29'),_0x027b('0x2a'),_0x027b('0x79'),util[_0x027b('0x2c')](_0x3a52c2,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x027b('0x29'),'afterCreate',_0x027b('0x79'),_0x027b('0x7a'));}break;}}})[_0x027b('0x7b')](function(){_0x2ef243();});}else{_0x2ef243();}}},'charset':_0x027b('0x7c'),'collate':_0x027b('0x7d')});};
\ No newline at end of file