Open
Description
Problem description
The current WebRTC-Registration API offers no way for a client to discover, control, or be warned about the lifetime of its registration:
- The POST
/sessions
response omits anyexpiresAt
/validUntil
field, so the app cannot tell when the registration becomes invalid. - The PUT
/sessions/{registrationId}
operation cannot extend the existing TTL, nor is the TTL refreshed implicitly when other WebRTC APIs are invoked. - The platform provides no CloudEvent (via WebRTC-Events) to signal that the registration has lapsed, leaving the client unaware that a new registration is required.
Expected behavior
- Optional client-requested TTL – Add an optional
requestedValiditySeconds
orregistrationExpireTime
in the POST body; if absent, the gateway applies its default. - Explicit expiry in responses – Both POST and PUT must return an
expiresAt
timestamp so the client can schedule proactive renewal. - Renewal via PUT – Allow the same TTL fields in PUT
/sessions/{registrationId}
to extend validity before expiry. - Optional sliding-window refresh – Each successful WebRTC API call may refresh the registration server-side (nice-to-have).
- Expiry notification – Emit a CloudEvent such as
org.camaraproject.webrtc-registration.v0.registration-expires
over the existing WebRTC-Events channel when the registration reachesexpiresAt
(or is revoked).
Alternative solution
- Rely solely on the generic
org.camaraproject.webrtc-events.v0.subscription-ends
event for expiry, but document that it applies to registrations. - Provide a separate lightweight “keep-alive” endpoint instead of extending PUT semantics.
- Allow clients to query remaining TTL with a HEAD request returning
Expires
header rather than embedding it in the JSON payload.
Additional context
- Aligns with CAMARA Commonalities TTL handling used in other APIs (e.g., device-location).
- Prevents silent call failures due to stale registrations, improving UX.
- Requires schema updates in
webrtc-registration.yaml
and corresponding examples; also needs an event-type addition inwebrtc-events-subscription.yaml
.