pfSense Support Subscription

Author Topic: FreeSWITCH package for pfSense.  (Read 7599 times)

0 Members and 1 Guest are viewing this topic.

Offline mcrane

  • Sr. Member
  • ****
  • Posts: 495
  • Karma: +0/-0
    • View Profile
FreeSWITCH package for pfSense.
« on: August 13, 2008, 02:44:04 am »
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.
« Last Edit: August 20, 2008, 02:48:39 pm by mcrane »

Offline billm

  • Administrator
  • Hero Member
  • *****
  • Posts: 731
  • Karma: +1/-1
    • View Profile
    • UCSecurity - Technology discovery and ramblings
Re: FreeSWITCH package for pfSense.
« Reply #1 on: August 20, 2008, 01:00:24 pm »
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
pfSense core developer
blog - http://www.ucsecurity.com/
twitter - billmarquette

Offline mcrane

  • Sr. Member
  • ****
  • Posts: 495
  • Karma: +0/-0
    • View Profile
Re: FreeSWITCH package for pfSense.
« Reply #2 on: August 20, 2008, 09:03:37 pm »
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).






Offline mcrane

  • Sr. Member
  • ****
  • Posts: 495
  • Karma: +0/-0
    • View Profile
Re: FreeSWITCH package for pfSense.
« Reply #3 on: September 24, 2008, 04:20:32 am »
The developer documetation was very helpful at:
http://doc.pfsense.org/index.php/Developing_Packages

Using 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#msg16925

The 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.

Offline ron

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: FreeSWITCH package for pfSense.
« Reply #4 on: September 25, 2008, 12:49:43 am »
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 <rcfile></rcfile> 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

Offline mcrane

  • Sr. Member
  • ****
  • Posts: 495
  • Karma: +0/-0
    • View Profile
Re: FreeSWITCH package for pfSense.
« Reply #5 on: September 25, 2008, 05:56:28 am »
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.

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 <rcfile></rcfile> 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.

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.



« Last Edit: September 25, 2008, 06:05:44 am by mcrane »

Offline ermal

  • Hero Member
  • *****
  • Posts: 3829
  • Karma: +67/-4
    • View Profile
Re: FreeSWITCH package for pfSense.
« Reply #6 on: September 25, 2008, 08:33:13 am »
Can you post the code, even privately, so we can help better.

Offline mcrane

  • Sr. Member
  • ****
  • Posts: 495
  • Karma: +0/-0
    • View Profile
Re: FreeSWITCH package for pfSense.
« Reply #7 on: September 26, 2008, 05:02:59 am »
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.

Offline mcrane

  • Sr. Member
  • ****
  • Posts: 495
  • Karma: +0/-0
    • View Profile
Re: FreeSWITCH package for pfSense.
« Reply #8 on: October 02, 2008, 03:06:24 am »
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


Offline mcrane

  • Sr. Member
  • ****
  • Posts: 495
  • Karma: +0/-0
    • View Profile
Re: FreeSWITCH package for pfSense.
« Reply #9 on: October 06, 2008, 05:06:35 pm »
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/
« Last Edit: October 07, 2008, 02:00:55 am by mcrane »

Offline slimtim

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: FreeSWITCH package for pfSense.
« Reply #10 on: October 07, 2008, 06:38:30 am »
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

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/

Offline mcrane

  • Sr. Member
  • ****
  • Posts: 495
  • Karma: +0/-0
    • View Profile
Re: FreeSWITCH package for pfSense.
« Reply #11 on: October 07, 2008, 09:53:24 am »
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