Freeswitch: Difference between revisions

From 탱이의 잡동사니
Jump to navigation Jump to search
Line 25: Line 25:


* File Formats
* File Formats
: Most of the common audio formats are supported by the mod_dptools:plaback.  
: Most of the common audio formats are supported by the mod_dptools:playback.  


* Loggers
* Loggers
Line 34: Line 34:


There a few more types of modules, but there are the common ones. You can find more modules at here(https://freeswitch.org/confluence/display/FREESWITCH/Modules).
There a few more types of modules, but there are the common ones. You can find more modules at here(https://freeswitch.org/confluence/display/FREESWITCH/Modules).
=== API ===
Many modules also have API commands that can be issued from the command line, script or sent from a remote computer via the event socket. What the API commands can do are up to each individual module, but some common functionalities include returning status information(such as how many listeners are in a conference) or control the currently running application(such as pausing a file being played). There are hundreds of APIs available from the different modules. In the command line you can type show API to see all APIs based on the modules that are loaded.


== Installation ==
== Installation ==

Revision as of 08:26, 4 December 2020

Overview

Freeswitch 내용 정리.

Architecture

Modules

When you install the FreeSWITCH with the default configuration, the modules that are required for most common scenarios are enabled.

The modules are grouped by the type of functionality they provide.

  • Endpoint
Endpoint modules support types of communications devices such as VoIP, PSTN, Skype, Google Talk etc. Endpoint modules are one of the most important modules in FreeSWITCH.
  • Application
This is where all the action is happening. There are hundreds of application modules include in the default setup a few examples are playing a file, joining a conference, send a call to voicemail, play an IVR menu. Many of common applications are provided by the dptools module.
  • Dialplan
A Dialplan module is responsible for routing calls, based on information such as Caller ID, Destination Number and more. The default dialplan module is the XML Dialplan.
  • Directory
Provides authentication and configurations for users that can register with FreeSWTICH. The most common directory module is the XML Directory.
  • Codecs
Codecs are used to encode and compress audio for streaming.
  • File Formats
Most of the common audio formats are supported by the mod_dptools:playback.
  • Loggers
Record log messages. Some of the included loggers are console and log file. xml_cdr is another commonly used logger to output call detail records.
  • Languages
Support scripting languages which can be run as part of the dialplan. The most popular language is Lua. Javascript and few others are also supported.

There a few more types of modules, but there are the common ones. You can find more modules at here(https://freeswitch.org/confluence/display/FREESWITCH/Modules).

API

Many modules also have API commands that can be issued from the command line, script or sent from a remote computer via the event socket. What the API commands can do are up to each individual module, but some common functionalities include returning status information(such as how many listeners are in a conference) or control the currently running application(such as pausing a file being played). There are hundreds of APIs available from the different modules. In the command line you can type show API to see all APIs based on the modules that are loaded.

Installation

Source

git clone 후 컴파일을 진행한다. <source lang=bash> $ git clone https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch.git </source>

특정 버전을 이용하고 싶다면 다음과 같이 v 이후에 버전 정보를 붙여주면 된다. <source lang=bash> $ git clone -b v1.6 https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch.git </source>

Package

간단하게 패키지 저장소 추가후, apt-get 으로 설치가 가능하다. <source lang=bash> $ apt-get update && apt-get install -y curl $ curl https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add -

$ echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list

  1. you may want to populate /etc/freeswitch at this point.
  2. if /etc/freeswitch does not exist, the standard vanilla configuration is deployed

$ apt-get update && apt-get install -y freeswitch-all freeswitch-all-dbg gdb </source>

fs_cli

Freeswitch 용 console 실행 명령어는 fs_cli 이다. <source lang=bash> $ fs_cli </source>

Options

Usage: fs_cli [-H <host>] [-P <port>] [-p <secret>] [-d <level>] [-x command] [-t <timeout_ms>] [profile]

  -?,-h --help                    Usage Information
  -H, --host=hostname             Host to connect
  -P, --port=port                 Port to connect (1 - 65535)
  -u, --user=user@domain          user@domain
  -p, --password=password         Password
  -i, --interrupt                 Allow Control-c to interrupt
  -x, --execute=command           Execute Command and Exit
  -l, --loglevel=command          Log Level
  -U, --log-uuid                  Include UUID in log output
  -S, --log-uuid-short            Include shortened UUID in log output
  -q, --quiet                     Disable logging
  -r, --retry                     Retry connection on failure
  -R, --reconnect                 Reconnect if disconnected
  -d, --debug=level               Debug Level (0 - 7)
  -b, --batchmode                 Batch mode
  -t, --timeout                   Timeout for API commands (in miliseconds)
  -T, --connect-timeout           Timeout for socket connection (in miliseconds)
  -n, --no-color                  Disable color

Localhost 접속시, 다음과 같이 입력하면 된다. <source lang=bash> $ fs_cli -H localhost </source>

Config

See also