BigBlueButton is a known Open Source multi-party Video Conferencing platform. For all good reasons it made it to my software stack for our Smart Glass based Remote Collaboration platform.
First, some background - It all started couple of years back when BigBlueButton (BBB) was at release 0.9 and they had discontinued the native android client that was developed for 0.8 version of BBB. For the android based Smart Glass platform of ours, native android client was crucial, so i decided to use 0.8 version of BBB and built Smart Glass based client on the same lines as 0.8 version of BBB.
The prototype stage of our product was over soon and time was for serious business. Back in the prototype phase, we didn't worry too much about getting all features - including voice conference to work from the android device. It was now a must-to-have feature and demanded focused effort.
So got an opportunity to take a deep dive into the architecture of the BBB platform - mainly voice conferencing engine. BBB uses "FreeSWITCH" opensource telephony engine for voice communication across the networks. I basically had couple of options -
1. Get BBB 0.8 voice conference to work from outside/external client
2. Upgrade to BBB 0.9
3. Upgrade to BBB 1.1 ( latest version )
Of these #3 was ruled out since it had moved long long away from 0.8 version and does not have android client from BBB and integrating 0.8 android client with this would have been a huge challenge. So considering the timelines, choice was to be made between #1 and #2. Considering the newer version and few enhanced abilities in 0.9, decided to give it a try. It was a journey in itself ( and some great experience ) , getting the 0.8 android client to work with 0.9 version of BBB. Many internal things were changed from 0.8 to 0.9 and finally was able to connect to BBB 0.9 server from Android.
The only thing remaining in this BBB 0.9 with Native Android client was getting voice conference to work from outside/external client. By default, since FreeSWITCH is prone to external attacks, it is usually packaged and run as standalone service and accessible only on the loopback/local IP (127.0.0.1). BBB server apps access FreeSWITCH locally. Getting it exposed to allow external clients ( AKA SIP Clients ) wasn't trivial. The idea was simple, run the FreeSWITCH service on the public IP. But getting it to work by both - local BBB apps and external mobile/SIP client was not straightforward, and possibly getting this to work on Amazon Web Services (AWS) was additional challenge.
If one googles on this challenge, there are lot of references, all talking variations of configurations, ideas, thoughts for various versions of BBB and FreeSWITCH, needless to say, nothing worked for me. But one thing was common - all talked about same set of configuration files. While no combination of configurations worked entirely, all the way along i was certain that I was on right track since logically it was sounding correct. Initially the android client voice connection was "Timing Out", at some point of time, I was getting "Connection Refused", later the client was able to connect, but "automatically disconnecting" after 30 secs, later "one way voice call" and finally it all came through fine. It was able to connect Voice Call from android and have a two way communication.
This enabled the android client to connect to BBB 0.8 and 0.81 seamlessly, but voice conference on 0.91 was still an issue. I had to change the default BBB - SIP dial plan to get this to work. By default the dial plan was rejecting the external callers based on IP. I had to modify the condition to accommodate both internal ( BBB Web ) and external (SIP) clients.
Several resources and tools helped all the way along, and many thanks to BBB Developer Google Groups. Last, but not the least, was the X-Lite SIP Soft Phone client. The detailed messages captured and logged by X-Lite SIP Soft Phone were really helpful nailing down the last bits of this challenge.
Long story short, I now have a customized BBB Android client that works seamlessly with BBB 0.8, BBB 0.81 and BBB 0.91. Here are the set of configuration files with settings that worked for me to enable BBB Chat, Audio and Video conferencing (both web and mobile ) on a Ubuntu 10.04 Linux instance inside a Virtual Private Network ( VPC ) on AWS. I will soon fork the BBB repositories (for Android client) and publish these updates to the community.
The forked and extended version of mconf-mobile repository :
https://www.github.com/abhaychaware/mconf-mobile
-------------------------------------
******* BBB 0.80 ********
-------------------------------------
Red5 Configuration files
-------------------------------------
/usr/share/red5/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties
> change esl.host = internal ip of the server ( not 127.0.0.1 )
/usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties
> change sip.server.host = internal ip of the server ( not 127.0.0.1 )
FreeSWITCH Configuration files
-----------------------------------------------
/opt/freeswitch/conf/autoload_configs/event_socket.conf.xml
> change value of "listen-ip" param to internal ip of the server ( not 127.0.0.1 )
/opt/freeswitch/conf/vars.xml
> delete the line that defines value for variable local_ip_v4 i.e. <X-PRE-PROCESS cmd="set" data="local_ip_v4=127.0.0.1"/>
> confirm that "external_rtp_ip" and "external_sip_ip" are set to "stun:stun.freeswitch.org"
/opt/freeswitch/conf/sip_profiles/external.xml
> change these params to have external_rtp_ip and external_sip_ip respectively.
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_sip_ip}"/>
/opt/freeswitch/conf/directory/default.xml
-------------------------------------
******* BBB 0.81 ********
-------------------------------------
Red5 Configuration files
-------------------------------------
/usr/share/red5/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties
> change freeswitch.esl.host = internal ip of the server ( not 127.0.0.1 )
/usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties
> change bbb.sip.app.ip = internal ip of the server ( not 127.0.0.1 )
> change freeswitch.ip = internal ip of the server ( not 127.0.0.1 )
FreeSWITCH Configuration files
-----------------------------------------------
/opt/freeswitch/conf/autoload_configs/event_socket.conf.xml
> change value of "listen-ip" param to internal ip of the server ( not 127.0.0.1 )
/opt/freeswitch/conf/vars.xml
> delete the line that defines value for variable local_ip_v4 i.e. <X-PRE-PROCESS cmd="set" data="local_ip_v4=127.0.0.1"/>
> confirm that "external_rtp_ip" and "external_sip_ip" are set to the public IP of the server an not "stun:stun.freeswitch.org"
/opt/freeswitch/conf/sip_profiles/external.xml
> change these params to have external_rtp_ip and external_sip_ip respectively.
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_sip_ip}"/>
/opt/freeswitch/conf/directory/default.xml
-------------------------------------
******* BBB 0.91 ********
-------------------------------------
Red5 Configuration files
-------------------------------------
/usr/share/red5/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties
> change esl.host = internal ip of the server ( not 127.0.0.1 )
/usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties
> change sip.server.host = internal ip of the server ( not 127.0.0.1 )
-----------------------------------------------
FreeSWITCH Configuration files
-----------------------------------------------
/opt/freeswitch/conf/autoload_configs/event_socket.conf.xml
> change value of "listen-ip" param to internal ip of the server ( not 127.0.0.1 )
/opt/freeswitch/conf/vars.xml
> edit the line that defines value for variable local_ip_v4 i.e. <X-PRE-PROCESS cmd="set" data="local_ip_v4=127.0.0.1"/>, set it to server's internal IP.
> confirm that "external_rtp_ip" and "external_sip_ip" are set to the public IP of the server and not "stun:stun.freeswitch.org"
/opt/freeswitch/conf/sip_profiles/external.xml
> change these params to have external_rtp_ip and external_sip_ip respectively.
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_sip_ip}"/>
/opt/freeswitch/conf/dialplan/public/bbb_sip.xml
> Modify the condition to allow both external and internal callers to connect
/opt/freeswitch/conf/directory/default.xml
Next steps, wait for BBB 1.1's awesome HTML5 Client to start supporting two way Camera / Video sharing, again exciting times ahead.
First, some background - It all started couple of years back when BigBlueButton (BBB) was at release 0.9 and they had discontinued the native android client that was developed for 0.8 version of BBB. For the android based Smart Glass platform of ours, native android client was crucial, so i decided to use 0.8 version of BBB and built Smart Glass based client on the same lines as 0.8 version of BBB.
The prototype stage of our product was over soon and time was for serious business. Back in the prototype phase, we didn't worry too much about getting all features - including voice conference to work from the android device. It was now a must-to-have feature and demanded focused effort.
So got an opportunity to take a deep dive into the architecture of the BBB platform - mainly voice conferencing engine. BBB uses "FreeSWITCH" opensource telephony engine for voice communication across the networks. I basically had couple of options -
1. Get BBB 0.8 voice conference to work from outside/external client
2. Upgrade to BBB 0.9
3. Upgrade to BBB 1.1 ( latest version )
Of these #3 was ruled out since it had moved long long away from 0.8 version and does not have android client from BBB and integrating 0.8 android client with this would have been a huge challenge. So considering the timelines, choice was to be made between #1 and #2. Considering the newer version and few enhanced abilities in 0.9, decided to give it a try. It was a journey in itself ( and some great experience ) , getting the 0.8 android client to work with 0.9 version of BBB. Many internal things were changed from 0.8 to 0.9 and finally was able to connect to BBB 0.9 server from Android.
The only thing remaining in this BBB 0.9 with Native Android client was getting voice conference to work from outside/external client. By default, since FreeSWITCH is prone to external attacks, it is usually packaged and run as standalone service and accessible only on the loopback/local IP (127.0.0.1). BBB server apps access FreeSWITCH locally. Getting it exposed to allow external clients ( AKA SIP Clients ) wasn't trivial. The idea was simple, run the FreeSWITCH service on the public IP. But getting it to work by both - local BBB apps and external mobile/SIP client was not straightforward, and possibly getting this to work on Amazon Web Services (AWS) was additional challenge.
If one googles on this challenge, there are lot of references, all talking variations of configurations, ideas, thoughts for various versions of BBB and FreeSWITCH, needless to say, nothing worked for me. But one thing was common - all talked about same set of configuration files. While no combination of configurations worked entirely, all the way along i was certain that I was on right track since logically it was sounding correct. Initially the android client voice connection was "Timing Out", at some point of time, I was getting "Connection Refused", later the client was able to connect, but "automatically disconnecting" after 30 secs, later "one way voice call" and finally it all came through fine. It was able to connect Voice Call from android and have a two way communication.
This enabled the android client to connect to BBB 0.8 and 0.81 seamlessly, but voice conference on 0.91 was still an issue. I had to change the default BBB - SIP dial plan to get this to work. By default the dial plan was rejecting the external callers based on IP. I had to modify the condition to accommodate both internal ( BBB Web ) and external (SIP) clients.
Several resources and tools helped all the way along, and many thanks to BBB Developer Google Groups. Last, but not the least, was the X-Lite SIP Soft Phone client. The detailed messages captured and logged by X-Lite SIP Soft Phone were really helpful nailing down the last bits of this challenge.
Long story short, I now have a customized BBB Android client that works seamlessly with BBB 0.8, BBB 0.81 and BBB 0.91. Here are the set of configuration files with settings that worked for me to enable BBB Chat, Audio and Video conferencing (both web and mobile ) on a Ubuntu 10.04 Linux instance inside a Virtual Private Network ( VPC ) on AWS. I will soon fork the BBB repositories (for Android client) and publish these updates to the community.
The forked and extended version of mconf-mobile repository :
https://www.github.com/abhaychaware/mconf-mobile
-------------------------------------
******* BBB 0.80 ********
-------------------------------------
Red5 Configuration files
-------------------------------------
/usr/share/red5/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties
> change esl.host = internal ip of the server ( not 127.0.0.1 )
/usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties
> change sip.server.host = internal ip of the server ( not 127.0.0.1 )
FreeSWITCH Configuration files
-----------------------------------------------
/opt/freeswitch/conf/autoload_configs/event_socket.conf.xml
> change value of "listen-ip" param to internal ip of the server ( not 127.0.0.1 )
/opt/freeswitch/conf/vars.xml
> delete the line that defines value for variable local_ip_v4 i.e. <X-PRE-PROCESS cmd="set" data="local_ip_v4=127.0.0.1"/>
> confirm that "external_rtp_ip" and "external_sip_ip" are set to "stun:stun.freeswitch.org"
/opt/freeswitch/conf/sip_profiles/external.xml
> change these params to have external_rtp_ip and external_sip_ip respectively.
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_sip_ip}"/>
/opt/freeswitch/conf/directory/default.xml
> Add a domain entry for the public IP of the server
-------------------------------------
******* BBB 0.81 ********
-------------------------------------
Red5 Configuration files
-------------------------------------
/usr/share/red5/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties
> change freeswitch.esl.host = internal ip of the server ( not 127.0.0.1 )
/usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties
> change bbb.sip.app.ip = internal ip of the server ( not 127.0.0.1 )
> change freeswitch.ip = internal ip of the server ( not 127.0.0.1 )
FreeSWITCH Configuration files
-----------------------------------------------
/opt/freeswitch/conf/autoload_configs/event_socket.conf.xml
> change value of "listen-ip" param to internal ip of the server ( not 127.0.0.1 )
/opt/freeswitch/conf/vars.xml
> delete the line that defines value for variable local_ip_v4 i.e. <X-PRE-PROCESS cmd="set" data="local_ip_v4=127.0.0.1"/>
> confirm that "external_rtp_ip" and "external_sip_ip" are set to the public IP of the server an not "stun:stun.freeswitch.org"
/opt/freeswitch/conf/sip_profiles/external.xml
> change these params to have external_rtp_ip and external_sip_ip respectively.
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_sip_ip}"/>
/opt/freeswitch/conf/directory/default.xml
> Add a domain entry for the public IP of the server
-------------------------------------
******* BBB 0.91 ********
-------------------------------------
Red5 Configuration files
-------------------------------------
/usr/share/red5/webapps/bigbluebutton/WEB-INF/bigbluebutton.properties
> change esl.host = internal ip of the server ( not 127.0.0.1 )
/usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties
> change sip.server.host = internal ip of the server ( not 127.0.0.1 )
-----------------------------------------------
FreeSWITCH Configuration files
-----------------------------------------------
/opt/freeswitch/conf/autoload_configs/event_socket.conf.xml
> change value of "listen-ip" param to internal ip of the server ( not 127.0.0.1 )
/opt/freeswitch/conf/vars.xml
> edit the line that defines value for variable local_ip_v4 i.e. <X-PRE-PROCESS cmd="set" data="local_ip_v4=127.0.0.1"/>, set it to server's internal IP.
> confirm that "external_rtp_ip" and "external_sip_ip" are set to the public IP of the server and not "stun:stun.freeswitch.org"
/opt/freeswitch/conf/sip_profiles/external.xml
> change these params to have external_rtp_ip and external_sip_ip respectively.
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_sip_ip}"/>
> Modify the condition to allow both external and internal callers to connect
/opt/freeswitch/conf/directory/default.xml
> Add a domain entry for the public IP of the server
Next steps, wait for BBB 1.1's awesome HTML5 Client to start supporting two way Camera / Video sharing, again exciting times ahead.