FreeSWITCH package for pfSense 1.2.1 and 2.0 released. PBX or Proxy
-
[IVR Instructions]
When you create an IVR of 5002 you it will automatically add a dialplan entry on the 'Dialplan' tab for the extension. First you need to make some recordings for the IVR to use. You make the recordings on the 'Rec' tab by calling 732673 (record) it will ask for a pin number which is the 'admin pin' that is defined on the 'Settings' tab. After you make the recording edit it to give it an intuitive name. Then the recording will be available show up in the menu on the 'IVR' tab. The 'timeout' is how long to wait for key presses (DTMF) after the recording has finished playing. The 'Recording Action' drop down is the recording that will be played if the 'Javascript Condition' is true. If the condition is false then it will play the recording that is chosen in the Recording Anti-Action. For most systems the 'Javascript Condition' will a good start and work for most systems. It checks to see if the time is between 9-5pm, and that is Monday - Friday, and not one of the predefined holidays.
Now you need to add the auto attendant 'options.' Start with the 'Action' options first. If my recording said the following: "Thank you for calling press 1 for Sales 2 for Support 3 to hear the options again." Then the first 'Option Number' would be '1' set the drop down 'Type' to 'extension' then the destination could be the extension for the Sales person. If you have more than one Sales person you might want to setup a group and transfer the call to the group. For more information on the groups look at the wiki at: http://doc.pfsense.org/index.php/FreeSWITCH click on 'Save.' Now add the 2. The third option to hear the options again can be done with 'Type' extension and a 'Destination' of 5002. There is special option number 't' it is what will happen when the timeout is reached. The timeout could be redirected back to 5002 or to a specific extension, or omitted and the call will end. With the default condition the 'Action' options are 'Office Hours' and the Anti-Action options are the 'After Hours'. However you can replace the 'Javascript Condition' with the following: condition=true; in this case the Anti-Action options will never be used. This is useful for sub IVR menus such as a Directory. A directory would not make sense to use a time condition. You can access sub IVR by creating an option such as 4 and then creating an IVR at extension 5003. Point the option 4 to use a Type of 'extension' then '5003'.
Calls are directed to the 'Anti-Action' options when the condition does not match. The process for adding them is the same as the 'Action' options.
After setting up the IVR and you have called it at extension 5002 then you can direct inbound calls to it from the 'Public' tab.
Let me know if you have any further questions.
Best Regards,
Mark J Crane -
New updates to the FreeSWITCH package 0.5.8.3 and 0.5.8.4.
1. Exposed more paths on the pages that were not showing a file system path.
2. Fixed 'realm' on the gateways tab so that it saves the realm correctly.
3. Clarified wording on the extensions edit page to give more direct instructions on how to enable 3 digit extensions. -
Just for information:
Got the following notification message at the bottom when installing the FreeSWITCH package on top of PF1.2.1
"Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/pkg/freeswitch.inc on line 1821"The package installed fine though…
Best regards
Dan Lundqvist
Stockholm, SwedenNote: tried to reinstall to latest version today 6 Jan -09 and also got the following: (but still not a failed install)
Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/pkg/freeswitch.inc on line 1821
Warning: fsockopen(): unable to connect to xx.xx.165.51: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 -
Having trouble getting past go on the IVR, not sure if I've messed up something else or if I'm missing a step.
I can create the recording and the IVR gui part seems to work as expected. I can't get my internal phone to reach anything but the pre-existing 5000 IVR which doesn't even show on the IVR menu.
This is what I see from the freeswitch console:
2009-01-04 17:34:01 [INFO] mod_dialplan_xml.c:233 dialplan_hunt() Processing Adrian Hensler->5002 in context default 2009-01-04 17:34:01 [ERR] ivr_DA5F6494-9E2F-4607-B0D4-73D3DBACA666.js:160 mod_spidermonkey() near SyntaxError: syntax error else { 2009-01-04 17:34:01 [NOTICE] switch_core_state_machine.c:168 switch_core_standard_on_execute() Hangup sofia/internal/2000@adrian.testing.com [CS_EXECUTE] [NORMAL_CLEARING] 2009-01-04 17:34:01 [NOTICE] switch_core_session.c:956 switch_core_session_thread() Session 3 (sofia/internal/2000@adrian.testing.com) Ended 2009-01-04 17:34:01 [NOTICE] switch_core_session.c:958 switch_core_session_thread() Close Channel sofia/internal/2000@adrian.testing.com [CS_HANGUP]
Line 160 in that javascript file is just an else line and seems to have nothing to do with the monkey recording?
-
The default IVR on extension 5000 is written in XML. The IVR in this package creates them in javascript. That is why you don't see extension 5000 in the package.
The console information shows that you are getting to the 5002 recording but for some reason it has an error. To know why you are getting an error you need to provide more information.
1. Did you provide action and anti-action options?
2. What numbers did you use for the the options?
3. What kind of actions did you give the options?
4. What version of the package are you running? -
Hi mcrane, thanks for the reply.
1. I had 4 actions but no anti actions. press 1 2 3 4. I was just trying to get it to answer first, I was going to worry about details later.
2. As above - options were just going to be 1,2,3 or 4.
3. Actions were just going to send to extensions 2000, 2001, 1718, 9656 (one extension points to my cell phone, the other to my parents - the numbers just match the alst 4 digits of their numbers and it's easy to remember)
4. The newest package at this time.I was confused with the xml versus javascript bit - your statement clears up a lot of that confusion. I was sort of looking for my created IVR to show up looking like the example one.
Unless something jumps out at you don't worry about it - I'll clear out my xml and try it again, I'm worried that it's something that I've messed up while tooling around the config files and I really don't want to waste your time looking for something I've done wrong.
Thanks!
-
Nice mention of the freeswitch pfSense package in the freeswitch 1.02 announcement:
http://freeswitch.org/node/157
There are two specific projects that are a part of the ecosystem to keep an eye on. The first is TCAPI - an ambitious project that aims to provide a comprehensive Web-based front-end to FreeSWITCH. The second is pfSense. The pfSense project has incorporated FreeSWITCH as an optional package. This allows pfSense users to set up an appliance that can be a PBX or soft-switch. pfSense and FreeSWITCH user Mark Crane has also added a simple GUI to the pfSense/FreeSWITCH package. Look for more interesting things to come from both of these projects.
-
I still can't get the ivr to work. I can send an incoming call to the pre-existing ivr at extension 5000 so I can validate the process works at least that much. I can also dial the 5000 IVR from my internal voip phone.
It doesn't seem to like the IVR I make at ext 1999 (for example). I tried deleting all three of my (not working) test IVR's and then adding a new one, just condition=true, using one of the existing recordings for testing; context=default. The action is 1 / extension / 2000 (if 1 is pressed go to extension 2000)
I have no anti-action.
I'm sure it is something I'm not understanding. It keeps returning javascript errors in the log:
2009-01-06 00:16:39 [ERR] ivr_D8DE6EA5-D512-39E8-C88A-52CF71C7245E.js:128 mod_spidermonkey() near SyntaxError: syntax error else {
-
I did some more testing on the IVR (auto attendant) and found a bug. When no anti-actions where defined the result would be a javascript error as you reported. I have fixed this problem in the FreeSWITCH package version 0.5.8.5.
Please backup your files using the 'backup' button on the 'Status' tab. Then remove the FreeSWITCH package and then reinstall it.
I have also fixed a minor bug for the anti-actions correctly on and edit for the dialplan and public tabs.
In addition to fixing what was mentioned above I have also added a new feature to the IVR (auto attendant). One of the special option numbers that could be done was 't' for timeout which was the length of time to wait for dtmf until proceeding with the timeout option. There is now a new special option 'n' which routes the call now and doesn't wait for dtmf. This new option is useful for office hours IVRs where during the day the call goes to a live person directly and at night the call is directed to an after hours IVR.
-
I can confirm that the changes to the IVR are now allowing me to create an IVR as expected!
Great work.
I did try to help by poking around the code, but I didn't find anything. Hopefully reporting the errors I was seeing helped.
-
Am I dense or is the wiki locked from creating accounts?
I just wanted to add that if you are enabling intercom and you've changed your extensions you want to edit the line in default.xml that reads:
<condition field="destination_number" expression="^8(10[01][0-9])$">^M</condition> ``` … to match what is required.
-
It's locked because of spammers…email the coreteam for an account, or have someone who has an account make the change.
-
This may be a dumb question but I have an existing Asterisk box behind the firewall with all the required port forwarding and static NAT mapping. To use Freeswitch do I need to turn all of these off?
Thanks,
Mike
-
You will almost certainly need to either turn them off or use non-standard ports and NAT with Freeswitch.
-
Your choice is to run it on a different Internet IP address, or have fun trying to switch things to non standard ports on one of the other systems.
New IRC channel #pfsense-freeswitch
-
You could possibly make a sip trunk from freeswitch to the LAN pbx depending on what your needs are; if you are looking to run both at the same time.
I just shut my asterisk box off in my case; but my needs were pretty simple. That's not to say that the freeswitch package won't suit your needs; it's just taking me a bit of time to get where I want it to be - but it's working great so far.
-
If I am troubleshooting outbound calling; how can I tell what gateway is in use when I make the call?
The log doesn't seem to show that information, I just see that it is using " New Channel sofia/external/19024466245 [8be3f58d-d7de-dd11-998b-00508df13a9d]" for example.
I had a heck of a time getting dialing to go out over one of my gateways - I was testing by calling my cell phone - but it kept using the wrong gateway every time no matter how I dialed. Eventually I tried another number and it worked correctly. I'm still not sure what is going on there. I'm thinking I need to set up a freeswitch server outside of pfsense just so I can understand the flow better….
-
If I am troubleshooting outbound calling; how can I tell what gateway is in use when I make the call?
On the 'Status' tab during a phone call you can see call information in the 'show channels' scroll through the info and you will see the gateway that is being used.
I had a heck of a time getting dialing to go out over one of my gateways - I was testing by calling my cell phone - but it kept using the wrong gateway every time no matter how I dialed. Eventually I tried another number and it worked correctly. I'm still not sure what is going on there.
Directing outbound calls to the appropriate gateway can be quite easy. I will add additional information on this topic here and on the wiki to help you and other understand how calls are directed to Gateways.
The 'Dialplan' is used to direct calls out the Gateways (aka SIP trunks, Providers.) You can make the required entries to directly to the dialplan from the 'Dialplan' tab. However there is an easier way using the 'Dialplan Expression' tool that is available on the 'Gateways' tab. It can make the dialplan entries for you. After using the 'Dialplan Expression' tool you can see what it added to the dialplan by viewing them from the 'Dialplan' tab. If you plan on calling with 7 digit dialing you need to provide the 'Default Area Code' on the 'Settings' tab. FreeSWITCH determines the outbound route based on conditions. The conditions are written with 'regular expressions'. FreeSWITCH uses regular expressions throughout its config. The 'Dialplan Expression' tool is a text area box where the regular expressions are placed one per line. To simplify this there is a select box which allows you to choose what type of outbound calls are routed to this gateway. There are several choices my favorites are 7, 10, and 11 digit dialing. For those that prefer dialing a 9 first there are choices for dialing a 9 with 7, 10, or 11 digits. I will be adding additional choices in the very near future such as dialing 8, and international.
In most cases the provider expects calls to be sent to them with 11 digits. If your provider is one of the exceptions then you will need to edit the dialplan entries that were made by the 'Dialplan Expression' tool so that it sends 10 digits rather than the default 11.
I'm thinking I need to set up a freeswitch server outside of pfsense just so I can understand the flow better….
The pfSense FreeSWITCH package has been designed to closely follow the FreeSWITCH config. The names of most things came from the xml config that FreeSWITCH uses. The paths are given in most cases. In short the design plan of the pfSense FreeSWITCH package has been to follow the default config so that knowledge gained from the pfSense FreeSWITCH interface or from the FreeSWITCH xml config can be interchangeable and mutually beneficial.
-
Thanks as always mcrane.
My issue was that I had created the two gateways but was having difficulty getting calls to go over the one I wanted. I had one set for 11 digit dialing and one set for 7 digit dialing; but every time I tried to call it would go over the 11 digit dialing one even if I had only entered 7 digits. I think my problem was that it was adding the area code automatically and then going over the gateway I had set as a default?
In any case, I just gave up on my configs after a bit and erased them and started over and everything seems to be working as expected - most of my problems exist between keyboard and chair. I realize now that the configs match very closely, I didn't realize they were that close when I wrote the email last night. Very nicely done.
I wanted some way to be able to look at the logs and see what had happened rather than just looking at the 'live' channels - is there no way to do that? There must be a way to view that information?
-
My issue was that I had created the two gateways but was having difficulty getting calls to go over the one I wanted. I had one set for 11 digit dialing and one set for 7 digit dialing; but every time I tried to call it would go over the 11 digit dialing one even if I had only entered 7 digits. I think my problem was that it was adding the area code automatically and then going over the gateway I had set as a default?
Sound like 'Dialplan Expression' tool was used and created a dialplan entry for 7 digits for both Gateways. If you have multiple gateways it is a good idea to see what you have already defined in the 'Dialplan' tab. If there are duplicates 7, 10, or 11 digit dialing it will choose the one that is assigned the lowest order. If there are ever duplicates there in the tab then I suggest removing them or editing them. You can add additional conditions such as an extension which would direct calls based on extension and on how many digits. If you have multiple gateways another approach is to make one gateway for 7 10 and 11 digit dialing and the other one requiring dialing a prefix number such as 8 or 9 and then the number.
I wanted some way to be able to look at the logs and see what had happened rather than just looking at the 'live' channels - is there no way to do that? There must be a way to view that information?
You can enabled SSH under PFSense -> Advanced and run FreeSWITCH from the console. If you are at the pfSense menu on the console or from SSH then choose option 8.
cd /usr/local/freeswitch/bin
./freeswitch -stop
./freesiwth startpressing F8 enables debug or F7 disables debug.
Or if you you can connect to it remotely from the LAN using the new fs_cli tool that the FreeSWITCH team has developed. I have attached the windows version to this post. You just need to remove the .txt extension from the file.
Run it from the command prompt with:
fs_cli.exe -H 192.168.1.1 -P 8021 -p ClueCon
Replace 192.168.1.1 with the LAN IP of your FreeSWITCH install. The port 8021 and the password: ClueCon are set from the 'Settings' tab.