단기 SIP 토큰 발급 (WebRTC/SIP 단말용)

View as Markdown
영구 SipCredential 로부터 단기 JWT 를 발급. 랜덤 ephemeral SIP username/password 와 함께 발급되며, JWT payload 에 SIP digest 인증에 필요한 모든 값(`ws_url`, `realm`, `sip_username`, `sip_password`, `allowed_caller_ids`)이 포함됨. 클라이언트는 JWT 를 디코드해서 JsSIP/SIP.js 등 SIP UA 에 그대로 사용. 서버측은 이 엔드포인트를 자체 백엔드에서 호출해 결과를 그대로 브라우저에 전달하는 패턴 권장 (API Key 노출 방지). 부모 자격은 `status=active`, `enabled=true` 여야 함.

Authentication

AuthorizationBearer

API Key를 Bearer 토큰으로 전달

Path parameters

accountIdstringRequired
credentialIdstringRequired

Request

This endpoint expects an object.
ttl_secondsintegerOptional1-86400Defaults to 3600

토큰 TTL (초). 1 ~ 86400 (24시간). 권장 5~30분 (통화 1건 길이).

subjectstringOptional

JWT sub 클레임. 미지정 시 user:<parent_credential_id>. 사용자별 추적/감사용.

Response

발급 성공 — JWT + ws_url + sip_uri

tokenstring

HS256 JWT. payload 클레임: account_id, credential_id (ephemeral), parent_credential_id (영구), sub, sip_username, sip_password, realm, ws_url, allowed_caller_ids, jti (= ephemeral credential id), iat, exp. 클라이언트가 SIP digest 인증(REGISTER/INVITE)에 사용. 서명 검증은 ClawOps 게이트웨이가 수행하므로 클라이언트는 디코드만 하면 됨.

token_typeenum
expires_atdatetime

JWT 만료 시각 (ISO 8601).

ws_urlstring

SIP-over-WebSocket 게이트웨이 URL. 클라이언트(JsSIP/SIP.js)가 WSS handshake 대상으로 사용.

sip_uristring

발급된 단기 SIP URI (<ephemeral_username>@<realm>).

Errors

400
Bad Request Error
404
Not Found Error
500
Internal Server Error