Add calls to Apiv1

This commit is contained in:
AxeKam333 2025-03-12 15:30:47 +01:00
parent e67cce70b9
commit 95c015ac28
2 changed files with 37 additions and 4 deletions

View File

@ -20,18 +20,32 @@ class SMSEagle extends NotificationProvider {
let sendMethod;
let recipientType;
let duration, voice_id;
if (notification.smseagleRecipientType === "smseagle-contact") {
recipientType = "contactname";
sendMethod = "/send_tocontact";
}
if (notification.smseagleRecipientType === "smseagle-group") {
} else if (notification.smseagleRecipientType === "smseagle-group") {
recipientType = "groupname";
sendMethod = "/send_togroup";
}
if (notification.smseagleRecipientType === "smseagle-to") {
} else if (notification.smseagleRecipientType === "smseagle-to") {
recipientType = "to";
sendMethod = "/send_sms";
} else {
recipientType = "to";
if (notification.smseagleDuration)
duration = notification.smseagleDuration;
else
duration = 10;
if (notification.smseagleRecipientType == "smseagle-ring") {
sendMethod = "/ring_call";
} else if (notification.smseagleRecipientType == "smseagle-tts") {
sendMethod = "/tts_call";
} else if (notification.smseagleRecipientType == "smseagle-tts-advanced") {
sendMethod = "/tts_adv_call";
voice_id = notification.smseagleTtsModel;
}
}
const url = new URL(notification.smseagleUrl + "/http_api" + sendMethod);
@ -41,6 +55,12 @@ class SMSEagle extends NotificationProvider {
url.searchParams.append('message', msg);
url.searchParams.append('unicode', (notification.smseagleEncoding) ? "1" : "0");
url.searchParams.append('highpriority', (notification.smseaglePriority) ? notification.smseaglePriority : "0");
if (duration) {
url.searchParams.append('duration', duration);
}
if (voice_id) {
url.searchParams.append('voice_id', voice_id);
}
let resp = await axios.get(url.toString(), config);

View File

@ -21,6 +21,9 @@
<option value="smseagle-to" selected>{{ $t("smseagleTo") }}</option>
<option value="smseagle-group">{{ $t("smseagleGroup") }}</option>
<option value="smseagle-contact">{{ $t("smseagleContact") }}</option>
<option value="smseagle-ring">{{ $t("smseagleTo") }} {{ $t("smseagleMsgRing") }} </option>
<option value="smseagle-tts">{{ $t("smseagleTo") }} {{ $t("smseagleMsgTts") }} </option>
<option value="smseagle-tts-advanced">{{ $t("smseagleTo") }} {{ $t("smseagleMsgTtsAdvanced") }} </option>
</select>
</div>
<div class="mb-3">
@ -35,6 +38,16 @@
<label for="smseagle-encoding" class="form-label">{{ $t("smseagleEncoding") }}</label>
<input id="smseagle-encoding" v-model="$parent.notification.smseagleEncoding" type="checkbox" class="form-check-input">
</div>
<div v-if="$parent.notification.smseagleRecipientType === 'smseagle-ring'
|| $parent.notification.smseagleRecipientType === 'smseagle-tts'
|| $parent.notification.smseagleRecipientType === 'smseagle-tts-advanced'" class="mb-3">
<label for="smseagle-duration" class="form-label">{{ $t("smseagleDuration") }}</label>
<input id="smseagle-duration" v-model="$parent.notification.smseagleDuration" type="number" class="form-control" min="0" max="30" step="1" placeholder="10">
</div>
<div v-if="$parent.notification.smseagleRecipientType === 'smseagle-tts-advanced'" class="mb-3">
<label for="smseagle-tts-model" class="form-label">{{ $t("smseagleTtsModel") }} </label>
<input id="smseagle-tts-model" v-model="$parent.notification.smseagleTtsModel" type="number" class="form-control" required>
</div>
</div>
<div v-if="$parent.notification.smseagleApiType === 'smseagle-apiv2'" class="mb-3">
<div class="mb-3">