- Add Django Channels 4 + channels-redis to requirements and INSTALLED_APPS
- Upgrade ASGI config to ProtocolTypeRouter with JWT-authenticated WebSocket routing
- Add JWTAuthMiddleware for WebSocket token auth via query param
- Add CallSession, CallParticipant, CallEvent models with migration 0004
- MeetingCallConsumer: join/leave, P2P SDP/ICE relay via per-user groups,
instructor mute/unmute/kick with DB audit and WS broadcast
- REST endpoints: GET/POST/DELETE /meetings/{id}/call/ (session lifecycle),
POST /moderate/ (mute/unmute/kick), POST /screen-share/, GET /events/ (audit log)
- IsMeetingModerator permission (accepts training:signoff or meeting:moderate)
- Services: get_or_create_call_session, end_call_session, apply_moderation_action,
toggle_screen_share with full CallEvent audit trail
- Integration tests covering REST lifecycle, moderation, and WebSocket signaling
Co-Authored-By: Paperclip <noreply@paperclip.ing>
19 lines
545 B
Python
19 lines
545 B
Python
import os
|
|
|
|
from django.core.asgi import get_asgi_application
|
|
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.prod")
|
|
|
|
django_asgi_app = get_asgi_application()
|
|
|
|
from channels.routing import ProtocolTypeRouter, URLRouter # noqa: E402
|
|
from training.routing import websocket_urlpatterns # noqa: E402
|
|
from training.middleware import JWTAuthMiddlewareStack # noqa: E402
|
|
|
|
application = ProtocolTypeRouter(
|
|
{
|
|
"http": django_asgi_app,
|
|
"websocket": JWTAuthMiddlewareStack(URLRouter(websocket_urlpatterns)),
|
|
}
|
|
)
|