FreeSWITCH package for pfSense.
-
A couple of hours of work and I got FreeSWITCH installed, configured and running great on pfSense 1.2.1. It bound itself to the WAN IP and required a WAN rule in order to have remote phones connect to it. Internal and external phones access the WAN from the same dynamic DNS name.
I want to build and maintain a pfSense package for FreeSWITCH. First version will be built for FreeBSD7.
My questions is this… if I build it will this kind of package be accepted and made available under PFSense GUI System -> Packages? There is no point spending the time making it if I can't share it and let other people use it.
I plan to write at least a simple GUI interface to configure it. My initial focus is a GUI to setup basic PBX for a SOHO. After that I will may attempt to build a basic B2BUA.
I will use info and links I have seen given on the forum and use other packages to learn by example how to build a package. I will also work on documenting that process.
FreeSWITCH is the next Generation of Open Source VOIP. Here is a few things it can do and is by no means limited to just these.
It can be a Voice SWITCH/B2BUA, PBX or soft phone.
Multi-Platform (FreeBSD, Mac, Linux, and Windows)
Sound can be in 8khz, 16khz, or 32khz.
Stable
Scalable
License is MPL (mozilla public license)
Speech Recognition
Text to Speech
XMLRPC
Socket Events
VOIP Application Developers Dream come true. -
I'd be interested in making use of the package. And can certainly help getting it into the package repo. Contact me via email - billm at pfsense dot org, if you are still interested in putting together a package for this.
–Bill
-
Great I will send you email you and get this going.
So far on my system I have had it running well for about a week. Earlier this week I added it to Status -> Service for monitoring and restarting the Freeswitch service. Also have built a page that communicates to Freeswitch with xmlrpc to monitor current calls… (includes ability to place a call on/off hold, start/stop recording).
-
The developer documetation was very helpful at:
http://doc.pfsense.org/index.php/Developing_PackagesUsing this documentation I was able to setup a test package system to use for development.
And some info was helpful at:
http://forum.pfsense.org/index.php/topic,312.msg16925.html#msg16925The FreeSWITCH package now installs and is operational. The de-install of the package isn't working yet.
It seems that the custom_php_deinstall_command(); function is not working.
<custom_php_deinstall_command>custom_php_deinstall_command();</custom_php_deinstall_command>Also noticed that in services spamd service will stop but starting it back up from 'Services' appears to hang. However using SSH to remote into pfSense and then: ps -waux | grep spamd I have verified that spamd does actually start. So PHP just doesn't release the process on its own. I'm having the same problem with the FreeSWITCH package I'm building.
-
Give your custom_php_deinstall_command routine a unique name for your package (such as freeswitch_deinstall_command() and make sure it matches the deinstall routine you put in your package's .inc file. It should work then.
For the service restarting issue, make sure the <executable></executable>tag in the package's .xml file holds the appropriate name for the executable that actually runs for the service. This tag value is used to determine whether the service is running in the status screen or not. If the specified value does not match the command exactly, it won't show the status properly. The script should call that executable for you when starting. If they don't match the status won't show correctly.
For example, if you have <executable>bind</executable>, but your rcfile calls a daemon "named", you won't see the service as running on the service screen although named may actually be running fine. Think something like "ps ax | grep <executable>" for determining if the service is running or not.
Regards,
Ron</executable> -
@ron:
Give your custom_php_deinstall_command routine a unique name for your package (such as freeswitch_deinstall_command() and make sure it matches the deinstall routine you put in your package's .inc file. It should work then.
Thanks! The package now uninstalls correctly.
@ron:
For the service restarting issue, make sure the <executable></executable>tag in the package's .xml file holds the appropriate name for the executable that actually runs for the service. This tag value is used to determine whether the service is running in the status screen or not. If the specified value does not match the command exactly, it won't show the status properly. The script should call that executable for you when starting. If they don't match the status won't show correctly.
For example, if you have <executable>bind</executable>, but your rcfile calls a daemon "named", you won't see the service as running on the service screen although named may actually be running fine. Think something like "ps ax | grep <executable>" for determining if the service is running or not.</executable>
I had the service status working on Tuesday. it took a while to discover the resolution on my own. I wish that I had the instructions you gave above earlier in the day. The FreeSWITCH service will start manually from the console or SSH with either /usr/local/etc/rc.d/freeswitch start or with /usr/local/freeswitch/bin/./freeswitch -nc. The service will start fine when the firewall boots up. The strange issue is that if I go to Status: Services first stop the service and then start it then it never finishes loading the page. However the service is started. spamd service also shows the same problem at least from pfSense 1.2.1. If in the freeswitch.inc file if I run start_service("freeswitch"); at the end of the install function then the installation never completes.
I've fixed the initial starting of the process after installation by using:
$handle = popen("/usr/local/etc/rc.d/freeswitch.sh start", "r");
pclose($handle);Thanks again for the help.
-
Can you post the code, even privately, so we can help better.
-
@ermal:
Can you post the code, even privately, so we can help better.
Thanks for offering to look at this.
The FreeSWITCH package for pfSense is in development however it is operational. At this time the settings tab needs work as well as the dialplan. As well as the problem previously mentioned under 'Services' the 'freeswitch' service will stop correctly but the start will run the application but unfortunately hangs the GUI. Using PHP's popen I was able to get it to start after the install. Rebooting will start the service with the rc.d script or manually starting from SSH also works fine.
Here is how to view the current package.
Modify the following in /etc/inc/globals.inc
"xmlrpcbaseurl" => "portableusbapps.com",Then browse System -> Packages and you will be able to install the FreeSWITCH package.
Requires FreeBSD7 so far all testing has been done on pfSense 1.2.1. It might also work on pfSense 1.3 but this hasn't been tested.
-
I have upgraded FreeSWITCH to a later version. Now Start and Stop is working great from the Services page. However I did notice that spamd still has a problem starting from Status -> Services page.
New version is a little larger as I have included HD sounds for high definition music on hold. I have one or two things left to do and then I will make it public hopefully sometime on Thursday.
Best Regards,
Mark -
The package is complete for pfSense 1.2.1 and ready to run as a Proxy or as a PBX. I have it on 2 live systems adding more this week.
Here are some slightly outdated Screen Shots. I have added 3 more tabs including a 'Status'. I will update them soon as soon as I can.
http://portableusbapps.com/images/FreeSWITCH/ -
mcrane,
Very impressive work you've done. I wish I had half your talent. :)
How do I know if I have the latest edition of your package? (I already downloaded the FreeSwitch package before your current post here)
-TimJ
@mcrane:
The package is complete for pfSense 1.2.1 and ready to run as a Proxy or as a PBX. I have it on 2 live systems adding more this week.
Here are some slightly outdated Screen Shots. I have added 3 more tabs including a 'Status'. I will update them soon as soon as I can.
http://portableusbapps.com/images/FreeSWITCH/ -
The latest version has a 'Status' tab. If you downloaded FreeSWITCH without modifying /etc/inc/globals.inc then you have the latest version. Any new changes after launch will get its version incremented.
Mark