Articles to read in the Freeswitch wiki
- DONE Docs/MainPage http://wiki.freeswitch.org/
- DONE Download http://wiki.freeswitch.org/wiki/Download_FreeSWITCH
- DONE Install guide http://wiki.freeswitch.org/wiki/Installation_Guide
- DONE Configuring FreeSWITCH http://wiki.freeswitch.org/wiki/Getting_Started_Guide
- DONE http://wiki.freeswitch.org/wiki/Default_config
- Admin documentation http://wiki.freeswitch.org/wiki/Documentation (Includes examples, debugging, JavaScript examples, etc.)
- User documentation http://wiki.freeswitch.org/wiki/Documentation/User_Documentation
- conf/freeswitch.xml
- conf/Vars.xml
- conf/autoload_configs/modules.conf.xml
- conf/autoload_configs/sofia.conf.xml
- conf/directory/ (user configuration)
- conf/sip_profiles/ (internal, external)
- conf/dialplan/ (Dialplan_XML, recipes)
- From Asterisk to Freeswitch
- Freeswitch FAQ
- http://wiki.freeswitch.org/wiki/SPA3102_FreeSwitch_HowTo
- Home VOIP system using FreeSwitch and a Linksys 3102 voice gateway (UK Guide) by Rob Smart
- How To Set Up a Linksys SPA3102 VOIP Router/ATA for BT UK
Other stuff to read
SIP and NAT firewalls- local setup (FreeSwitch and SIP phones)
- remote setup (SIP phone + possible utility to check that the firewall is SIP-friendly)
ATCOM IAX Hard phones (530P?)
DIAX softphone (looks ugly)
I've used both AT530 and AT530P ip phones, they have good voice quality and somehow resistent to harsh environment like offices ;) , except the keypad which after a year or more just sometimes types two digits with one push on a button. The AG188N ATA is also a good choise and we have some installation which work without any problem yet.
http://www.snomindia.com/snomsoftphone.htm
http://www.zoiper.com
Pika Warp: their support and development enviroment sucks
http://www.pikatechnologies.com
http://pikawarp.org/?page_id=172
http://blackfin.uclinux.org/gf/project/asterisk/forum/?_forum_action=ForumMessageBrowse&thread_id=36059&action=ForumBrowse&forum_id=120http://www.rowetel.com/ucasterisk/baps.html
http://www.rowetel.com/ucasterisk/http://forum.voiptel.no/index.php?board=1.0
http://forum.voiptel.no/index.php?board=3.0http://blog.voiptel.no/
http://www.plugcomputer.org/
http://hackaday.com/2009/02/25/sheevaplug-tiny-linux-server/
http://www.dataevolution.com/dectop%20info%202.htm
http://www.cartft.com/catalog/il/1081
http://www.intel.com/products/desktop/motherboards/D945GSEJT/D945GSEJT-overview.htm
http://www.cartft.com/catalog/il/1058
http://www.cartft.com/catalog/il/1087
http://www.amazon.com/IEEE802-11N-Wireless-Broadband-MZK-W04NU-Designed/dp/B000YDS0YG
What to Do With a $99 Wall Wart Linux Server
GSM gateways: EdgePBX, PORTech MV-370, OpenVox G400P (+ at least one GSM module + SIM card)
http://blogs.zdnet.com/Greenfield/?p=233http://robsmart.co.uk/2009/06/02/freeswitch_linksys3102/
http://www.aoakley.com/articles/2008-01-08.php
http://wiki.freeswitch.org/wiki/SPA3102_FreeSwitch_HowTo
Introduction
Freeswitch is an alternative to Asterisk to build a telephony server. It is also open-source, was launched by a member of the Asterisk development teamp who wanted to rewrite the whole thing from scratch to cleanly separate the switching part from the PBX part (Asterisk mixes the two due to its monolithic architecture). Unlike Asterisk, Freeswitch was meant to be cross-platform from the the start, and is available for Windows in addition to *nix.OpenZAP supports direct access to Sangoma cards through the wanpipe interface, and indirect access to Digium-compatible cards through the Zaptel interface; Because of this, as of April 2009, Windows users can only use Sangoma cards, or rely on an external VoIP gateway.
Here's a list of hardware that have been tested with Freeswitch. What can you do with Freeswitch? Here's a list. A web-based interface to the FS users mailing list is available here.
And here's the reason why Freeswitch authors chose XML over eg. INI files.
The big picture
Freeswitch is configured through different XML files loaded through the main freeswitch.xml. At runtime when FreeSwitch parses all the files, the resultant file is located as log/freeswitch.xml.fsxml.Contexts are a set of extensions located in conf/dialplan/ (eg. Default, Public, etc.), and effectively define the dialplan. A call can go through different contexts over the length of the call, eg. an unauthenticated call from a VoIP provider first go through the Public context before before forwarded to an IVR context, and end up being connected to an internal extension.
Profiles define User Agents ("end points of a phone call", says Wikipedia), and handles connections on a given IP and port number. This enables Freeswitch to support multiple companies on the same host while providing enhanced security. By default, Freeswitch comes with two profiles: Internal (private LAN), and External (Internet-accessible, public LAN.)
In a dialplan, profiles make use of contexts (eg. <param name="context" value="public"/>). What users can do depends on whether they authenticated (eg. local users making internal and outgoing calls) or not (eg. incoming calls from remote VoIP provider.) For security reason, it's a good idea to have the Internal and External profiles use their own dialplan.
Users (extensions) are configured through files in conf/directory/. Each extension maps to a context (<variable name="user_context" value="default"/>). If you need to perform more complex actions, use the dialplan to call external scripts.
conf/autoload_configs contains a lot of XML files, but only those listed in modules.conf.xml will actually be loaded automatically by Freeswitch.
IVR sound files in English are located under sounds/en/us/callie/ivr/8000/
Voice mail is saved under storage
Setup
Pre-compiled binaries for Windows
Freeswitch requires the "Microsoft VisualC++ 2005 Redistributable Package", a.k.a. msvcr80d.dll (source)By default, the Windows package does not install Freeswitch as a service. To do this, open a DOS box, and run "c:\freeswitch\freeswitch -install"
http://wiki.freeswitch.org/wiki/FreeSwitch_FAQ#Q:_How_can_I_use_FreeSWITCH_as_a_Win32_service.3F
Running FS on a SheevaPlug
http://computingplugs.com/index.php/Main_Pagehttp://www.globalscaletechnologies.com/p-26-sheevaplug-dev-kit-europe.aspx
http://plugcomputer.org/plugforum/
http://plugcomputer.org/plugwiki/index.php/Frequently_Asked_Questions
Downloading the latest source code with SVN
Here, we'll download and compile the latest source code using SVN.Note: As of March 2009, the config script will compile for ODBC instead of SQLite if it detects that unixODBC is installed... but doesn't check whether its counterpart unixODBC-devel is also installed. If not, in Suse Desktop: rpm -qa | grep -i odbc ; rpm -Uvh unixODBC-devel-2.2.11-21.4.i586.rpm (or rpm install unixODBC-devel.i386 or yum install unixODBC-devel)
- If installed, remove Asterisk (ps aux | grep -i asterisk)
- (prerequisites) yum install subversion autoconf automake libtool gcc-c++ ncurses-devel make
- svn co http://svn.freeswitch.org/svn/freeswitch/trunk /usr/src/freeswitch
- cd /usr/src/freeswitch
- ./bootstrap.sh
- ./configure
- If you know what you are doing, edit modules.conf so that it will build the modules you desire (eg. OpenZap to talk to the Dahdi/Zaptel API and drive a PCI telephony card); Otherwise, leave this alone, as FreeSWITCH comes with a good set of modules by default
- make
- make install
- make cd-sounds-install && make cd-moh-install
The sound file are available for some languages, and can be installed thusly: make cd-sounds-XX-install & make cd-moh-XX-install, where XX stands for the two-letter ISO name of the country (eg. ru, de, fr, etc.)
- make samples
- /usr/local/freeswitch/bin/freeswitch
- Make sure the server is not running a firewall that would block incoming SIP connections (eg. rpm -qa | grep -i iptable ; /etc/init.d/iptables stop ; yum remove iptable)
- On a remote host, configure an SIP client: user=1000/password=1234/domain=server IP address, dial 9999 for music on hold or 5000 for an IVR
- "shutdown" to stop Freeswitch
- Edit PATH to include path to Freeswitch binaries (/usr/local/freeswitch/bin; for CentOS: Create /etc/profile.d/freeswitch.sh, add the line "export PATH=$PATH:/usr/local/freeswitch/bin", change access rights to this file: chmod 755 /etc/profile.d/freeswitch.sh, log off and log back on, echo $PATH)
- adduser freeswitch ; chown -R freeswitch:freeswitch /usr/local/freeswitch
- vipw (or vi /etc/password)
freeswitch:x:500:500:Freeswitch:/home/freeswitch:/sbin/nologin
- To have Freeswitch start automatically at boot-time on a Suse host:
- cp /usr/src/freeswitch/build/freeswitch.init.suse /etc/init.d/freeswitch
- vi /etc/init.d/freeswitch
FREESWITCH_BIN=/usr/local/freeswitch/bin/freeswitch
(BAD!) FREESWITCH_CONFIG=/usr/local/freeswitch/conf/freeswitch.xml
FREESWITCH_PARAMS="-nc"
- To have Freeswitch start automatically at boot-time on a CentOS host:
- cp /usr/src/freeswitch/build/freeswitch.init.redhat /etc/init.d/freeswitch
- vim /etc/init.d/freeswitch
PID_FILE=${PID_FILE-/usr/local/freeswitch/log/freeswitch.pid}
FS_FILE=${FS_FILE-/usr/local/freeswitch/bin/freeswitch}
FS_HOME=${FS_HOME-/usr/local/freeswitch}
- chmod 755 /etc/init.d/freeswitch
- chkconfig --level 345 freeswitch on
- chkconfig --list freeswitch
- (Really needed in addition to chkconfig?) ln -s /etc/init.d/freeswitch /usr/sbin/rcfreeswitch
- Launch the server through the rc.d script: /etc/init.d/freeswitch start
- Check that the server is running: ps aux | grep -i freeswitch
- Wait a few seconds for Freeswitch to be up and running, and connect to the server through the console: fs_cli
- Check SIP status: sofia status
- Check a specific SIP profile: sofia status profile internal
- To exit the console, type "/exit" or "..."; To stop the Freeswitch server and exit the console, type "fsctl shutdown elegant"
Updating the source code and recompiling Freeswitch
- cd /usr/src/freeswitch
- make current
- /etc/init.d/freeswitch restart
Trixswitch
Another option is the Trixswitch ISO install package, a CentOS-based CD-ROM image that creates a boot CD that will automatically install CentOS and FreeSWITCH.Connecting to the PSTN
A Freeswitch server can handle conversations over the analog phone network either by connecting out through ADSL to a VoIP provider on the Internet, or by connecting the server to a phone line on the premises through an SIP/PSTN gateway.In this latter case, there are two options: Either an external device like the Linksys SPA-3102, or a PCI card from Digium, Sangoma, OpenVox, Atcom, etc. Sangoma also offers a two-FXO USB device.
Advantages | Disadvantages | |
External device |
|
|
PCI card |
|
|
Connecting Freeswitch to a PSTN line through the Linksys 3102
Here are few things to keep in mind:- contexts = diaplans
- SIP profiles = for enhanced security, an extension must belong to a given profile
- extensions = belongs to an SIP profile and is set to use a given dialplan
- settings in XML files under autoload_configs/*.xml are loaded even if the relevant module is not loaded through modules.conf.xml (list of modules)
Home VOIP system using FreeSwitch and a Linksys 3102 voice gateway (UK Guide)
SPA3102 FreeSwitch HowTo
- Reset the unit by plugging a handset in the Phone plug, and dialing **** followed by 73738#, and confirm with 1
- Since we won't use the 3102 as a router to connect two Ethernet networks, plug the 3102 to the LAN through its "Internet" connector, dial *** to enter the voice menu, followed by 110# to get its IP address, and 7932# followed by 1#, and 1 to enable the embedded web server
- Aim your browser at http://linksys-ip/admin/advanced (where linksys-ip is the 3102 IP address)
Router
Wan Setup
Connection Type = Static IPStatic IP = 192.168.0.253
Netmask = 255.255.255.0
Gateway = 192.168.0.254
Primary DNS = 212.27.54.252
Secondary DNS = 208.67.220.220
Primary NTP Server = 0.fr.pool.ntp.org
Secondary NTP Server = 1.fr.pool.ntp.org
Enable WAN Web Server = yes
Lan Setup
Networking service = Bridge (so we can connect to the 3102 through either its Internet or Ethernet port; The LAN IP address is ignored)Voice
System
Enable Web Admin Access = yesSyslog/debug server = 192.168.0.1
SIP
SIP TCP Port Min/Max = 5060RTP Port Min/Max (Must be port-mapped on NAT router, or can 3102 punch holes itself?)
"RTP Packet Size" should be changed from 0.030 to 0.020 to avoid problems ("When you make outbound call using analog phone attached to the FXS port and the person you call hears choppy voice")
NAT Support Parameters : what is VIA?
STUN Enable = yes
STUN Test Enable = ?
STUN Server = stun.ekiga.net
EXT IP?
EXT RTP Port Min
Regional (France)
Dial Tone = 440@-10; 10(*/0/1)Second Dial Tone = 420@-19,520@-19;10(*/0/1+2)
Busy Tone = 440@-10; 10(0.5/0.5/1)
Ring Back Tone = 440@-10; 10(1.5/3.5/1)
Time Zone = GTM +1
DST Rule = start=3/-1/7/2;end=10/-1/7/3;save=1
FXS Port Impedance = 600
Caller ID Method = ETSI FSK
Caller ID FSK Standard = bell 202
Line 1
Line Enable = yesNAT Mapping Enable = no
SIP Port = 5062
Proxy = FS server
User ID + Password = SIP account on FS server
Register = ?
Make/Ans Call Without Reg = ?
Dial Plan = ?
PSTN Line
Line Enable = yesNAT Mapping Enable = no
SIP Port = 5061
Proxy = FS server
User ID + Password
Preferred Codec = G711U
Dial Plan 1 = (S0<:9999>) //Incoming calls from POTS sent to extension 9999 on FS server
VoIP-To-PSTN Gateway Enable = ?
Line 1 VoIP Caller DP = 1
PSTN-To-VoIP Gateway Enable = ?
PSTN Ring Thru Line 1 = no
PSTN CID For VoIP CID = yes
PSTN Caller Default DP = 1
VoIP Answer Delay = 0
PSTN Answer Delay = 0
PSTN Ring Thru Delay = 1
PSTN Ring Timeout = 5
Detect CPC = yes
Detect Polarity Reversal = yes
Detect Disconnect Tone = yes
Disconnect Tone = 480@-30,620@-30;4(.25/.25/1+2)
FXO Port Impedance = 370+620||310nF
User 1
PSTN User
Connecting Freeswitch to a PTSN line through a PCI card
Install Dahdi
- Check that the card was detected: lspci -v
- Download and install the Dahdi (ex-Zaptel) complete package (driver + tools) from the Asterisk web site: make all ; make install ; make config
- Edit /etc/dahdi/system.conf:
#For France; Single FXO module on TDM card
loadzone = fr
defaultzone = fr
fxsks=1
- Edit /etc/dahdi/modules:
#wcfxo
wctdm
dahdi
- /etc/init.d/dahdi start
- dahdi_cfg -vvv
- ls -la /proc/dahdi/
- dahdi_test -vv
If you experience echo, one thing to try is using the Open-source Line Echo Canceller (OSLEC).
Install OpenZap
Configure FreeSwitch
Installing an X100P card from www.x100p.com
- cd /usr/src
- wget http://downloads.asterisk.org/pub/telephony/zaptel/zaptel-1.4.12.1.tar.gz
- tar xzvf ./zaptel-1.4.12.1.tar.gz
- cd zaptel-1.4.12.1/
- ./configure
- make
- make install
- make config
- vim /etc/sysconfig/zaptel, and comment out modules you don't need (keep $MODULES wcfxo)
- cd /etc ; mv zaptel.conf zaptel.conf.orig
- vim /etc/zaptel.conf (for France):
loadzone=fr
defaultzone=fr
fxsks=1 - modprobe wctdm OR modprobe wcfxo?
- modprobe zaptel
- lsmod, and check that wcfxo, zaptel, and crc_ccitt are loaded
- ztcfg -vv (if it says "ZT_CHANCONFIG failed on channel 1: No such device or address (6)", it's a false alarm)
Tried:
- /etc/zaptel.conf: fxsks=1 is last statement in file
- In BIOS, set PCI slot to use IRQ7
- Booted grub with acpi=no
- Booted grub with noapic (Linux gets stuck)
- Flashed BIOS with F2 version
- Removed Zaptel 1.4.12.1, rebooted, downloaded and compiled Dahdi 2.2.0.2 (no config/configure -> make all; make install; make config; dahdi_genconf modules)
- Rebooted: FXO PCI Master abort...
- Shutdown: Replaced with a SCSI card which worked fine, retried the X100P... which now shows up in demsg :-/
- But... while lspci does return "Communication controller: Motorola SM56 PCI Modem", it's not listed in "cat /proc/interrupts"
- Also, when using the following for /etc/dahdi/system.conf...
loadzone=fr
defaultzone=fr
fxsks=1
... and running "/etc/init.d/dahdi restart": "Running dahdi_cfg: DAHDI_CHANCONFIG failed on channel 1: No such device or address (6)"
dahdi_cfg -vv : "DAHDI_CHANCONFIG failed on channel 1: No such device or address (6)"
The problem is with high-speed USB ports. I kept getting Unknown DAA errors. Soon as I disabled the USB ports everything worked as it should. It was the same case with EVERY motherboard I tried.
It was frustrating because everything worked fine in my old computer, but when I upgraded it was not.
Zaptel Version: 1.4.12.1
Echo Canceller: MG2
Configuration
======================
Channel map:
Channel 01: FXS Kewlstart (Default) (Slaves: 01)
1 channels to configure.
ZT_CHANCONFIG failed on channel 1: No such device or address (6)
If you have any zaptel hardware it is now recommended to edit /etc/sysconfig/zaptel and set there an optimal value for the variable MODULES .
I think that the zaptel hardware you have on your system is:
pci:0000:03:00.0 wcfxo- 1057:5608 Wildcard X100P
/sbin/ztcfg
Need to first install Zaptel/Dahdi?
- lspci -v to check that the card is recognized
- cat /proc/interrupts to check that the card was assigned an IRQ. If not listed here,
Systems running chipsets from SIS, nvidia and some VIA (so pretty much all AMD) dont handle those cards very well at all.
acpi noaicp nosmp etc..etc
echotraining =x
"
http://www.novavox.co.uk/support/issues.html
http://wiki.freeswitch.org/wiki/Zaptel_Tutorial
http://wiki.freeswitch.org/wiki/OpenZAP
http://downloads.asterisk.org/pub/telephony/zaptel/
Does OpenZap work with Dadhi 2.x?
http://downloads.asterisk.org/pub/telephony/zaptel/zaptel-1.4.12.1.tar.gz
Playing with Freeswitch
Important commands
Some important commands that you send through the bin/fs_cli command-line interface:- To check the different profiles: sofia status
- To check who is connected: sofia status profile internal
- To only watch SIP packets: "console loglevel 0", followed by "sofia profile internal siptrace on"
- To reload the whole set of XML files: reloadxml
GUI for FreeSwitch
Configuring a Siemens 580IP
Leave the handset on its cradle long enough to fully charge the battery, then connect the base station to the router so it gets an IP configuration through DHCP. To check what IP address was assigned and configure the handset from a web browser, open the Menu and navigate to "IP Address".By default, System PIN = 0000
Settings > Connections > Configure "IP1" to connect the 580IP to Freeswitch
Domain = IP address of Freeswitch server
Registrar = IP address of Freeswitch server
In case the 580IP is used to register with another SIP server besides Freeswitch, here's how to configure things so that the handset if you prefer to have it handle the dialplan instead of Freeswitch:
If I want to use a different line manually, specify its number (eg. 5551234#2 to use line #2) as listed in "Telephony > Connections".
In case you want all outgoing calls to be handled by the Freeswitch server, ie. not make use of the 580IP dialplan feature, add the VoIP gateways to the Freeswitch server, and just create a single connection in the Siemens in "Telephony > Number Assignment".
Issues
What is the use of the "Telephony > Dialling Plans > Dialling Plans" section?When should I use "Telephony > Number Assignment > Call Manager"?
What to try
Common extensions for testing:- 1000, 1001, ..., 1019 - Generic SIP extensions
- 5000 - demo IVR (requires sounds and music files to be installed)
- 9995 - five second delay echo test
- 9996 - standard echo test
- 9999 - music on hold (requires music files to be installed)
Configure SIP accounts, including voicemail and sending e-mail.
IVR
Connect a PSTN/VoIP gateway
Investigating issues
fs_cli> console loglevel [0-7] (where 1=EMERG and 7=DEBUG)fs_cli> sofia loglevel <all|default|tport|iptsec|nea|nta|nth_client|nth_server|nua|soa|sresolv|stun> [0-9]
fs_cli> sofia loglevel all 0
fs_cli > sofia profile <profilename> siptrace on|off
fs_cli > sofia tracelevel info #details in log/freeswitch.log file
http://wiki.freeswitch.org/wiki/Sofia#Debugging_Sofia-SIP
Configuration files
Here's a diagram to get the big picture.By default, configuration files live in /usr/local/freeswitch/conf/. The XML files are either stand-alone or include references to other XML files.
Note that an X-PRE-PROCESS line cannot be commented out, and must be removed entirely if not needed.
Information is available in the Getting Started Guide, and the Freeswitch default configuration layout.
Configuration data is stored in XML files under /usr/local/freeswitch/conf/ . This layout is in no way required, you can minimize the configuration to just one file if needed. The main config file is called freeswitch.xml, you don't need to change it in any way, it just loads all other config files.
freeswitch.xml
FS doesn't need more than the hard-coded conf/freeswitch.xml, but it's a much better idea to have it load different XML files from sub-directories to handle SIP accounts, dialplans, etc. At runtime when FreeSwitch parses all the files, the resultant file is located as log/freeswitch.xml.fsxml. freeswitch.xml contains multiple sections, each used by a different component in FreeSwitch: "configuration", "diaplan", "directory", and "phrases" (to locate sound files).vars.xml
Used to define global variablesconf/dialplan/
This is the directory where you'll customize your dialplan; Equivalent to Asterisk's extensions.confDiaplans are located in conf/dialplan/ . Everything in the public context is available to everyone, while everything in "default" context are only available to users that have registered with FreeSWITCH. Logically, this should be "internal", but I guess "default" is a legacy.
You can define in the user profiles (in the directory) which context they belong to, and you can define the public context in the sofia configuration. Contexts are a logical grouping of extensions. You may have multiple extensions contained within a single context.
dialplan: This is the place where you setup your dialplan. There are some examples of how to configure your dialplan included. (recipes); put your custom diaplan entries into the extensions subdirectory under conf/dialplan. You may create one or more XML files in this subdirectory, all of which will be included in the dialplan thanks to an "include" directive in the default.xml file. By keeping your customized extensions separate from default.xml you will be able to update default.xml without having to re-enter your custom extensions.
conf/autoload_configs/
A list of modules that are automatically loaded when Freeswitch starts; modules.conf.xml tells Freeswitch which modules to load. There are certain modules required for operation so you should not edit this file unless you know that you wish to add or remove a specific module.The sofia.conf.xml file includes other xml files (conf/sip_profiles/*.xml) to define multiple "profiles" (ie. contexts; See below).
Note that by default, all XML configuration files under autoload_configs/ are parsed, even if a module is commented out in modules.conf.xml, but Freeswitch will only actually use settings for modules that are explicitely listed in modules.conf.xml
conf/directory/
A list of SIP extensions, one XML file per extensions. User authentication is available under conf/directory/ . For instance, a connection to a remote VoIP gateway can be done through either the external profile or through information in directory/.directory: The directory contains all users that may register and use freeswitch as their pbx.; holds authentication credentials for other sip endpoints that will register to freeswitch (most commonly users). The directory configuration default is configured to process the glob $PREFIX/conf/directory/default/*.xml by the configuration included in freeswitch.xml $PREFIX/conf/directory/*.xml.
conf/sip_profiles/
Tells FS how to talk sip. Each profile has its own port. Unlike other softswitches (like Asterisk), FreeSWITCH allows you to handle media (calls, video, etc.) differently based on where the equipment is attached to your network. This assists with security as well as providing added functionality. SIP Profiles allow you to define paths to devices or carriers that may live inside or outside your network. These paths can be of many different types, but must consist of a unique combination of port and IP pairs.You could have SIP profiles for your internal network, or multiple profiles for each subnet of your internal network, or even completely different protocols like IPv6 as profile definitions. This helps FreeSWITCH identify how to route different types of calls when necessary, and also gives you the flexibility to tailor your dialplans based on what path a call originates to/from. The default profiles are located in: $PREFIX/conf/sip_profiles/PROFILE_NAME.xml -- where PROFILE_NAME is the name of the profile.
A list of contexts, eg. Internal, External, etc. This adds security and lets Freeswitch handle media that take different forms (voice, video, etc.). A profil consists in an IP address + Port number, and contains information that will be inherited by devices using this profile
A profile is a SIP UA (an endpoint), which communicates with other SIP endpoints. An obvious reason for multiple profiles is to tell Sofia how to handle calls meant for remote SIP users behind the NAT router, and calls meant for local SIP users located on the same LAN as the originating caller.
Each profile contains a complete description of a SIP UA. When FreeSWITCH starts, it reads sofia.conf.xml and starts up a separate UA for each profile in the configuration file.
In FS, SIP equipments can have different profiles, and are located under SIP_Profiles/. By default, there is an internal profile (register by connecting to FS on UDP5060) and an external profile (Connect to FS on UDP5080; nat.xml is deprecated.)
The default profiles are located in: $PREFIX/conf/sip_profiles/PROFILE_NAME.xml -- where PROFILE_NAME is the name of the profile.In order to secure your FreeSwitch it is wise to link your outbound (external) profile to a dialplan context other than 'default', which in the default configuration is the where authenticated users are placed.
The default port for external connections is 5080. This also means if you are trying to connect a phone remotely to your FreeSWITCH box, you must set it to connect on port 5080, or change your ports around.
Working with the XML files
Type "reloadxml" in the FS console to apply changes made to XML files.Creating a new SIP account, and adding it to the Internal SIP profile/context
cd conf/directory/default/ ; cp 1000.xml 1234.xml; vi 1234.xmlAdding a new VoIP gateway
http://wiki.freeswitch.org/wiki/SIP_Provider_Examplesconf/directory/default/There are two ways to define VoIP gateways, depending if they're common to all SIP users, or user-specific. More information in Clarification: Gateways. A list of examples to connect to SIP providers is available here.
Create a new XML file in conf/sip_profiles/external
For outbound calls, add a new file in conf/dialplan/default/. Important: Freeswitch uses the files in their alphanumerical order, so 00_ is called before 01_
For inbound calls, add a new files in conf/dialplan/public/
A fuller example:
- cd conf/sip_profiles/external; cp example.xml mygw.xml; vi mygw.xml:
- <include>
<gateway name="outbound.mygw">
<param name="username" value="****yourusername"/>
<param name="password" value="****yourpassword"/>
<param name="proxy" value="****outboundurl"/>
<param name="register" value="false"/>
</gateway>
<gateway name="inbound.mygw">
<param name="username" value="****yourusername"/>
<param name="password" value="****yourpassword"/>
<param name="extension" value="1000"/>
<param name="proxy" value="****inboundurl"/>
<param name="register-proxy" value="****inboundurl"/>
</gateway>
</include>
Creating a new dialplan (including an IVR), and linking it to the new SIP account
Note: Since filenames determine the order in which Freeswitch loads XML files depends on their filename, make sure existing files in the same folder aren't loaded before yours.Here's how to create an outbound dialplan:
- cd conf/dialplan/default; vi 00_outbound_mygw.xml
- <include>
<extension name="dialmygw">
<condition field="destination_number" expression="^(\d{7,11})$">
<action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/>
<action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"/>
<action application="bridge" data="sofia/gateway/outbound.mygw/$1"/>
</condition>
</extension>
</include>
- cd conf/dialplan/public; vi 00_inbound_mygw.xml
- <include>
<extension name="public_did">
<condition field="destination_number" expression="^(.*)$">
<action application="set" data="domain_name=$${domain}"/>
<action application="transfer" data="1000 XML default"/>
</condition>
</extension>
</include> - In
order to secure your FreeSwitch it is wise to link your outbound
profile to a dialplan context other than 'default', which in the default
configuration is the where authenticated users are placed.
Note: The nat.xml file (and profile) have been deprecated. Use the external profile and port 5080.
http://wiki.freeswitch.org/wiki/Javascript_Examples
Diaplans
For security reason, it is recommended to link the outbound profile ("External") to its own dialplan, different from the one used for internal calls ("Internal", previously known as "Default").By default, note that the Internal profile listens for incoming connections on UDP5060 while the External profile listens on UDP5080.
http://wiki.freeswitch.org/wiki/Dialplan_XML
Freeswitch and NAT firewalls
Here are some ports that Freeswitch uses and will have to go through firewalls:- UDP 3478: STUN service; Used for NAT traversal
- UDP 3479: STUN service; Used for NAT traversal
- UDP/TCP 5060: SIP UAS; Used for SIP signalling (Standard SIP Port, for default Internal Profile)
- UDP/TCP 5070: SIP UAS; Used for SIP signalling (For default "NAT" Profile)
- UDP/TCP 5080: SIP UAS; Used for SIP signalling (For default "External" Profile)
- UDP 16384-32768: RTP/ RTCP multimedia streaming; Used for audio/video data in SIP and other protocols
Securing Freeswitch
This is especially important if the Freeswitch box is open to the Internet to let remote SIP users connect to FS, or access a web server running on the same box.- Remove any unneeded applications
- Disable unneeded services
- Use a NAT firewall, especially one that can capture illegitimate login requests and block those IP addresses from getting into your system
- Configure SSH and Apache to listen to non-standard ports
- Create a user account specifically to be used with SSH, and configure SSH to only allow connections from this user (eg. useradd mysshuser; passwd mysshuser; vi /etc/ssh/sshd_config : AllowUsers mysshusers AND PermitRootLogin no AND Port 196; restart SSHd)
- SIP: Choose secure passwords for accounts, and double-check the SIP profiles that allow dialing out through the POTS
Hardware
Cases
- Aluminum sheets to build a hackintosh
- Fusion 64801
- Advance ThinkBook 6716V6
- Advance 8607S argent
- Advance 3903B (no PCI?) (GB)
- Advance 3905B
- Advance 6812V8 (PCI-E!)
- Global Sources - Computer Cases
- Dell Optiplex SFF
- AOpen S135B (no PCI slot) (GB)
- Akasa Enigma (no PCI slot) (GB)
- Smart Teck Case Cube BT-ST-A8989.BB (GB) Details . Yet more details
- Smart Teck Case Slim BT-ST-A6719.BB (GB)
Compact PCs without PCI slot
Sources to check for this type of hardware: www.linuxdevices.com- Acer: Revo
- Asus: EeeBox, Nova
- Lenovo IdeaCentre Q100
- T7 Atom barebone £180 and PuppyPC £170
- eBox
- LimePC-X1
- CherryPal C114 Desktop
- LinuTop 280€
- OrdiPost 150-180€
- HP Thinclient t5720
- Fit-PC2 $245
- CappuccinoPC ($300 without RAM, DD)
Compact PCs with PCI slot
- MSI (Titan, Axis, Hetis, or NetTop)
- Shuttle KPC K45 (240€)
- SolidLogic Little Falls 2699 Mini-ITX System $210
- Herologic HL-463 ($259)
- Trixbox box (full-size PC; no direct order)
Intel Atom-based motherboards
- Gigabyte GA-GC220 (Celeron) or Gigabyte GA-GC230D (Atom) mobo (My DIY NAS) with 1U or 2U PCI riser
- Asus I220GC (24.4cm x 18.87cm)
- Intel D945GCLF/D945GCLF2D or D201GLY2/D201GLY2A
- Intel D945GSEJT (Northbridge passively cooled, and built-in DC/DC power circuitry!)
Non-Intel motherboards
- Soekris
- PCEngines
- Gumstix
- SheevaPlug
- BlackFin (processor)
Asterisk Appliances
- AstBoxes (168.00 EUR; 2GB CompactFlash; No FXO port, but room for PCI card at right-angle)
- uCpbx (From Rowetel; IP01 $195; IP04 235.00 EUR)
- Atcom (IP01 based on design by Rowetel; 256MB flash memory; £160+VAT)
- PIKA WARP Appliance $725
- http://www.micro-asterisk.com/ $550
- Trixbox (formally Asterisk@Home) Price unknown but probably on the pricier side
- EdgeBox
Modded routers/NAS
Planex MZK-W04NU
- Planex MZK-W04NU
- No longer sold in Japan, but still available overseas
- 60€
- Recommended by the OpenWrt community
- http://wiki.freeswitch.org/wiki/OpenWrt
SheevaPlug
- If based on ARM, FreeSwitch may run on this (doc)
- http://www.linuxfordevices.com/c/a/News/Debian-for-NSLU2-and-SheevaPlug/
Linksys WRT54
- Linksys WRT54G
- 50€
FritzBox 7270
- FritzBox 7270
- 220€
Linksys NSLU2
- Discontinued
- Linksys NSLU2
- 85€
Q&A
In vars.xml, what is default_password used for?
<X-PRE-PROCESS cmd="set" data="default_password=1234"/>It's the SIP default password if none given in user files under conf/directory/default/:
# cat 1000.xml <include> <user id="1000" mailbox="1000"> <params> <param name="password" value="$${default_password}"/> <param name="vm-password" value="1000"/> </params>
What are the options to connect a FS server to a POTS line?
To act as a VoIP gateway, you can use external solutions like Sangoma's USB device, or Ethernet-based solutions like Linksys' SPA-3102 or GrandStream's HT503.If you'd rather use a PCI card: As of April 2009, FS' OpenZAP interface can talk to hardware either directly (only Sangoma cards are supported), or indirectly through the Zaptel interface (which isn't available for Windows).
How to configure routers to allow remote IP clients to connect to Freeswitch and/or POTS VoIP gateway?
SIP TCP/UDP 5060 - 5090RTP UDP 16384 - 32768
? What about the connection between VoIP gateway and a remote SIP client?
How to install FS as a service in Windows?
http://wiki.freeswitch.org/wiki/FreeSwitch_FAQ#ApplicationsWhat is mod_spidermonkey?
The Mozilla SpiderMonkey Javascript (ECMA Script) engineWhat is mod_sofia?
"This module wraps the sofia SIP library from Nokia."How to check my voicemail?
Dial 4000, followed by the extension # and password (with the test accounts, password=extension)Resources
http://www.fredshack.com/docs/freeswitch.html
No comments:
Post a Comment