FreeSWITCH package for pfSense 1.2.1 and 2.0 released. PBX or Proxy
-
First off thank you for all the help. I think that once this is all setup and tested it may make sense to provide you documentation of how we have set it up and add your settings to it and present it as a tutorial to share to others for configuring Freeswitch with this case scenario.
A variety of tutorials is a good thing. No one is likely to complain about too much documentation. Keep in mind much of the information at wiki.freeswitch.org still applies to this package.
So after reading your response I will follow your direction and plug the Ethernet into the WAN network interface, as you explained that it will eliminate that whole NAT stuff.
Ok.
So…
We have a PFSENSE firewall and then in the network we have a PFSENSE / Freeswitch device with 2 Network interfaces but we use just the WAN set with DHCP [ the address is static given from the DHCP Server ]DHCP is fine as long as its is reserved static IP.
Now I suppose that we still need to open ports and add port forwarders to direct traffic to the FREESwitch box…
Where can I find all that Jazz ? and do I need to follow the steps of implementing the sipproxy package on either the PFSENSE box or the Freeswitch box ?You don't need to over complicate things add more complexity if you need it. So for example siproxd may not be needed. I would only through it in the mix if I needed it. Your phones will all be talking to the phone system as in the pfSense FreeSWITCH box. It is the only thing that will talk outside of the network to a VoIP provider (ITSP). If there is someone that knows Siproxd better than me feel free to share your knowledge but as far as I'm aware siproxd is most useful for situations where you have multiple devices in one network going out to an offsite PBX or VoIP provider.
On the machine that is the dedicated pfSense FreeSWITCH box set some 'Rules' on it to allow the VoIP traffic to the WAN interface. SIP protocol on FreeSWITCH uses 5060 - 5090 and can communicate over TCP or UDP. RTP (Real time protocol) uses ports 16384 - 32768 UDP. You do not need to configure NAT. It is not necessary to configure because FreeSWITCH will bind to the WAN a translation of the WAN address to LAN is not needed in this case unless you make FreeSWITCH bind to the LAN.
-
tusc notified me of some bugs he had found today. An issue where in some cases you would see an error on the 'Rec' tab. And there was a problem on the 'Dialplan' tab if you edited and then saved the dialplan the dialplan information was being saved to the wrong position xml path in pfSense. These bugs have been fixed. It is highly recommended you upgrade your install.
Make sure you are using version 0.4.2 or higher. To do this use the backup button on the status tab then remove the package and install it again.
Please feel free to post suggestions, encouragement, or bugs so they can be fixed immediately.
Best Regards,
Mark
-
Another improvement to note the FreeSWITCH package no longer requires the LAN interface to drive the 'Status' page and some of the other socket communication. This clears the way for appliance support.
Conference:
Default config has three sets of conference lines one for 8khz, 16khz and 32khz audio.8khz extension 3001-3099
16khz extensions 3101-3199
32khz extensions 3201-3299IVR example:
5000Call Park:
park 5900
unpark 5901Echo Test:
9996Hold Music:
9999Call Groups
Ring several phones at once. Ring all phone extensions in a group all at once or in order. Any two digit group number may be used. The following example will use group number 01.Add to Group
81[2 digit group number]
Calling Extension 8101 will add the current phone to group 01.Delete from Group
80[2 digit group number]Calling Extension 8001 will remove the current phone extension from group 01.
Ring Group Simultaneous
82[2 digit group number]Calling Extension 8201 will ring all phone extensions in group 01.
Ring Group Order
83[2 digit group number]Calling Extension 8201 will ring the first phone extensions in group 01 followed by the next phone in the group and then ring the next phone extension in the group until the call is answered.
More options available they are defined under the 'Dialplan' 'default.xml' button.
-
pfSense user: tusc has found a bug that is now fixed in the latest version 0.4.5. It has to do with using multiple conditions when working with the 'Public' tab. This issue also affected and has been fixed for the 'Dialplan'. Thanks tusc for finding and notifying me so that this could be improved.
-
FreeSWITCH package is now working on pfSense 2.0 even when run with only 1 interface (appliance mode).
-
I just want to say that having this package is awesome.
I've always been intimidated by SIP, except to get a PAP2 running at home.
I know a lot of us newbs looking at this are still overwhelmed, but I know after some more reading I will try it out. For a newb to sip, there are so many options that I don't exactly know where to start. Ok, ok, I do know, more reading :)I will say that making this available here is extremely encouraging. I am finally starting to see the light at then end of the tunnel.
Thank you for all your hard work "mcrane"
-
Sorry if this is a bit off topic…but is there a reason you (MCCRANE) chose FreeSWITCH vs something like sipXecs as a package?
-
scottnguyen:
sipXecs looked pretty good here is my reasons for not going with it.
1. sipXecs already has a GUI and a company backing it. I'm not sure what language the GUI was in by I wanted one in PHP.
2. I'm not an expert on sipXecs but my impression is its limited to SIP only.
3. sipXecs is LGPL which I like better than the GPL however I like the MPL even better than the LGPL.Spend some time to learn more about FreeSWITCH it will be worth your time.
FreeSWITCH configuration by default is XML. pfSense's config is stored in XML. So it seemed a good fit.
FreeSWITCH is also modular, extensible, scalable, multi-platform, can interface with multiple languages, remote access is possible over xml rpc, over a network socket, can be a VoIP SWITCH, Proxy, soft phone, and/or PBX.
-
tester_02: Configuring the linksys pap2t is a good start. Reading about FreeSWITCH here on the forum should help. In addition to that take a look at http://wiki.freeswitch.org. Do your best to read through the information then feel free to ask questions. Good Luck!
I mentioned this in a comment on the blog but want to make sure it gets noticed.
Voicemail.
To access your voicemail you can dial extension 4000 then your id (extension number) then the voicemail password. This can be accessed from any extension on the system or from any phone through the IVR (auto attendant).
In addition to that if your extension is 1001 and you were currently on that extension you simply call extension 1001 and it will go to your voicemail.
-
I'm pretty interested in this package. I've had an asterisk server running for … years? behind a pfsense box; it works great.
I'm a little leary of having to learn freeSwitch; I've got all my steps and knowledge down for installing ubuntu server and then asterisk / FreePBX on top of it.
But reducing the number of manchines running in my house by one is very appealing. My config is pretty simlpe too; so I don't forsee any problems migrating. I do have a couple 'if this line rings; call my cell / voip phone / house phone until one of them picks up' - I'd hate to lose that sort of functionality.
And with FreePBX just putting freeSwitch on their coming soon page; this could all get very interesting fast.
Just wanted to state my interest as well; I look forward to trying this out soon.
-
Installed the freeswitch package, upgraded to Rc3, saw these errors at the bottom of the page during the reinstall after upgrade:
Warning: fsockopen(): unable to connect to 76.11.76.41:8021 in /usr/local/pkg/freeswitch.inc on line 92 Warning: socket_set_blocking(): supplied argument is not a valid stream resource in /usr/local/pkg/freeswitch.inc on line 93 Warning: fsockopen(): unable to connect to 192.168.1.1:8021 in /usr/local/pkg/freeswitch.inc on line 92 Warning: socket_set_blocking(): supplied argument is not a valid stream resource in /usr/local/pkg/freeswitch.inc on line 93 no handle
I'm guessing this is just because there is no rule for the event socket. Solution is to surpress these warnings? Or warn that ports should be opened? Or option 3, I missed the mark completely.
-
Installed the freeswitch package, upgraded to Rc3, saw these errors at the bottom of the page during the reinstall after upgrade:
I'm guessing this is just because there is no rule for the event socket. Solution is to surpress these warnings? Or warn that ports should be opened? Or option 3, I missed the mark completely.
A rule is not necessary for the even socket unless there are strict rules for outbound access. Supressing the warning would hide the problem but not fix it.
The problem is that it tries to connect to the socket for only 1 second before giving up. In some cases 1 second isn't long enough. FreeSWITCH package 0.4.7 will now try for 3 seconds hopefully this will be sufficient. Also removed some necessary files from the default config.
-
adrianhensler, Freeswitch can do everything you're talking about with the bridge application in the dialplan…check it out! :)
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bridgecall -
Okay, in for a penny in for a pound. I just disabled the asterisk and figured I'd go nuts.
The package works great and I got it set up and calling working between two phones (a local grandstream 2020 and a remote linksys voip router; also a remote pap2)
Having some issues that I'm sure someone can assist with - I've been dealing with voip for a long time but not ever with freeswitch.
1. Outgoing calling to a pots (cell phone in this case) results in crazy static as soon as the cell starts ringing - the phone line is all static; I don't hear a ring just noise. It continues after I answer the cell phone. I'm thinking codec mismatch but it's confusing to me - I thought the call would just fail in that case?
2. Trickier problem due to me not understanding where to fix this in freeswitch. I don't have a proper static IP. It's pretty close to static - but it's not static. I had a workaround in asterisk that seemed to work pretty well - a SynDNS dns name and the externip / externhost commands.
In freeswitch, how do I make this work correctly: if I edit the vars to force my domain to be a name; ie myDynDNSname.org instead of the default $${local_ip_v4} this happens (as seen in the logs):
I call in, I hear "goodbye" and my transfer to phone doesn't work because it is looking for 2000@123.123.123.123 which doesn't exist because the line is registered as 2000@myDynDNSname.org
If I leave it as the default; then the incoming call works to get to voicemail - but then my phone doesn't ring because it says it's not registered - it's registered as 2000@myDynDNSname.org and not as 2000@123.123.123.123.
If I change the external devices to register by IP rather than DynDNS name I think everything will work; but when my IP changes I'll haev to update all the devices so I think that the DynDNS name is the way to go.
Someone please show me the error of my ways. I'm so close.
The other interesting bit to this is that while outgoing calling connects but results in noise (problem #1 above) the incoming calling on the same gateway has audio but just doesn't connect correctly due to dns versus ip configurations.
Thanks for listening.
-
To fix your ip<->dns issue, set the phone to register as user 2000, and the ip of the phone server or proxy server (in the phone settings) to your dns name. Then set <x-pre-process cmd="set" data="domain=domaingoeshere.com">in the vars.xml.
I'm using DynDNS with this configuration, and it's working perfectly.
I've got no idea about issue 1 though…sorry! Out of curiousity, who's your provider?</x-pre-process>
-
To fix your ip<->dns issue, set the phone to register as user 2000, and the ip of the phone server or proxy server (in the phone settings) to your dns name. Then set <x-pre-process cmd="set" data="domain=domaingoeshere.com">in the vars.xml.
I'm using DynDNS with this configuration, and it's working perfectly.</x-pre-process>
Perfect answer! adrianhensler: make sure all your phones register with the domain. You can mix domains and IPs only if you enable 'force-register-domain' from the 'Internal' tab. That will make all registration attempts assume the 'force-register-domain' domain name. FreeSWITCH is designed to run as a VOIP SWITCH and therefore is designed for hosting more the one domain for multi-tenant uses.
The static problem you mentioned…
I suspect the problem that is occurring is specific to the provider you are using. I have setup several providers with FreeSWITCH and have not had the problem you described. What provider are you using?
On the Linksys phone you will get better audio quality if you go to the 'SIP' tab under admin advanced in the Linksys GUI and set the 'RTP Packet Size' to '0.020'.
-
Release FreeSWITCH pfSense package 0.4.9 today. Upgrading to this version is highly recommended. Make sure to do a backup from the 'Status' tab before removing and then reinstalling the package.
Over the past few days I have been working on a voicemail to email feature. You can configure this feature under the 'Settings' tab for the general settings to the email server. It is designed to define an email sever that delivers the email. It supports SMTP authentication, as well as TLS, and SSL encryption. Email addresses can be set from the 'Extensions' tab under the individual extensions. From the extensions you can also control whether the voicemail audio will be attached to the email. No attachment is useful if your email is being sent to a mobile phone as a text message.
From the 'Settings' tab 'SMTP Host' an additional backup SMTP host can be provided by seperating the hosts with a ';' semi-colon. An alternate SMTP port can be provided by using a colon and then the port after the host name. Example: mail.example.com:2525
The email is sent using PHP Mailer. http://phpmailer.codeworxtech.com/index.php?pg=tip_srvrs
-
My three registered devices use dns names. My two registered gateway (both with link2voip) use domain names.
The audio issue I'll deal with later, I'm more confused by the inability to get calls coming in through 'public' to get in.
They fail because they are still trying ext@ip.ip.ip.ip instead of ext@domainname.com
switch_core_session_execute_application() sofia/external/9024683007@111.111.111.111 Expanded String bridge(user/2000@222.222.222.222) 2008-12-17 14:12:21 [WARNING] mod_dptools.c:2025 user_outgoing_channel() Can't find user [2000@222.222.222.222] 2008-12-17 14:12:21 [ERR] switch_ivr_originate.c:1071 switch_ivr_originate() Cannot create outgoing channel of type [user] cause: [SUBSCRIBER_ABSENT] 2008-12-17 14:12:21 [DEBUG] switch_ivr_originate.c:1625 switch_ivr_originate() Originate Resulted in Error Cause: 20 [SUBSCRIBER_ABSENT] 2008-12-17 14:12:21 [INFO] mod_dptools.c:1869 audio_bridge_function() Originate Failed. Cause: SUBSCRIBER_ABSENT 2008-12-17 14:12:21 [DEBUG] mod_dptools.c:1890 audio_bridge_function() Continue on fail [true]: Cause: SUBSCRIBER_ABSENT
Why is it using the IP here and failing instead of my dns name?
The above is an incoming call through 'public'
condition destination_number adrianhensler action transfer 2000 XML default
(edit) Can't wait to try the voicemail to email!
-
Can you try changing this line in your public.xml file?
<extension name="set_domain" continue="true"><condition field="${domain_name}" expression="^$"><condition field="source" expression="mod_sofia"><condition field="${sip_req_params}" expression="domain_name=([A-Z-a-z0-9.]+)"><action application="export" data="domain_name=$1"><anti-action application="export" data="domain_name=${sip_req_host}"></anti-action></action></condition></condition></condition></extension>
Change the 3rd to last line to this:
<anti-action application="export" data="domain_name=YOUR_DOMAIN_NAME">Replace YOUR_DOMAIN_NAME with what your external dns name should be.It's a hack but it works for me.
Why is it using the IP here and failing instead of my dns name?
The above is an incoming call through 'public'
condition destination_number adrianhensler action transfer 2000 XML default
(edit) Can't wait to try the voicemail to email!</anti-action>
-
Nice, that worked.
Questions about the fix though:
I am confused – it worked even though I made a typo in my domain name? Then I typed just junk characters instead of my domain name and it still worked? I can even leave it blank and it works.
I've changed it to my domain name just to verify it does indeed work with that. Won't have a chance to test the remote devices until later.
switch_core_session_signal_state_change() Send signal sofia/internal/sip:2000@192.168.1.82:5060;transport=udp [BREAK]
It now contacts 2000@192.168.1.82 (the internal IP of my Grandstream SIP phone). Hm. I'll have to look at this more later, I'm confused.