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
{
	"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
2name
stringThe unique name of the SIP gateway
3username
stringSIP Username
4passwordstringSIP password
5realmstringSIP realm / domain
6profilestring

SIP profile, one of the following values is specified:

  • nonreg - for SIP trunk without registration (5060/udp)
  • external - to connect to the SIP provider by login and password (5080/udp)
7domainstringWebitel domain with which the gateway is associated.
8paramsarrayAn array of additional parameters for FreeSWITCH..
9var | ivar | ovararrayAdditional 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