Skip to the content.

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: stringrequired

Token for the account.

userid — type: stringrequired

Contact-center user id (numeric). Used to derive the SIP username VW{cdcs_id}U{userid}.

Request example

```bash curl curl -X POST ‘https:///api/v2/GetWebRTC.php’
-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"
  }
}

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 in cd_sip_webrtc.secret. Treat the returned credentials like any other password — deliver them over HTTPS and keep them out of client-side logs.