mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-12-04 05:40:02 -05:00
support timeout for intiating calls, and set default to 15 seconds
This commit is contained in:
parent
4a6dec1da6
commit
beef7d526b
3 changed files with 32 additions and 8 deletions
9
web.py
9
web.py
|
|
@ -304,12 +304,19 @@ class ReticulumWebChat:
|
|||
|
||||
# get path params
|
||||
destination_hash = request.match_info.get("destination_hash", "")
|
||||
timeout_seconds = int(request.query.get("timeout", 15))
|
||||
|
||||
print(timeout_seconds)
|
||||
|
||||
# convert destination hash to bytes
|
||||
destination_hash = bytes.fromhex(destination_hash)
|
||||
|
||||
# initiate audio call
|
||||
link_hash = await self.audio_call_manager.initiate(destination_hash)
|
||||
link_hash = await self.audio_call_manager.initiate(destination_hash, timeout_seconds)
|
||||
if link_hash is None:
|
||||
return web.json_response({
|
||||
"message": "timed out initiating call",
|
||||
}, status=503)
|
||||
|
||||
return web.json_response({
|
||||
"hash": link_hash.hex(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue