diff --git a/openrtx/include/core/voicePromptUtils.h b/openrtx/include/core/voicePromptUtils.h index 413ab933..8e538489 100644 --- a/openrtx/include/core/voicePromptUtils.h +++ b/openrtx/include/core/voicePromptUtils.h @@ -128,7 +128,7 @@ void vp_announceContact(const contact_t* contact, const vpQueueFlags_t flags); /** * */ -void vp_announceContactWithIndex(const uint16_t index, const vpQueueFlags_t flags); +bool vp_announceContactWithIndex(const uint16_t index, const vpQueueFlags_t flags); /** * diff --git a/openrtx/src/core/voicePromptUtils.c b/openrtx/src/core/voicePromptUtils.c index e731883e..5e7f97bb 100644 --- a/openrtx/src/core/voicePromptUtils.c +++ b/openrtx/src/core/voicePromptUtils.c @@ -434,16 +434,18 @@ void vp_announceContact(const contact_t* contact, const vpQueueFlags_t flags) playIfNeeded(flags); } -void vp_announceContactWithIndex(const uint16_t index, const vpQueueFlags_t flags) +bool vp_announceContactWithIndex(const uint16_t index, const vpQueueFlags_t flags) { if (index == 0) - return; + return false; contact_t contact; if (cps_readContact(&contact, index) == -1) - return; + return false; vp_announceContact(&contact, flags); + + return true; } void vp_announceTimeslot(const uint8_t timeslot, const vpQueueFlags_t flags) @@ -521,7 +523,8 @@ void vp_announceM17Info(const channel_t* channel, bool isEditing, const vpQueueF } else if ((channel != NULL) && (channel->m17.contact_index != 0)) { - vp_announceContactWithIndex(channel->m17.contact_index, flags); + if (!vp_announceContactWithIndex(channel->m17.contact_index, flags)) + vp_queueStringTableEntry(¤tLanguage->broadcast); } else {