Get WebRTC SIP credentials
Provision (or fetch) SIP credentials for a WebRTC softphone tied to a contact-center user.
Endpoint: POST https://<base>/api/v2/GetWebRTC.php
Returns the SIP user / secret / realm needed for a WebRTC softphone (e.g., the Velip browser client). When the user does not have a SIP entry yet, the endpoint creates one in cd_sip_webrtc with a freshly generated random secret.
The returned credentials are tied to the contact-center user (userid) and the SIP realm picked from the customer’s WebSocket server config (cdcsu_cc_ws_server).
Authentication
Token authentication required. See Authentication.
Request
tsid — type: string — required
Token for the account.
userid — type: string — required
Contact-center user id (numeric). Used to derive the SIP username VW{cdcs_id}U{userid}.
Request example
```bash curl
curl -X POST ‘https://
-d ‘tsid=YOUR_TSID&userid=42’
## Response
```json 200 OK
{
"return": {
"status": "OK",
"status_code": "0",
"sipname": "VW1234U42",
"sipsecret": "x9d2KqLm",
"sipserver": "wss.velip.com.br"
}
}
-
return.sipname(string) — SIP username to register from the softphone. -
return.sipsecret(string) — SIP password. Generated once and persisted; subsequent calls return the same secret. -
return.sipserver(string) — Realm portion of the WebSocket server (host without port). Use it as the SIP domain.
Error codes
| Code | status |
Cause |
|---|---|---|
200 |
No userid |
Missing userid parameter. |
The endpoint inherits the global authentication codes.
Warning The SIP secret is generated by
generatePassword(12)and stored in plain text incd_sip_webrtc.secret. Treat the returned credentials like any other password — deliver them over HTTPS and keep them out of client-side logs.