Skip to content

Validation Mechanisms

flaviogoncalves edited this page Jul 2, 2019 · 2 revisions

TFPS adopts two types of integration mechanisms with your IP PBX or Sotswitch. You may use SIP redirect calls or and HTTP restful API.

If you consider Asterisk, FreeSwitch, Yate and older versions of OpenSIPS and Kamailio, you will verify that a HTTP call to an API is usually made in a synchronous way. This means your IP PBX will be holding a process while it waits for the answer of a validation check. If the number of calls per second is high, you run the risk of halting your SIP processing, mainly if the response time is high, such as 100ms per check.

In the other hand using SIP redirects, once you have send an INVITE to the SIP redirector, the system is ready to process other SIP requests. It will only start a new process when an answer arrives from the SIP redirector. Thus a SIP redirect operates asynchronously, much faster and holding a lot less resources then a restful API.

Check the images below

Suppose we can spawn only two process per time, the time to send a request is 1ms and the response time is 100ms. In the first case with the REST API we would send two calls in the first 1ms and wait for the answer for 100ms and then send two additional requests and wait for another 100ms. The total time to process would be 1+100+1+100 = 202ms. In the second case using SIP redirects, we would process two requests at 1ms, plus two requests at 1ms. After 100ms we would process the answer in 1ms and two other answers in another 1 ms. The total time would be 2+100+2 = 104 ms. Additionally the processing would be non-blocking.

That's why we recommend for telephony server to use SIP redirects as a way to get information from a server. Many other systems such as Local Number Portability Servers and Least Cost Routing servers also use SIP redirects because of its performance and compatibility.

Clone this wiki locally