Blog wizard' Post

Interesting stuff behind the VoipNow CallAPI

We see a lot of questions in support and sales (especially after the VoipNow 1.6.2 release) about VoipNow CallAPI. It looks to be some confusion around this subject. In VoipNow we have two CallAPIs:

  • a very easy to use HTTP interface, you can use to send calls, list, hangup, etc using HTTP GET requests.
  • an Asterisk Manager interface that technically can be used with any client that can work with Asterisk Manager

I want to discuss about the Asterisk Manager interface, as it’s more difficult to understand. As you know VoipNow is a multitenant system. This means that you can have multiple customers on the same machine. You do not want customer X to see customer Y calls or to hangup them.

Unfortunately, the Asterisk manager does not care about multi-tenancy, scales very poorly with multiple connections and the authentication mechanisms are far from great. We could have rewritten the entire manager interface, but this would have created a management issue for our Asterisk build.

The natural solution was to create a proxy. There is one Open Source proxy called Astmanproxy, which is pretty well known, so the approach is not new. New was what we wanted to achieve with this proxy:

  • Integration with VoipNow. This means that the proxy should read the MySQL database
  • Quality of Service. We were particularly interested in limiting the number of connections and number of commands sent by a user, to add black list and whitelist per IP. Otherwise you cannot really open such a service to the Internet.
  • Filtering and isolation, this means that a user logging to Call API as customer X should receive only events that are related to customer X. The proxy should ignore any command that targets a resource not owned by customer X.
  • LUA scripting for requests and answers, so the engine could translate requests and server answers before they are sent to the customer. This way the proxy could work with virtually any Asterisk Manager client, because the user can use LUA to translate requests, if these are not properly made (clients are quite different).

When we started the project we want to build these features on Astmanproxy. It was an Open Source project and we didn’t want to spend time reinventing the hot water. Unfortunately after we added most of the features to Astmanproxy, we discovered a lot of issues with it under load tests (most issues due to the threading implementation), so we started to modify it extensively. I think that today only around 20% of the original code was preserved, which is not the brightest example of software engineering.

This project was made open source and will be committed to the upcoming 4PSA Developers Network which is due this summer. I will let you know of course as soon as it will become available.

Read More

Yes, we will start to post on this blog

This blog has been dead for the last two years. When we created it, we really wanted to share interesting things and visions with it, but unfortunately we were too busy to write here :(. The fact that we finally decided to do something about this was influenced by several things:

1. I think that the time spent on this blog will be usefull for our customers. I usually find myself in the position to explain over and over the same thing, and I could explain it only once. Here.
2. We reshaped the blog to be more like a “product blog”.  So most topics will cover products, functionality and features. Of course, there will be some general posts also.
3. I hope we will gather feedback from comments.

Please do not hesitate to comment.

Read More

Welcome!

Here, in the 4PSA Blog you will find articles written by 4PSA staff members and their friends. We hope that you will enjoy this new area because here there are interesting people who have something to say. There will be articles about software development, Open Source, Linux, servers, hosting, enterprise and so on. We do not have any settled limits. If it’s interesting, it will be published. If you can comment and contribute, we really appreciate it.

Read More