There are four types of REST methods
The connect method determines behavior of all other methods.
The connect method should return in the response only those data that it really received from WCS with an exception of the case when some field in the response should be explicitly overwritten or another status must be returned.
Other methods are recommended to return in the response only those data that they received with an exception of the case when some field in the response should be explicitly overwritten or another status must be returned.
All methods should return the 200 OK HTTP status with an exception of the case when another status should be explicitly returned, for example, 403 Forbidden.
These events may be interrupted by web server:
These events may be interrupted, but it is impractical:
This events can not be cancelled by web server because the event has already happened on WCS side, and only notification is sent to web server
Incoming calls may be interrupted by web server. WCS notifies caller in this case.
If REST method of any type was initiated using REST API, it should not be declined by web server.
An interaction error occurs when web server returns status other than 200 OK, or some error prevents access to web server. Actions taken depending on restOnError field of restClientConfig object and method type, described below:
When SIP status 4xx, 5xx, 6xx is received, or other error not concerning to REST is occured, an appropriate event will be initiated with FAILED status and error description in 'info' field. This event will be delivered to web server and then to client according to the rules defined in restClientConfig.
For example, if SIP server returns 403 FORBIDDEN on outgoing call then CallStatusEvent event with status='FAILED', info='SIP 403 FORBIDDEN' and sipMessageRaw='the original SIP message' will be sent to the web server and to the client.
If the error can not be correlated with any of the existing events then ErrorEvent event will be initiated with error description in 'info' field.
Let’s review one method of each type (the remaining methods behave similarly within the corresponding type).