diff --git a/main.py b/main.py
index ef78978..fe24394 100644
--- a/main.py
+++ b/main.py
@@ -120,7 +120,15 @@ def on_mqtt(data):
max_old_time = epoch_time - 20
# Build the message that will be sent to Telegram
- telegram_message = "Callsign: " + jsondata["SourceCall"] + " ID: " + str(jsondata["SourceID"]) + " \nName: " +jsondata["SourceName"] + " \nTalkeralias: " + jsondata["TalkerAlias"] + " \n-----------------------------------\nAccess via: " + jsondata["LinkName"] + " \nVia repeater: " + jsondata["LinkCall"] + "\nSlot: " + str(jsondata["Slot"]) + " TG: " + str(jsondata["DestinationID"]) + "\nMaster: " + str(jsondata["Master"]) + "\nRSSI: " + str(jsondata["RSSI"]) + " dBm BER: " + str(round(jsondata["BER"],2)) + "%"
+ source_call = jsondata["SourceCall"].strip()
+ # Without a callsign there is nothing to look up, so skip the links.
+ links_line = (
+ "\nLinks: QRZ.com"
+ + " RadioID.net "
+ if source_call
+ else ""
+ )
+ telegram_message = "Callsign: " + jsondata["SourceCall"] + " ID: " + str(jsondata["SourceID"]) + " \nName: " +jsondata["SourceName"] + " \nTalkeralias: " + jsondata["TalkerAlias"] + " " + links_line + "\n-----------------------------------\nAccess via: " + jsondata["LinkName"] + " \nVia repeater: " + jsondata["LinkCall"] + "\nSlot: " + str(jsondata["Slot"]) + " TG: " + str(jsondata["DestinationID"]) + "\nMaster: " + str(jsondata["Master"]) + "\nRSSI: " + str(jsondata["RSSI"]) + " dBm BER: " + str(round(jsondata["BER"],2)) + "%"
context_id = _as_int(jsondata["ContextID"])
event_slot = _as_int(jsondata["Slot"])