Improved call status feedback and decreased call connect timeout

This commit is contained in:
Mark Qvist 2025-11-24 11:38:19 +01:00
parent 3f1cdd2724
commit 581e8073c5
4 changed files with 27 additions and 14 deletions

View file

@ -1504,11 +1504,17 @@ class SidebandApp(MDApp):
if service_voice_running: self.sideband.voice_running = True
else: self.sideband.voice_running = False
incoming_call = self.sideband.getstate("voice.incoming_call")
if incoming_call:
self.sideband.setstate("voice.incoming_call", None)
if RNS.vendor.platformutils.is_android(): toast(f"Call from {incoming_call}")
else: toast(f"Call from {incoming_call}", duration=7)
if self.sideband.voice_running:
incoming_call = self.sideband.getstate("voice.incoming_call")
ended_call = self.sideband.getstate("voice.ongoing_ended")
if incoming_call:
self.sideband.setstate("voice.incoming_call", None)
dn = multilingual_markup(escape_markup(str(incoming_call)).encode("utf-8")).decode("utf-8")
toast(f"Call from {dn}", duration=4)
if ended_call:
self.sideband.setstate("voice.ongoing_ended", False)
toast("Call ended", duration=4)
if self.root.ids.screen_manager.current == "messages_screen":
self.messages_view.update()
@ -5866,7 +5872,6 @@ class SidebandApp(MDApp):
if self.sideband.voice_running:
if self.sideband.telephone.is_ringing or self.sideband.telephone.is_in_call:
self.sideband.telephone.hangup()
toast("Call ended")
### Telemetry Screen
######################################

View file

@ -5475,10 +5475,11 @@ class SidebandCore():
def missed_call(self, remote_identity):
display_name = self.voice_display_name(remote_identity.hash)
self.setstate("voice.missed_call", display_name)
# if self.gui_foreground(): RNS.log("Squelching call notification since GUI is in foreground", RNS.LOG_DEBUG)
# else: self.notify(title="Missed voice call", content=f"From {display_name}", group="LXST.Telephony", context_id="incoming_call")
self.notify(title="Missed call", content=f"From {display_name}", group="lxst.telephony.call", context_id="incoming_call")
def ended_call(self, remote_identity):
self.setstate("voice.ongoing_ended", True)
rns_config = """# This template is used to generate a
# running configuration for Sideband's
# internal RNS instance. Incorrect changes

View file

@ -213,8 +213,12 @@ class ReticulumTelephone():
self.direction = None
self.state = self.STATE_AVAILABLE
if call_was_connecting: self.log_call("outgoing-failure", remote_identity)
elif was_in_call: self.log_call("ongoing-ended", remote_identity)
if call_was_connecting:
self.log_call("outgoing-failure", remote_identity)
self.owner.setstate("voice.connection_failure", True)
elif was_in_call:
self.log_call("ongoing-ended", remote_identity)
self.owner.ended_call(remote_identity)
elif was_ringing:
self.log_call("incoming-missed", remote_identity)
self.owner.missed_call(remote_identity)

View file

@ -111,6 +111,10 @@ class Voice():
if telephone.caller: ih.text = RNS.hexrep(telephone.caller.hash, delimit=False)
if telephone.active_profile: self.call_profile = telephone.active_profile
if self.app.sideband.getstate("voice.connection_failure"):
self.app.sideband.setstate("voice.connection_failure", False)
toast("Could not connect call", duration=5)
else:
db.disabled = True; db.text = "Voice calls disabled"
ih.disabled = True
@ -212,12 +216,11 @@ class Voice():
if self.app.sideband.telephone.is_available:
destination_hash = RNS.Destination.hash_from_name_and_identity("lxst.telephony", self.dial_target)
if not RNS.Transport.has_path(destination_hash):
self.request_path(destination_hash)
if not RNS.Transport.has_path(destination_hash): self.request_path(destination_hash)
else:
RNS.log(f"Calling {RNS.prettyhexrep(self.dial_target)}...", RNS.LOG_DEBUG)
self.app.sideband.telephone.dial(self.dial_target, profile=self.call_profile)
if self.app.sideband.telephone.dial(self.dial_target, profile=self.call_profile) == "no_path":
self.request_path(destination_hash)
self.update_call_status()
elif self.app.sideband.telephone.is_in_call or self.app.sideband.telephone.call_is_connecting: