Fix sending apiv1 calls, fix passed arguments

This commit is contained in:
AxeKam333 2025-03-31 10:18:22 +02:00
parent 23e8dc6375
commit 277213dad5

View file

@ -31,20 +31,20 @@ class SMSEagle extends NotificationProvider {
} else if (notification.smseagleRecipientType === "smseagle-to") { } else if (notification.smseagleRecipientType === "smseagle-to") {
recipientType = "to"; recipientType = "to";
sendMethod = "/send_sms"; sendMethod = "/send_sms";
} else { if (notification.smseagleMsgType != "smseagle-sms") {
recipientType = "to"; if (notification.smseagleDuration)
if (notification.smseagleDuration) duration = notification.smseagleDuration;
duration = notification.smseagleDuration; else
else duration = 10;
duration = 10;
if (notification.smseagleMsgType == "smseagle-ring") { if (notification.smseagleMsgType == "smseagle-ring") {
sendMethod = "/ring_call"; sendMethod = "/ring_call";
} else if (notification.smseagleMsgType == "smseagle-tts") { } else if (notification.smseagleMsgType == "smseagle-tts") {
sendMethod = "/tts_call"; sendMethod = "/tts_call";
} else if (notification.smseagleMsgType == "smseagle-tts-advanced") { } else if (notification.smseagleMsgType == "smseagle-tts-advanced") {
sendMethod = "/tts_adv_call"; sendMethod = "/tts_adv_call";
voice_id = notification.smseagleTtsModel ? notification.smseagleTtsModel : 1 ; voice_id = notification.smseagleTtsModel ? notification.smseagleTtsModel : 1;
}
} }
} }
@ -52,12 +52,15 @@ class SMSEagle extends NotificationProvider {
url.searchParams.append('access_token', notification.smseagleToken); url.searchParams.append('access_token', notification.smseagleToken);
url.searchParams.append(recipientType, notification.smseagleRecipient); url.searchParams.append(recipientType, notification.smseagleRecipient);
url.searchParams.append('message', msg); if (!["smseagle-ring", "smseagle-tts", "smseagle-tts-advanced"].includes(notification.smseagleRecipientType)) {
url.searchParams.append('unicode', (notification.smseagleEncoding) ? "1" : "0"); url.searchParams.append('unicode', (notification.smseagleEncoding) ? "1" : "0");
url.searchParams.append('highpriority', (notification.smseaglePriority) ? notification.smseaglePriority : "0"); url.searchParams.append('highpriority', (notification.smseaglePriority) ? notification.smseaglePriority : "0");
if (duration) { } else {
url.searchParams.append('duration', duration); url.searchParams.append('duration', duration);
} }
if (notification.smseagleRecipientType != "smseagle-ring") {
url.searchParams.append('message', msg);
}
if (voice_id) { if (voice_id) {
url.searchParams.append('voice_id', voice_id); url.searchParams.append('voice_id', voice_id);
} }
@ -130,7 +133,7 @@ class SMSEagle extends NotificationProvider {
endpoint = "/calls/tts"; endpoint = "/calls/tts";
} else if (notification.smseagleMsgType == "smseagle-tts-advanced") { } else if (notification.smseagleMsgType == "smseagle-tts-advanced") {
endpoint = "/calls/tts_advanced"; endpoint = "/calls/tts_advanced";
postData["voice_id"] = notification.smseagleTtsModel ? notification.smseagleTtsModel : "1" ; postData["voice_id"] = notification.smseagleTtsModel ? notification.smseagleTtsModel : "1";
} }
} }