Built motion from commit ddca4d0d.|2.5.47
[motion2.git] / server / api / smsMessage / smsMessage.model.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x3f70=['toLowerCase','out','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','error','secret','find','SmsAccountId','type','twilio','authToken','phone','accountSid','create','body','remote','/api/sms/messages/','catch','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','password','smsMethod','sender','login?username=','&password=','user_key','session_key','internal_order_id','deliveryReport','read','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','messages','message_id','clickSend','plivo','/status?token=','token','authId','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','sort','length','createHash','md5','digest','hex','GET','/external/get/send.php?','keys','id_sms','csc','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','%s:%s','accountId','/messages','applicationId','bandwidth','Missing\x20parameters:\x20username,\x20password','intelepeer','application/json','message','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','path','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','direction'];(function(_0x887ef1,_0x566be3){var _0x471fac=function(_0x3dfd25){while(--_0x3dfd25){_0x887ef1['push'](_0x887ef1['shift']());}};_0x471fac(++_0x566be3);}(_0x3f70,0x15a));var _0x03f7=function(_0x52e573,_0x2f0fd0){_0x52e573=_0x52e573-0x0;var _0x976576=_0x3f70[_0x52e573];return _0x976576;};'use strict';var _=require('lodash');var util=require(_0x03f7('0x0'));var logger=require('../../config/logger')(_0x03f7('0x1'));var moment=require(_0x03f7('0x2'));var BPromise=require(_0x03f7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x03f7('0x4'));var rimraf=require('rimraf');var config=require(_0x03f7('0x5'));var attributes=require(_0x03f7('0x6'));module[_0x03f7('0x7')]=function(_0x43979a,_0x530cf4){return _0x43979a[_0x03f7('0x8')](_0x03f7('0x9'),attributes,{'tableName':_0x03f7('0xa'),'paranoid':![],'indexes':[{'name':_0x03f7('0xb'),'fields':[_0x03f7('0xb')]},{'name':_0x03f7('0xc'),'fields':['body'],'type':_0x03f7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1004f9,_0x4f3890,_0x4ee50b){var _0x30827a=_0x43979a[_0x03f7('0xe')];var _0x478c35=_0x1004f9[_0x03f7('0xf')]({'plain':!![]});if(_0x478c35[_0x03f7('0x10')]['toLowerCase']()==='in'||_0x478c35[_0x03f7('0x10')][_0x03f7('0x11')]()===_0x03f7('0x12')&&!_0x478c35['secret']&&!_[_0x03f7('0x13')](_0x478c35[_0x03f7('0x14')])&&!_[_0x03f7('0x13')](_0x478c35[_0x03f7('0x15')])){_0x30827a[_0x03f7('0x16')][_0x03f7('0x17')]({'where':{'id':_0x478c35[_0x03f7('0x15')]}})[_0x03f7('0x18')](function(_0x4f13c7){if(_0x4f13c7){_0x4f13c7[_0x03f7('0x19')]({'lastMsgAt':_0x478c35[_0x03f7('0x1a')],'lastMsgDirection':_0x478c35['direction'][_0x03f7('0x11')]()});}})['catch'](function(_0x54df8e){console[_0x03f7('0x1b')](_0x54df8e);});}if(_0x478c35[_0x03f7('0x10')]===_0x03f7('0x12')&&!_0x478c35[_0x03f7('0x1c')]){var _0x283d67;_0x30827a['SmsAccount'][_0x03f7('0x1d')]({'where':{'id':_0x478c35[_0x03f7('0x1e')]},'raw':!![]})[_0x03f7('0x18')](function(_0x208c84){_0x283d67=_0x208c84;if(_0x283d67&&_0x283d67[_0x03f7('0x1f')]){switch(_0x283d67[_0x03f7('0x1f')]){case _0x03f7('0x20'):var _0x2760f6=require('twilio');if(_0x283d67['accountSid']&&_0x283d67[_0x03f7('0x21')]&&_0x283d67[_0x03f7('0x22')]){var _0xf79e51=new _0x2760f6(_0x283d67[_0x03f7('0x23')],_0x283d67[_0x03f7('0x21')]);_0xf79e51['messages'][_0x03f7('0x24')]({'body':_0x478c35[_0x03f7('0x25')],'to':_0x478c35['phone'],'from':_0x283d67['phone'],'statusCallback':_0x283d67[_0x03f7('0x26')]+_0x03f7('0x27')+_0x478c35['id']+'/status?token='+_0x283d67['token']})[_0x03f7('0x18')](function(_0x26e80a){if(_0x26e80a['sid']){return _0x1004f9[_0x03f7('0x19')]({'messageId':_0x26e80a['sid']});}})[_0x03f7('0x28')](function(_0x2f0b91){logger[_0x03f7('0x1b')](_0x03f7('0x29'),'afterCreate',_0x03f7('0x20'),util[_0x03f7('0x2a')](_0x2f0b91,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x20'),_0x03f7('0x2c'));}break;case _0x03f7('0x2d'):var _0x47431c=_0x03f7('0x2e');if(_0x283d67[_0x03f7('0x2f')]&&_0x283d67[_0x03f7('0x30')]){var _0x531318={'recipient':[_0x478c35[_0x03f7('0x22')]],'message':_0x478c35[_0x03f7('0x25')],'message_type':_0x283d67[_0x03f7('0x31')]};if(_0x283d67[_0x03f7('0x31')]&&_0x283d67[_0x03f7('0x31')]!=='SI'){_0x531318[_0x03f7('0x32')]=_0x283d67[_0x03f7('0x22')];}var _0x593ec={'url':_0x47431c+_0x03f7('0x33')+_0x283d67[_0x03f7('0x2f')]+_0x03f7('0x34')+_0x283d67[_0x03f7('0x30')],'method':'GET'};rp(_0x593ec)[_0x03f7('0x18')](function(_0xd8872d){var _0x57ff85=_0xd8872d['split'](';');var _0x1abe31={'user_key':_0x57ff85[0x0],'session_key':_0x57ff85[0x1]};_0x593ec={'url':_0x47431c+'sms','method':'POST','headers':{'user_key':_0x1abe31[_0x03f7('0x35')],'Session_key':_0x1abe31[_0x03f7('0x36')]},'json':!![],'body':_0x531318};return rp(_0x593ec);})[_0x03f7('0x18')](function(_0x88130e){if(_0x88130e['total_sent']>=0x1){var _0x3caedc={'messageId':_0x88130e[_0x03f7('0x37')]};if(_0x283d67[_0x03f7('0x31')]!=='GP'||!_0x283d67[_0x03f7('0x38')]){_0x3caedc[_0x03f7('0x39')]=!![];}return _0x1004f9['update'](_0x3caedc);}else{return logger[_0x03f7('0x1b')](_0x03f7('0x29'),'afterCreate',_0x03f7('0x2d'),util[_0x03f7('0x2a')](_0x88130e,{'showHidden':![],'depth':null}));}})[_0x03f7('0x28')](function(_0x809b90){return logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),'skebby',util[_0x03f7('0x2a')](_0x809b90,{'showHidden':![],'depth':null}));});}else{logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x2d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x03f7('0x3a'):if(_0x283d67[_0x03f7('0x21')]){var _0x125ee3={'recipient':_0x478c35['phone'],'message':_0x478c35[_0x03f7('0x25')],'sender':_0x283d67[_0x03f7('0x3b')]||_0x283d67[_0x03f7('0x22')],'authorization':_0x283d67[_0x03f7('0x21')]};var _0x4f3890={'method':_0x03f7('0x3c'),'uri':_0x03f7('0x3d'),'body':_0x125ee3,'json':!![]};rp(_0x4f3890)[_0x03f7('0x18')](function(_0x354fd2){var _0x30b733={'messageId':_0x354fd2[_0x03f7('0x3e')]};if(!_0x283d67[_0x03f7('0x38')]){_0x30b733[_0x03f7('0x39')]=!![];}return _0x1004f9['update'](_0x30b733);})[_0x03f7('0x28')](function(_0x4974d7){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x03f7('0x2b'),_0x03f7('0x3a'),util[_0x03f7('0x2a')](_0x4974d7,{'showHidden':![],'depth':null}));});}else{logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x3a'),_0x03f7('0x3f'));}break;case _0x03f7('0x40'):if(_0x283d67[_0x03f7('0x2f')]&&_0x283d67[_0x03f7('0x30')]){var _0x125ee3={'messages':[{'source':_0x03f7('0x41'),'to':_0x478c35[_0x03f7('0x22')],'body':_0x478c35[_0x03f7('0x25')],'from':_0x283d67[_0x03f7('0x3b')]||_0x283d67[_0x03f7('0x22')]}]};var _0x441e10=util[_0x03f7('0x42')]('%s:%s',_0x283d67[_0x03f7('0x2f')],_0x283d67[_0x03f7('0x30')]);var _0x4f3890={'method':_0x03f7('0x3c'),'uri':_0x03f7('0x43'),'body':_0x125ee3,'headers':{'Authorization':util['format'](_0x03f7('0x44'),new Buffer(_0x441e10)[_0x03f7('0x45')](_0x03f7('0x46')))},'json':!![]};rp(_0x4f3890)[_0x03f7('0x18')](function(_0x1e51ad){if(_0x1e51ad[_0x03f7('0x47')]>=0xc8&&_0x1e51ad[_0x03f7('0x47')]<=0xce){if(_0x1e51ad['data']&&_0x1e51ad[_0x03f7('0x48')]['queued_count']>0x0){var _0x1b18b9=_['head'](_0x1e51ad[_0x03f7('0x48')][_0x03f7('0x49')]);var _0x31006e={'messageId':_0x1b18b9[_0x03f7('0x4a')]};if(!_0x283d67[_0x03f7('0x38')]){_0x31006e[_0x03f7('0x39')]=!![];}return _0x1004f9['update'](_0x31006e);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x03f7('0x2b'),_0x03f7('0x4b'),util[_0x03f7('0x2a')](_0x1e51ad,{'showHidden':![],'depth':null}));}}else{logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x4b'),util[_0x03f7('0x2a')](_0x1e51ad,{'showHidden':![],'depth':null}));}})[_0x03f7('0x28')](function(_0x35a149){logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x4b'),util['inspect'](_0x35a149,{'showHidden':![],'depth':null}));});}else{logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x4b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x03f7('0x4c'):if(_0x283d67['authId']&&_0x283d67[_0x03f7('0x21')]){var _0x125ee3={'dst':_0x478c35[_0x03f7('0x22')],'text':_0x478c35[_0x03f7('0x25')],'src':_0x283d67[_0x03f7('0x3b')]||_0x283d67['phone'],'url':_0x283d67[_0x03f7('0x26')]+_0x03f7('0x27')+_0x478c35['id']+_0x03f7('0x4d')+_0x283d67[_0x03f7('0x4e')]};var _0x441e10=util[_0x03f7('0x42')]('%s:%s',_0x283d67[_0x03f7('0x4f')],_0x283d67[_0x03f7('0x21')]);var _0x4f3890={'method':_0x03f7('0x3c'),'uri':util[_0x03f7('0x42')]('https://api.plivo.com/v1/Account/%s/Message/',_0x283d67[_0x03f7('0x4f')]),'body':_0x125ee3,'headers':{'Authorization':util['format'](_0x03f7('0x44'),new Buffer(_0x441e10)['toString'](_0x03f7('0x46')))},'json':!![]};rp(_0x4f3890)[_0x03f7('0x18')](function(_0x3dde79){var _0x56bad4={'messageId':_0x3dde79[_0x03f7('0x50')][0x0]};return _0x1004f9[_0x03f7('0x19')](_0x56bad4);})[_0x03f7('0x28')](function(_0x14b93f){logger[_0x03f7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',util[_0x03f7('0x2a')](_0x14b93f,{'showHidden':![],'depth':null}));});}else{logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x4c'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x03f7('0x51'):if(_0x283d67['username']&&_0x283d67[_0x03f7('0x30')]){if(_0x283d67[_0x03f7('0x52')]){var _0x4a3590={'method':'POST','uri':_0x283d67[_0x03f7('0x52')]+_0x03f7('0x53'),'body':{'username':_0x283d67[_0x03f7('0x2f')],'password':_0x283d67[_0x03f7('0x30')]},'json':!![]};return rp(_0x4a3590)[_0x03f7('0x18')](function(_0x19140e){var _0x56f9cb={'method':_0x03f7('0x3c'),'uri':_0x283d67[_0x03f7('0x52')]+_0x03f7('0x54'),'body':{'messages':[{'from':_0x283d67[_0x03f7('0x22')],'destinations':[{'to':_0x478c35[_0x03f7('0x22')]}],'text':_0x478c35[_0x03f7('0x25')],'notifyUrl':_0x283d67[_0x03f7('0x26')]+_0x03f7('0x27')+_0x478c35['id']+_0x03f7('0x4d')+_0x283d67['token'],'notifyContentType':'application/json','callbackData':_0x283d67['phone']+';'+_0x478c35[_0x03f7('0x25')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x19140e[_0x03f7('0x4e')]},'json':!![]};return rp(_0x56f9cb)[_0x03f7('0x18')](function(_0x454465){if(_0x454465[_0x03f7('0x49')]){var _0x5e9cae={'messageId':_0x454465[_0x03f7('0x49')][0x0][_0x03f7('0xb')]};if(!_0x283d67[_0x03f7('0x38')]){_0x5e9cae[_0x03f7('0x39')]=!![];}return _0x1004f9[_0x03f7('0x19')](_0x5e9cae);}else{return logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x51'),util['inspect'](_0x454465,{'showHidden':![],'depth':null}));}});})[_0x03f7('0x28')](function(_0x21ed12){return logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x51'),util[_0x03f7('0x2a')](_0x21ed12,{'showHidden':![],'depth':null}));});}else{logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x51'),_0x03f7('0x55'));}}else{logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x51'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x1347d8=require(_0x03f7('0x56'));if(_0x283d67[_0x03f7('0x57')]){var _0x3c99f0={};_0x3c99f0[_0x03f7('0x58')]=_0x283d67[_0x03f7('0x2f')];_0x3c99f0[_0x03f7('0x22')]=_0x478c35[_0x03f7('0x22')];_0x3c99f0['sender']=_0x283d67['phone'];_0x3c99f0[_0x03f7('0x59')]=_0x478c35[_0x03f7('0x25')];_0x3c99f0[_0x03f7('0x5a')]=+new Date();var _0x16f00d='';var _0xf11c21='';var _0x23fb8c=Object['keys'](_0x3c99f0);_0x23fb8c[_0x03f7('0x5b')]();for(var _0x58e7eb=0x0;_0x58e7eb<_0x23fb8c[_0x03f7('0x5c')];_0x58e7eb++){if(_0x16f00d!=''){_0x16f00d+='&';}_0x16f00d+=_0x23fb8c[_0x58e7eb]+'='+encodeURIComponent(_0x3c99f0[_0x23fb8c[_0x58e7eb]]);_0xf11c21+=_0x3c99f0[_0x23fb8c[_0x58e7eb]];}_0xf11c21+=_0x283d67[_0x03f7('0x57')];_0xf11c21=_0x1347d8[_0x03f7('0x5d')](_0x03f7('0x5e'))[_0x03f7('0x19')](_0xf11c21)[_0x03f7('0x5f')](_0x03f7('0x60'));if(_0x16f00d!==''){_0x16f00d+='&';}_0x16f00d+='signature='+_0xf11c21;var _0x593ec={'method':_0x03f7('0x61'),'uri':_0x283d67[_0x03f7('0x52')]+_0x03f7('0x62')+_0x16f00d,'json':!![]};return rp(_0x593ec)['then'](function(_0x5acf3d){var _0x507012=Object[_0x03f7('0x63')](_0x5acf3d);if(_0x5acf3d[_0x507012[0x0]]['error']&&parseInt(_0x5acf3d[_0x507012[0x0]][_0x03f7('0x1b')])===0x0){var _0x47f90c={'messageId':_0x5acf3d[_0x507012[0x0]][_0x03f7('0x64')]};if(!_0x283d67[_0x03f7('0x38')]){_0x47f90c['read']=!![];}return _0x1004f9[_0x03f7('0x19')](_0x47f90c);}else{return logger[_0x03f7('0x1b')](_0x03f7('0x29'),'afterCreate','csc',util[_0x03f7('0x2a')](_0x5acf3d[_0x03f7('0x1b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2f915a){return logger[_0x03f7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x03f7('0x2b'),'csc',util['inspect'](_0x2f915a,{'showHidden':![],'depth':null}));});}else{logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x65'),'Missing\x20parameters:\x20apiKey');}break;case _0x03f7('0x66'):if(_0x283d67[_0x03f7('0x57')]){var _0x4ea9ba={'method':_0x03f7('0x3c'),'uri':_0x03f7('0x67'),'headers':{'Authorization':_0x283d67['apiKey']},'body':{'content':_0x478c35[_0x03f7('0x25')],'to':[_0x478c35[_0x03f7('0x22')]],'from':_0x283d67[_0x03f7('0x22')],'binary':![],'clientMessageId':_0x03f7('0x68'),'charset':_0x03f7('0x69')},'json':!![]};rp(_0x4ea9ba)[_0x03f7('0x18')](function(_0x20b4c0){if(!_0x20b4c0[_0x03f7('0x1b')]){var _0x4bf6c9={'messageId':_0x20b4c0['messages'][0x0][_0x03f7('0x6a')]};if(!_0x283d67['deliveryReport']){_0x4bf6c9[_0x03f7('0x39')]=!![];}return _0x1004f9[_0x03f7('0x19')](_0x4bf6c9);}else{return logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x66'),util[_0x03f7('0x2a')](_0x20b4c0['error'],{'showHidden':![],'depth':null}));}})[_0x03f7('0x28')](function(_0x25d58c){return logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x66'),util['inspect'](_0x25d58c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x66'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x283d67['username']&&_0x283d67[_0x03f7('0x30')]){var _0x441e10=util['format'](_0x03f7('0x6b'),_0x283d67['username'],_0x283d67[_0x03f7('0x30')]);var _0x4f3890={'method':_0x03f7('0x3c'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x283d67[_0x03f7('0x6c')]+_0x03f7('0x6d'),'body':{'to':[_0x478c35['phone']],'text':_0x478c35['body'],'from':_0x283d67[_0x03f7('0x22')],'applicationId':_0x283d67[_0x03f7('0x6e')]},'headers':{'Authorization':util['format'](_0x03f7('0x44'),new Buffer(_0x441e10)['toString'](_0x03f7('0x46')))},'json':!![]};rp(_0x4f3890)[_0x03f7('0x18')](function(_0x278d1d){if(_0x278d1d['id']){var _0x1c08a1={'messageId':_0x278d1d['id']};return _0x1004f9[_0x03f7('0x19')](_0x1c08a1);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x03f7('0x2b'),_0x03f7('0x6f'),util[_0x03f7('0x2a')](_0x278d1d,{'showHidden':![],'depth':null}));}})['catch'](function(_0x39d7eb){logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x6f'),util[_0x03f7('0x2a')](_0x39d7eb,{'showHidden':![],'depth':null}));});}else{logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x6f'),_0x03f7('0x70'));}break;case _0x03f7('0x71'):if(_0x283d67['apiKey']){var _0x402f4f={};var _0x593ec={'method':_0x03f7('0x3c'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x283d67[_0x03f7('0x57')],'Content-Type':_0x03f7('0x72')},'body':{'from':_0x283d67[_0x03f7('0x22')],'to':_0x478c35['phone'],'text':_0x478c35[_0x03f7('0x25')]},'json':!![]};return rp(_0x593ec)[_0x03f7('0x18')](function(_0xf725d2){if(_0xf725d2['code']==0xca){_0x402f4f[_0x03f7('0x73')]=_0xf725d2;var _0xa3493={'method':_0x03f7('0x3c'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x283d67[_0x03f7('0x57')],'Content-Type':_0x03f7('0x72')},'body':{'refid':_0x402f4f[_0x03f7('0x73')][_0x03f7('0x74')]},'json':!![]};return rp(_0xa3493)['then'](function(_0xe35452){_0x402f4f[_0x03f7('0x75')]=_0xe35452;var _0x1f4b22={'messageId':_0x402f4f[_0x03f7('0x73')][_0x03f7('0x74')],'read':!![]};return _0x1004f9[_0x03f7('0x19')](_0x1f4b22);});}else{return logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x71'),util[_0x03f7('0x2a')](_0xf725d2,{'showHidden':![],'depth':null}));}})[_0x03f7('0x28')](function(_0x2b4506){return logger[_0x03f7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x03f7('0x2b'),_0x03f7('0x71'),util[_0x03f7('0x2a')](_0x2b4506,{'showHidden':![],'depth':null}));});}else{return logger[_0x03f7('0x1b')](_0x03f7('0x29'),_0x03f7('0x2b'),_0x03f7('0x71'),_0x03f7('0x76'));}break;}}})['finally'](function(){_0x4ee50b();});}else{_0x4ee50b();}}},'charset':_0x03f7('0x77'),'collate':_0x03f7('0x78')});};