Disclaimer: Flying through Linux and OpenSource. You might experience Freedom along with plenty of awesomeness.
I am a curious being and I love the freedom that is offered by Linux. Because of this, you will occasionally find me spending hours on pet projects that have nothing to do with what I do for a living.
In past couple posts, I shared my desire and my efforts to set up my own PBX in my home network. I also shared the discussion I had with a colleague who had successfully setup an intercom system that he used to talk with his family abroad. After spending numerous hours on this feat over past few days, last night I finished my setup and I now have all the functionality that I needed from this setup.
I installed FreeSWITCH on a Debian server that I have on my home network. It had to be compiled from source since PogoPlug houses an ARM processor and Debian repositories didn't have a packages for FreeSWITCH for arm architecture. But the instructions were easily available and installation was a piece of cake. Like I had mentioned in the previous post, the installation came pre-configured with 20 extensions for internal use, an demo IVR menu, and plenty of other features.
I was now able to register soft phone softwares running on our Linux desktops and laptops and my Android phone over WiFi within our home network and test the calling from one soft phone extension to another.
I now needed a sip gateway router that would allow me to connect my home phone line to the FreeSWITCH setup. I found a great deal on a Cisco/Linksys SPA 3102 sip gateway router. SPA 3102 allowed me to connect my incoming phone line on one jack and my home phone unit on the other.
I now had a PBX setup which was accessible to be via the home network for internal calling. I was also connected to my home phone line, which allowed me to make outbound calls and receive incoming calls.
Now one thing to keep in mind that even though SPA 3102 has a jack for phone line (FXO) and a jack to connect a physical phone (FXS) they operate on two separate extensions. However, now that we are in SIP/PBX territory, calls can be bridged and transferred from one extension to another. I was able to configure FreeSWITCH and SPA 3102 so that the calls received on the PSTN line (FXS) would be forwarded to Line 1 (FXO) where my phone was attached. I also configured FreeSWITCH to send the calls originating on internal extensions - Line 1 on SPA 3102 also being one of them - that are not handled internally, to send them outbound via PSTN line. My basic phone setup was restored and I now had the capability to make outbound calls from any computer from within my home network. Think Skype Out without paying an addition cent.
I mentioned earlier that I was able to register and test soft phone on my Android phone to my home FreeSWITCH server. This was done over WiFi. I was able to open ports on my home firewall for FreeSWITCH so that I could connect from an outside network. And I was successfully able to test this by getting on a different WiFi network that had Internet access. The next thing naturally was to do a quick test over 3G we'd be in business. Yeah, right. This was not as quick as I had anticipated it to be. I was able to originate outbound calls and receive incoming calls successfully, but there was no audio. After spending hours researching it, I found the answer hidden in plain sight, mocking me all this time.
SIP Servers and phones use what is called a STUN service to help with port discovery when connecting to other servers and phones behind NAT/firewall. I had already read about it briefly and had configured my server to use stun.freeswitch.org as the STUN service url. From the reviewing the logs, I discovered that the url was not reliable and down most of the time. There are however a number of free STUN services available and I found a webpage that listed quiet a few of those. FreeSWITCH comes with a STUN server testing utility and I was able to find one of the STUN servers that was indeed online. I configured my FreeSWITCH server to use it, and now I had audio on my Android phone over 3G.
All this was a fun and exciting experience overall. Besides the time I put in it, it cost me $43 that I paid for the SPA 3102. What are the practical applications you'd ask. There are plenty, and I plan to dedicate the next article discussing those.
I am a curious being and I love the freedom that is offered by Linux. Because of this, you will occasionally find me spending hours on pet projects that have nothing to do with what I do for a living.
In past couple posts, I shared my desire and my efforts to set up my own PBX in my home network. I also shared the discussion I had with a colleague who had successfully setup an intercom system that he used to talk with his family abroad. After spending numerous hours on this feat over past few days, last night I finished my setup and I now have all the functionality that I needed from this setup.
I installed FreeSWITCH on a Debian server that I have on my home network. It had to be compiled from source since PogoPlug houses an ARM processor and Debian repositories didn't have a packages for FreeSWITCH for arm architecture. But the instructions were easily available and installation was a piece of cake. Like I had mentioned in the previous post, the installation came pre-configured with 20 extensions for internal use, an demo IVR menu, and plenty of other features.
I was now able to register soft phone softwares running on our Linux desktops and laptops and my Android phone over WiFi within our home network and test the calling from one soft phone extension to another.
I now needed a sip gateway router that would allow me to connect my home phone line to the FreeSWITCH setup. I found a great deal on a Cisco/Linksys SPA 3102 sip gateway router. SPA 3102 allowed me to connect my incoming phone line on one jack and my home phone unit on the other.
I now had a PBX setup which was accessible to be via the home network for internal calling. I was also connected to my home phone line, which allowed me to make outbound calls and receive incoming calls.
Now one thing to keep in mind that even though SPA 3102 has a jack for phone line (FXO) and a jack to connect a physical phone (FXS) they operate on two separate extensions. However, now that we are in SIP/PBX territory, calls can be bridged and transferred from one extension to another. I was able to configure FreeSWITCH and SPA 3102 so that the calls received on the PSTN line (FXS) would be forwarded to Line 1 (FXO) where my phone was attached. I also configured FreeSWITCH to send the calls originating on internal extensions - Line 1 on SPA 3102 also being one of them - that are not handled internally, to send them outbound via PSTN line. My basic phone setup was restored and I now had the capability to make outbound calls from any computer from within my home network. Think Skype Out without paying an addition cent.
I mentioned earlier that I was able to register and test soft phone on my Android phone to my home FreeSWITCH server. This was done over WiFi. I was able to open ports on my home firewall for FreeSWITCH so that I could connect from an outside network. And I was successfully able to test this by getting on a different WiFi network that had Internet access. The next thing naturally was to do a quick test over 3G we'd be in business. Yeah, right. This was not as quick as I had anticipated it to be. I was able to originate outbound calls and receive incoming calls successfully, but there was no audio. After spending hours researching it, I found the answer hidden in plain sight, mocking me all this time.
SIP Servers and phones use what is called a STUN service to help with port discovery when connecting to other servers and phones behind NAT/firewall. I had already read about it briefly and had configured my server to use stun.freeswitch.org as the STUN service url. From the reviewing the logs, I discovered that the url was not reliable and down most of the time. There are however a number of free STUN services available and I found a webpage that listed quiet a few of those. FreeSWITCH comes with a STUN server testing utility and I was able to find one of the STUN servers that was indeed online. I configured my FreeSWITCH server to use it, and now I had audio on my Android phone over 3G.
All this was a fun and exciting experience overall. Besides the time I put in it, it cost me $43 that I paid for the SPA 3102. What are the practical applications you'd ask. There are plenty, and I plan to dedicate the next article discussing those.
Progress on this topic can be following in the following articles: