get_session

View as MarkdownOpen in Claude

Retrieve an active session by ID. Returns None if the session does not exist, has expired, or if its underlying process has died. Automatically calls touch() on the session to reset its expiration timer.

Parameters

session_id
strRequired

The session ID to look up.

Returns

Session or None

Example

1from signalwire.mcp_gateway import SessionManager
2
3manager = SessionManager(config)
4session = manager.get_session("call-abc-123")
5if session:
6 print(f"Session active for service: {session.service_name}")
7else:
8 print("Session not found or expired")