mirror of
https://github.com/markqvist/Sideband.git
synced 2025-11-28 11:21:23 -05:00
Improved call status feedback and decreased call connect timeout
This commit is contained in:
parent
3f1cdd2724
commit
581e8073c5
4 changed files with 27 additions and 14 deletions
|
|
@ -1504,11 +1504,17 @@ class SidebandApp(MDApp):
|
||||||
if service_voice_running: self.sideband.voice_running = True
|
if service_voice_running: self.sideband.voice_running = True
|
||||||
else: self.sideband.voice_running = False
|
else: self.sideband.voice_running = False
|
||||||
|
|
||||||
incoming_call = self.sideband.getstate("voice.incoming_call")
|
if self.sideband.voice_running:
|
||||||
if incoming_call:
|
incoming_call = self.sideband.getstate("voice.incoming_call")
|
||||||
self.sideband.setstate("voice.incoming_call", None)
|
ended_call = self.sideband.getstate("voice.ongoing_ended")
|
||||||
if RNS.vendor.platformutils.is_android(): toast(f"Call from {incoming_call}")
|
if incoming_call:
|
||||||
else: toast(f"Call from {incoming_call}", duration=7)
|
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":
|
if self.root.ids.screen_manager.current == "messages_screen":
|
||||||
self.messages_view.update()
|
self.messages_view.update()
|
||||||
|
|
@ -5866,7 +5872,6 @@ class SidebandApp(MDApp):
|
||||||
if self.sideband.voice_running:
|
if self.sideband.voice_running:
|
||||||
if self.sideband.telephone.is_ringing or self.sideband.telephone.is_in_call:
|
if self.sideband.telephone.is_ringing or self.sideband.telephone.is_in_call:
|
||||||
self.sideband.telephone.hangup()
|
self.sideband.telephone.hangup()
|
||||||
toast("Call ended")
|
|
||||||
|
|
||||||
### Telemetry Screen
|
### Telemetry Screen
|
||||||
######################################
|
######################################
|
||||||
|
|
|
||||||
|
|
@ -5475,10 +5475,11 @@ class SidebandCore():
|
||||||
def missed_call(self, remote_identity):
|
def missed_call(self, remote_identity):
|
||||||
display_name = self.voice_display_name(remote_identity.hash)
|
display_name = self.voice_display_name(remote_identity.hash)
|
||||||
self.setstate("voice.missed_call", display_name)
|
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")
|
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
|
rns_config = """# This template is used to generate a
|
||||||
# running configuration for Sideband's
|
# running configuration for Sideband's
|
||||||
# internal RNS instance. Incorrect changes
|
# internal RNS instance. Incorrect changes
|
||||||
|
|
|
||||||
|
|
@ -213,8 +213,12 @@ class ReticulumTelephone():
|
||||||
self.direction = None
|
self.direction = None
|
||||||
self.state = self.STATE_AVAILABLE
|
self.state = self.STATE_AVAILABLE
|
||||||
|
|
||||||
if call_was_connecting: self.log_call("outgoing-failure", remote_identity)
|
if call_was_connecting:
|
||||||
elif was_in_call: self.log_call("ongoing-ended", remote_identity)
|
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:
|
elif was_ringing:
|
||||||
self.log_call("incoming-missed", remote_identity)
|
self.log_call("incoming-missed", remote_identity)
|
||||||
self.owner.missed_call(remote_identity)
|
self.owner.missed_call(remote_identity)
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,10 @@ class Voice():
|
||||||
if telephone.caller: ih.text = RNS.hexrep(telephone.caller.hash, delimit=False)
|
if telephone.caller: ih.text = RNS.hexrep(telephone.caller.hash, delimit=False)
|
||||||
if telephone.active_profile: self.call_profile = telephone.active_profile
|
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:
|
else:
|
||||||
db.disabled = True; db.text = "Voice calls disabled"
|
db.disabled = True; db.text = "Voice calls disabled"
|
||||||
ih.disabled = True
|
ih.disabled = True
|
||||||
|
|
@ -212,12 +216,11 @@ class Voice():
|
||||||
if self.app.sideband.telephone.is_available:
|
if self.app.sideband.telephone.is_available:
|
||||||
|
|
||||||
destination_hash = RNS.Destination.hash_from_name_and_identity("lxst.telephony", self.dial_target)
|
destination_hash = RNS.Destination.hash_from_name_and_identity("lxst.telephony", self.dial_target)
|
||||||
if not RNS.Transport.has_path(destination_hash):
|
if not RNS.Transport.has_path(destination_hash): self.request_path(destination_hash)
|
||||||
self.request_path(destination_hash)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
RNS.log(f"Calling {RNS.prettyhexrep(self.dial_target)}...", RNS.LOG_DEBUG)
|
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()
|
self.update_call_status()
|
||||||
|
|
||||||
elif self.app.sideband.telephone.is_in_call or self.app.sideband.telephone.call_is_connecting:
|
elif self.app.sideband.telephone.is_in_call or self.app.sideband.telephone.call_is_connecting:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue