Introduction to FreeSWITCH, Part One

    At one time, I discovered Asterisk and VoIP in general after reading a series of articles on opennet.ru about its configuration. I'll try to repeat a PR of this type for FreeSWITCH.



    Installation, start


    FreeSWITCH installation does not stand out anything special, msi package for Windows, source codes for all other platforms. Assembly in the standard sequence. For fans of batch installation options, it is possible to collect deb packages through at least the standard debian / rules binary.

    So, the first thing I should tell you is that FS is already configured after installation, works and is ready, if not for use, then for tests.
    The host IP address is selected as the domain, there are users with numbers from 1000 to 1019, voicemail functions (to listen, dial your number when registered), three types of conferences (8kHz - 30xx, 16kHz - 31xx, 32kHz - 32xx), and many examples to demonstrate the possibilities.
    And all this can very well be started immediately to be used to its fullest, but in any case, the scheme will need to be redone for itself. The main thing I will tell you is that you need to study, study and understand each point in the demonstration numbering plan - in it you can find examples of using the latest features, and indeed there are most of the possibilities in it.

    Now let's figure out the configuration. The main directory is conf, it contains freeswitch.xml - the root file from which the configuration will be obtained after preprocessing, vars.xml - the file that contains many settings. From this moment in more detail.

    Variables



    For example, a line . It is in this standard line from vars.xml that the name of our domain used in the standard numbering plan is set.
    But in this line it is used in the numbering plan,
    and domain_name is

    In this example, we’ll deal with constants and variables. The constant is specified as $$ {constant_name} and will be replaced by a value during configuration preprocessing. That is, in the resulting configuration, we won’t see a word about constant_name (or about domain and local_ip_v4).
    Variables are set as $ {domain_name}. Their meaning may be different, depending on the circumstances. For example, when calling, there is always a destination_number variable containing the incoming number, or caller_id_number containing the calling party number.
    Constants are set using construction, the variables are set by the system, or you can set them through the set numbering application, example: . After the preprocessing, it will take the form.

    SIP profiles



    SIP is supported by mod_sofia, based on the Sofia-SIP library from Nokia. The list of supported RFC related features is very close to 100%. These are TCP transport, and TLS, SIMPLE, and much more.
    The first thing that mod_sofia needs to work is to declare a profile (conf / sip_profiles / {internal, external} .xml). A profile can be considered as a virtual server from the world of HTTP servers (SIP has many analogies with HTTP in general). Each profile defines an address / port pair, the context in which incoming calls will be processed, registration rules, domain, restrictions, whether authorization is needed.
    For example, the standard internal profile is used to serve internal subscribers. Through this profile, clients of our installation are registered, use voice mail, call each other, arrange conferences, and in general lead an active business life with bureaucratic implications.
    The external profile is used to communicate with the outside world. In its settings, a standard context is set from the numbering plan public, which does not have all of these features. It mainly serves for routing incoming calls to certain numbers in the internal context. For example, transfer incoming calls to 78-14-90 to internal number 1009.

    There is also the concept of gateways. View the contents of the conf / sip_profiles / external / example.xml file. There is an example gateway configuration (commented out). Gateways are designed for use with VoIP providers that require registration on their servers. If the SIP host does not require registration, then calls through it can be arranged through a numbering plan without using the “gateway” configuration entity. But for beauty, you can set the same gateway with the parameter

    In the next series, parsing the number plan.

    Also popular now: