To create a new SIP gateway, you must send a POST request to the address of the Webitel Engine server with the specified request body. The following is an example of such a request:
POST
/api/v2/gateway
Content-Type: application/json X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNmMTQ3ZTFiLTk1ZGYtNDI1OC05ZT
M2LWQ4NWZkZDZlZDUzZiIsImV4cCI6MTQ5NzkwNjAwMDAwMCwiZCI6InNpdGUiLCJ0IjoiZG9tYWluIiwidiI6Mn0.o
-bcG_U3oJMN4r3YaBfSg9CcrZPANZulcapR4E6TSdg
BODY
{ "name": "myGW", "username": "4952-200", "password": "dvxhH5Lm32", "realm": "pbx.zadarma.com", "profile": "external", "domain": "test06.webitel.com", "params": [ { "name": "register", "value": "true" }, { "name": "extension-in-contact", "value": "true" } ], "var": [], "ivar": [], "ovar": [] }
The structure of the request body is described in the table below:
# | Title | Type | Value |
---|---|---|---|
2 | name | string | The unique name of the SIP gateway |
3 | username | string | SIP Username |
4 | password | string | SIP password |
5 | realm | string | SIP realm / domain |
6 | profile | string | SIP profile, one of the following values is specified:
|
7 | domain | string | Webitel domain with which the gateway is associated. |
8 | params | array | An array of additional parameters for FreeSWITCH.. |
9 | var | ivar | ovar | array | Additional variables. |
Information viewing, updating or deletion occurs through GET, PUT and DELETE requests, respectively:
GET
/api/v2/gateway/myGW
X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNmMTQ3ZTFiLTk1ZGYtNDI1OC05ZT
M2LWQ4NWZkZDZlZDUzZiIsImV4cCI6MTQ5NzkwNjAwMDAwMCwiZCI6InNpdGUiLCJ0IjoiZG9tYWluIiwidiI6Mn0.o
-bcG_U3oJMN4r3YaBfSg9CcrZPANZulcapR4E6TSdg