Tutorial on Linux + Asterisk +MySQL + Java – part 1

This part of the tutorial is an introduction about the combined use of Asterisk, Java and MySQL on a Linux box.

In the internet era Linux has a very important role for the famous LAMP stack: Linux + Apache + MySQL + PHP.

But I am not a web-type; I had some of the greatest fun working with VoIP/PBX, more specifically with Asterisk, so I decided to share my experience, and I named the environment I have worked with LAMJ, which stands for Linux + Asterisk + MySQL + Java.
I won’t talk about Linux and MySQL, but I will give a very brief introduction about PBX.

PBX is the acronym of Private Branch Exchange. It could refer to a hardware device or to a software running on a computer. Asterisk is one of the most diffused software PBX, but there are also others, like Callweaver and FreeSWITCH (well, FreeSWITCH is not exactly a PBX, it’s author describe it as a soft switch in his comparison with Asterisk).
VoIP stands for Voice Over IP.
Technically VoIP and PBX are not dependent one to the other. A PBX could be connected only to a PSTN or only to a VoIP network. The third option, the one that I found most interesting, is that a PBX could be connected to both a PSTN and a VoIP network, acting as a sort of bridge between the twos.
This is not to be confused with PSTN/VoIP Gateway, where the communication is forwarded from PSTN to VoIP (and the other way around).
A software PBX could be connected to communication channel(s) in one or more of the following ways:

  1. with the computer’s internet connection
  2. with an internal card (Digium, Sangoma, Rhino, etc)
  3. with a Channel bank
  4. with a Gateway (internal or from an external provider) to which it is connected via ethernet/internet.

Currently there are different VoIP protocols, the most known being SIP, IAX, and H.323.
Probably SIP protocol is the most widely used, at least for connection between end-user device/software and PBX, even if it may require some tweaking to overcome NAT issues, while IAX maybe has better performance, but it is used mostly for inter-PBX communication.
Please keep in mind that I am a developer, not a network/VoIP engineer, so feel free to correct me if I wrote something wrong in the above introduction.

In the next part we will cover the Realtime configuration. C YA!!!


3 thoughts on “Tutorial on Linux + Asterisk +MySQL + Java – part 1

  1. Hi, the above posting was very useful for a beginner like me.
    I am a beginner for asterisk. But i am in dilemma whether to use java with asterisk or php with asterisk?
    I want to go for asterisk with java. so can you please let me know what are the pros and cons of it. I came to know that asterisk was scalable up to 500 concurrent users. where as freeswitch is making it possible to interface with other open source PABX systems.
    i hope a reply for my post or to aishwaryabelide@gmail.com


    • Hi,
      this is the first of a series of post, in the following I will go deeper about java coding.
      All the projects I have done with asterisk+java where parts of biggers applications or even servlets, where a lot of server-side code was required, so java was the obvious choice, at least for me. Moreover, I found asterisk-java really easy and powerful to use, its mailing list (https://lists.sourceforge.net/lists/listinfo/asterisk-java-users) is pretty active and the project seems to going on – all things important from long term perspective.
      Unfortunately I do not use php, so I can not give you any advice about it.
      About freeswitch, I found it really interesting, and I like the author point of view and approach, but I did not have the chance to work with it – and I have never used any of the Java API available for it (http://freeswitch-java.sourceforge.net/, http://wiki.freeswitch.org/wiki/Java_ESL_Client).
      Technically Asterisk and FreeSwitch are different, though, so you should read carefully their specifications and your needs to see which is the best for you.
      About Asterisk performance, I used a PBX provider (https://www.aretta.com/ – please keep in mind I have nothing to do with them and I do not work for them; simply, at that time I found their service good): maybe you may ask them.
      Hope to have been helpful.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s