Add ring calls, tts and tts advanced calls

This commit is contained in:
AxeKam333 2025-02-28 12:45:33 +01:00
parent e0f25eba60
commit 19cbf18a99
4 changed files with 59 additions and 9 deletions

View File

@ -30,7 +30,6 @@ class SMSEagle extends NotificationProvider {
let to = notification.smseagleRecipientTo;
let contacts = notification.smseagleRecipientContact;
let groups = notification.smseagleRecipientGroup;
console.log("b", to, contacts, groups);
if (contacts) {
contacts = contacts.split(",");
@ -53,9 +52,29 @@ class SMSEagle extends NotificationProvider {
postData["to"] = to;
}
console.log(postData);
let endpoint = "/messages/sms";
let resp = await axios.post(notification.smseagleUrl + "/api/v2/messages/sms", postData, config);
if (notification.smseagleMsgType != "smseagle-sms") {
let duration;
if (notification.smseagleDuration)
duration = notification.smseagleDuration
else
duration = 10;
postData["duration"] = duration;
if (notification.smseagleMsgType == "smseagle-ring") {
endpoint = "/calls/ring";
} else if (notification.smseagleMsgType == "smseagle-tts") {
endpoint = "/calls/tts";
} else if (notification.smseagleMsgType == "smseagle-tts-advanced") {
endpoint = "/calls/tts_advanced";
postData["voice_id"] = notification.smseagleTtsModel;
}
}
let resp = await axios.post(notification.smseagleUrl + "/api/v2" + endpoint, postData, config);
let countAll = resp.data.length;
let countQueued = resp.data.filter(x => x.status == "queued").length;

View File

@ -30,6 +30,23 @@
<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 class="mb-3">
<label for="smseagle-msg-type" class="form-label">{{ $t("smseagleMsgType") }} </label>
<select id="smseagle-msg-type" v-model="$parent.notification.smseagleMsgType" class="form-select">
<option value="smseagle-sms" selected>{{ $t("smseagleMsgSms") }} </option>
<option value="smseagle-ring">{{ $t("smseagleMsgRing") }} </option>
<option value="smseagle-tts">{{ $t("smseagleMsgTts") }} </option>
<option value="smseagle-tts-advanced">{{ $t("smseagleMsgTtsAdvanced") }} </option>
</select>
</div>
<div v-if="$parent.notification.smseagleMsgType !== 'smseagle-sms' && $parent.notification.smseagleMsgType" 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.smseagleMsgType === '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>
</template>
<script>

View File

@ -750,14 +750,21 @@
"serwersmsPhoneNumber": "Phone number",
"serwersmsSenderName": "SMS Sender Name (registered via customer portal)",
"smseagleTo": "Phone number(s)",
"smseagleGroup": "Phonebook group name(s)",
"smseagleContact": "Phonebook contact name(s)",
"smseagleGroup": "Phonebook group ID(s)",
"smseagleContact": "Phonebook contact ID(s)",
"smseagleRecipientType": "Recipient type",
"smseagleRecipient": "Recipient(s) (multiple must be separated with comma)",
"smseagleToken": "API Access token",
"smseagleUrl": "Your SMSEagle device URL",
"smseagleEncoding": "Send as Unicode",
"smseaglePriority": "Message priority (0-9, default = 0)",
"smseagleMsgType": "Message type",
"smseagleMsgSms": "Sms message (default)",
"smseagleMsgRing": "Ring call",
"smseagleMsgTts": "Text-to-speech call",
"smseagleMsgTtsAdvanced": "Text-to-speech Advanced call",
"smseagleDuration": "Duration (default=10)",
"smseagleTtsModel": "Text-to-speech model ID",
"smspartnerApiurl": "You can find your API key in your dashboard at {0}",
"smspartnerPhoneNumber": "Phone number(s)",
"smspartnerPhoneNumberHelptext": "The number must be in the international format {0}, {1}. Multiple numbers must be separated by {2}",
@ -1052,4 +1059,4 @@
"rabbitmqHelpText": "To use the monitor, you will need to enable the Management Plugin in your RabbitMQ setup. For more information, please consult the {rabitmq_documentation}.",
"SendGrid API Key": "SendGrid API Key",
"Separate multiple email addresses with commas": "Separate multiple email addresses with commas"
}
}

View File

@ -363,14 +363,21 @@
"serwersmsSenderName": "Nazwa nadawcy (zatwierdzona w panelu klienta)",
"smseagle": "SMSEagle",
"smseagleTo": "Numer/y telefonu",
"smseagleGroup": "Grupa/y z Książki adresowej",
"smseagleContact": "Kontakt/y z Książki adresowej",
"smseagleGroup": "Grupa/y z Książki adresowej - ID",
"smseagleContact": "Kontakt/y z Książki adresowej - ID",
"smseagleRecipientType": "Typ odbiorcy",
"smseagleRecipient": "Odbiorca/y (wiele musi być oddzielone przecinkami)",
"smseagleToken": "Klucz dostępu API",
"smseagleUrl": "URL Twojego urządzenia SMSEagle",
"smseagleEncoding": "Wyślij jako Unicode",
"smseaglePriority": "Priorytet wiadomości (0-9, domyślnie = 0)",
"smseagleMsgType": "Typ wiadomości",
"smseagleMsgSms": "Wiadomość sms (domyślnie)",
"smseagleMsgRing": "Tylko połączenie",
"smseagleMsgTts": "Połączenie text-to-speech (proste)",
"smseagleMsgTtsAdvanced": "Połączenie text-to-speech (zaawansowane)",
"smseagleDuration": "Czas trwania (domyślnie=10)",
"smseagleTtsModel": "ID modelu głosowego TTS",
"stackfield": "Stackfield",
"Customize": "Dostosuj",
"Custom Footer": "Niestandardowa stopka",
@ -1099,4 +1106,4 @@
"RabbitMQ Password": "Hasło RabbitMQ",
"SendGrid API Key": "Klucz API SendGrid",
"Separate multiple email addresses with commas": "Oddziel wiele adresów e-mail przecinkami"
}
}