### Example SCGI Binding Configuration Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/xml-interfaces/mod_xml_scgi.mdx This example shows a trimmed configuration for an SCGI binding named 'example'. It includes commented-out parameters for host, port, timeout, and enabling specific channel variables. ```xml ``` -------------------------------- ### EasyRoute Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/applications/mod_easyroute.mdx An example excerpt from the shipped easyroute.conf.xml file, showing how to set various parameters. ```xml ``` -------------------------------- ### mod_osp Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/applications/mod_osp.mdx An example excerpt from osp.conf.xml showing global settings and a default profile configuration for OSP connections. ```xml ``` -------------------------------- ### Memcache Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/data-stores/mod_memcache.mdx This is a real example from the shipped memcache.conf.xml file, showing how to specify Memcached server addresses. ```xml ``` -------------------------------- ### Sequential Originate Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/dialplan/dptools-reference.mdx Example demonstrating sequential (failover) originate using a pipe separator. Legs are tried in order. ```freeswitch sofia/internal/1001@pbx.example.com|sofia/internal/1002@pbx.example.com ``` -------------------------------- ### mod_mongo Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/data-stores/mod_mongo.mdx A minimal example of the mongo.conf.xml file, showing how to set the connection string for MongoDB. ```xml ``` -------------------------------- ### Memcache Get Command Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/data-stores/mod_memcache.mdx Shows how to retrieve a value from Memcached using the 'memcache get' command in fs_cli. ```freeswitch-cli freeswitch@> memcache get mykey hello world ``` -------------------------------- ### mod_directory Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/applications/mod_directory.mdx This is an example of the `directory.conf.xml` file, showing global settings and a default profile configuration with various parameters for controlling search behavior and key mappings. ```xml ``` -------------------------------- ### PocketSphinx Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/asr-tts/mod_pocketsphinx.mdx This is an example excerpt from the shipped `pocketsphinx.conf.xml` file, showing common configuration parameters for the PocketSphinx ASR module. ```xml ``` -------------------------------- ### mod_hiredis Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/data-stores/mod_hiredis.mdx This example shows how to configure profiles, connections, and parameters for mod_hiredis in hiredis.conf.xml. It includes primary and secondary Redis connection details. ```xml ``` -------------------------------- ### mod_perl Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/integration/scripting.mdx Example of how to configure mod_perl in perl.conf.xml, specifying XML handler script, bindings, and startup scripts. ```xml ``` -------------------------------- ### Simultaneous Originate Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/dialplan/dptools-reference.mdx Example demonstrating simultaneous (parallel) originate using a comma separator. The first leg to answer wins. ```freeswitch sofia/internal/1001@pbx.example.com,sofia/internal/1002@pbx.example.com ``` -------------------------------- ### Enterprise Parallel Originate Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/dialplan/dptools-reference.mdx Example of enterprise parallel originate using ':_:' separator for concurrent leg dispatch with independent tracking. ```freeswitch sofia/internal/1001@pbx.example.com:_:sofia/internal/1002@pbx.example.com ``` -------------------------------- ### Start FreeSWITCH in Foreground Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/foundations/getting-started.mdx Run the FreeSWITCH binary directly to start the service attached to the console. This is useful for monitoring startup and immediate output. ```bash freeswitch ``` -------------------------------- ### Install FreeSWITCH Packages and Sounds (Debian/Ubuntu) Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/foundations/getting-started.mdx Installs the 'vanilla' FreeSWITCH meta package, which includes modules for the default configuration, along with US English call sounds and music on hold. This command assumes the repository has already been added. ```bash apt-get install -y freeswitch-meta-vanilla \ freeswitch-sounds-en-us-callie freeswitch-sounds-music ``` -------------------------------- ### Limit Application Dialplan Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/applications/utility-applications.mdx An example demonstrating the `limit` application within a FreeSWITCH dialplan extension, including a fallback extension for when the limit is exceeded. ```xml ``` -------------------------------- ### Valet Parking XML API Response Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/applications/utility-applications.mdx Example XML output from the valet_info API command, showing active parking lots and their extensions. ```xml 6001 ``` -------------------------------- ### Start FreeSWITCH as a Daemon Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/foundations/getting-started.mdx Run the FreeSWITCH binary with the -nc flag to start it in the background as a daemon. This allows the terminal to be used for other tasks. ```bash freeswitch -nc ``` -------------------------------- ### mod_python3 Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/integration/scripting.mdx Example of configuring mod_python3 in python.conf.xml. Note that script values refer to Python modules, not file paths. ```xml ``` -------------------------------- ### Chatplan Example: Echo, Local Routing, and Drop Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/dialplan/xml-dialplan.mdx A comprehensive chatplan example demonstrating how to echo messages back, route to local SIP endpoints, and log/drop all other messages. ```xml ``` -------------------------------- ### Example tts_commandline.conf.xml Configuration Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/asr-tts/mod_tts_commandline.mdx This configuration example pipes the text through Festival's text2wave tool at the requested sample rate and writes the WAV to the temporary output path. The 'command' parameter defines the shell command template with placeholders. ```xml ``` -------------------------------- ### FreeSWITCH Logging Command Examples Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/troubleshooting/diagnostic-toolbox.mdx Provides examples of commands for adjusting log verbosity. Use '/log ' for watching a specific console session, 'console loglevel' for terminal output, and 'fsctl loglevel' for global core logging. ```text /log ``` ```text console loglevel ``` ```text fsctl loglevel ``` -------------------------------- ### mod_nibblebill Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/applications/mod_nibblebill.mdx This is a trimmed example of the nibblebill.conf.xml file, showing essential settings for connecting to an ODBC database and configuring billing parameters like heartbeat, low balance thresholds, and actions. ```xml ``` -------------------------------- ### Event Socket Worked Session Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/integration/event-socket.mdx This example demonstrates a full interaction with the Event Socket, including authentication, API commands, background jobs, event subscriptions, and disconnection. ```text < Content-Type: auth/request < > auth ClueCon > < Content-Type: command/reply < Reply-Text: +OK accepted < > api status > < Content-Type: api/response < Content-Length: 1234 < < UP 0 years, 0 days, 2 hours, 14 minutes, 22 seconds, 647 milliseconds, 552 microseconds < ... > bgapi originate sofia/gateway/mygw/15551234567 &echo > < Content-Type: command/reply < Reply-Text: +OK Job-UUID: a1b2c3d4-e5f6-7890-abcd-ef1234567890 < Job-UUID: a1b2c3d4-e5f6-7890-abcd-ef1234567890 < < Content-Type: text/event-plain < Content-Length: 502 < < Event-Name: BACKGROUND_JOB < Job-UUID: a1b2c3d4-e5f6-7890-abcd-ef1234567890 < Job-Command: originate < Job-Command-Arg: sofia/gateway/mygw/15551234567 &echo < < +OK b7f1e2a0-1234-5678-abcd-000000000001 > event plain HEARTBEAT > < Content-Type: command/reply < Reply-Text: +OK event listener enabled plain < < Content-Type: text/event-plain < Content-Length: 432 < < Event-Name: HEARTBEAT < Core-UUID: ... < Event-Date-Timestamp: ... < ... > exit > < Content-Type: command/reply < Reply-Text: +OK bye < < Content-Type: text/disconnect-notice < Content-Length: 14 < < Disconnected. ``` -------------------------------- ### mod_redis Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/data-stores/mod_redis.mdx This is an example of the redis.conf.xml file. It configures the Redis server host, port, and connection timeout. The 'ignore_connect_fail' parameter defaults to false if not specified. ```xml ``` -------------------------------- ### Event Multicast Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/event-handlers/mod_event_multicast.mdx This example shows a basic configuration for mod_event_multicast, specifying the multicast address, port, and event bindings. The 'psk' parameter is commented out, indicating unencrypted communication. ```xml ``` -------------------------------- ### mod_db Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/applications/utility-applications.mdx Example configuration for mod_db, specifying the ODBC DSN or native DSN for database connectivity. If not specified, FreeSWITCH defaults to a local SQLite database. ```xml ``` -------------------------------- ### Copy Default Configuration to /etc/freeswitch Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/foundations/getting-started.mdx Copies the vanilla FreeSWITCH profile from the installation directory to the active configuration directory (/etc/freeswitch). This is necessary if the packaging only installs sample configurations and not the default profile directly into /etc/freeswitch. ```bash cp -a /usr/share/freeswitch/conf/vanilla/. /etc/freeswitch/ ``` -------------------------------- ### Enable and Start FreeSWITCH Systemd Service Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/foundations/getting-started.mdx Enables the FreeSWITCH systemd service to start automatically on boot and starts the service immediately. This command is used after installing FreeSWITCH packages. ```bash systemctl enable --now freeswitch ``` -------------------------------- ### FreeSWITCH CLI Session Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/reference/cli-and-api.mdx Demonstrates a typical operator workflow including checking system status, inspecting channels, transferring calls, and managing logging and configuration. ```bash freeswitch@pbx> status UP 0 years, 0 days, 2 hours, 14 minutes, 33 seconds, 412 milliseconds, 744 microseconds FreeSWITCH (Version 1.10.x) is ready 2 session(s) since startup 1 session(s) - peak 1, last 5min 1 0 session(s) per Sec out of max 30, peak 1, last 5min 1 1000 session(s) max min idle cpu 0.00/99.60 Current Stack Size/Max 240K/8192K freeswitch@pbx> show channels uuid,direction,created,created_epoch,name,state,cid_name,cid_num,... 5a3f1c2e-...,inbound,2026-06-02 10:31:00,... freeswitch@pbx> uuid_transfer 5a3f1c2e-... 2000 XML default +OK freeswitch@pbx> sofia status profile internal ================================= Name internal ... RUNNING (2) freeswitch@pbx> fsctl loglevel debug freeswitch@pbx> reloadxml +OK [Success] ``` -------------------------------- ### Making an HTTP GET Request Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/applications/mod_curl.mdx Use the `curl` command to make a GET request to a specified URL. This is a basic example of fetching status information. ```freeswitch-cli freeswitch@> curl https://api.example.com/status get ``` -------------------------------- ### Presence Map Configuration Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/users-endpoints/sip-profiles-sofia.mdx Defines presence mappings in presence_map.conf.xml. This example maps extensions starting with '3' to the 'conf' presence protocol and extensions starting with '4' to the 'park' presence protocol. ```xml ``` -------------------------------- ### Start Chroma Key Effect Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/applications/mod_video_filter.mdx Initiate a chroma key effect on a specific channel using the chromakey API command. This example starts a chroma key with a green background and a specified image. ```bash chromakey start #00ff00 300 /images/office.png ``` -------------------------------- ### Memcache Get in Dialplan Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/data-stores/mod_memcache.mdx Example of using the memcache module within FreeSWITCH dialplan to retrieve a cached value and set it to a variable. ```xml ``` -------------------------------- ### Configuring dialplan_directory.conf.xml Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/dialplans/mod_dialplan_directory.mdx This example shows the required parameters for connecting to a directory service. Ensure all parameters are correctly set for the module to function. ```xml ``` -------------------------------- ### mod_curl Usage Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/applications/mod_curl.mdx Demonstrates how to use the `curl` application to make an HTTP GET request and store the response body in a channel variable. ```freeswitch ``` -------------------------------- ### Originate CLI Error Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/troubleshooting/call-setup-failures.mdx When using the `originate` command from the `fs_cli`, an error response indicates a call setup failure. The string following `-ERR` specifies the cause of the failure. ```text freeswitch@host> originate sofia/gateway/my_gateway/18005551212 &echo -ERR GATEWAY_DOWN ``` -------------------------------- ### Asterisk Goto Application Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/dialplans/mod_dialplan_asterisk.mdx Shows how to transfer a session to a different extension within a context using Asterisk's Goto syntax. ```asterisk exten => _1XXXXX,n,Goto(default|music) ``` -------------------------------- ### Set Variable with Substring Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/dialplan/xml-dialplan.mdx Demonstrates using variable modifiers to extract substrings. The first example removes the first character, and the second extracts three characters starting from the second position. ```xml ``` -------------------------------- ### Playback Examples with mod_vlc Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/formats/mod_vlc.mdx Demonstrates how to use the `playback` dialplan application with different media sources supported by mod_vlc, including local files, HTTP streams, and VLC URIs. ```xml ``` ```xml ``` ```xml ``` -------------------------------- ### Start Capture via uuid_snapshot (fs_cli) Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/applications/mod_snapshot.mdx Initiates a 30-second rolling capture on a specific channel identified by its UUID. This example captures the 'read' (inbound) leg and uses 'mycall' as the filename prefix. ```text uuid_snapshot 1234abcd-... start 30 read mycall ``` -------------------------------- ### Add SignalWire FreeSWITCH Repository (Debian/Ubuntu) Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/foundations/getting-started.mdx Installs necessary packages, adds the SignalWire repository signing key authenticated with a Personal Access Token, and registers the package source for apt. Ensure you replace YOUR_SIGNALWIRE_TOKEN with your actual token. ```bash TOKEN=YOUR_SIGNALWIRE_TOKEN apt-get update && apt-get install -y gnupg2 wget lsb-release # Add the repository signing key, authenticated with your token wget --http-user=signalwire --http-password="$TOKEN" \ -O /usr/share/keyrings/signalwire-freeswitch-repo.gpg \ https://freeswitch.signalwire.com/repo/deb/debian-release/signalwire-freeswitch-repo.gpg # Store the repository credentials for apt echo "machine freeswitch.signalwire.com login signalwire password $TOKEN" \ > /etc/apt/auth.conf.d/freeswitch.conf chmod 600 /etc/apt/auth.conf.d/freeswitch.conf # Register the package source for this distribution release echo "deb [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/debian-release/ $(lsb_release -sc) main" \ > /etc/apt/sources.list.d/freeswitch.list apt-get update ``` -------------------------------- ### avmd start Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/applications/mod_avmd.mdx Starts audio event detection on an existing session identified by its UUID. ```APIDOC ## avmd start ### Description Starts audio event detection on an existing session identified by its UUID. ### Method API Command ### Endpoint N/A (fs_cli or ESL command) ### Parameters #### Path Parameters - **uuid** (string) - Required - The unique identifier of the session. #### Command Arguments - **start** (string) - Required - Keyword to start detection. ``` -------------------------------- ### Example opal.conf.xml Configuration Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/endpoints/mod_opal.mdx This snippet shows a complete example of the `opal.conf.xml` file, including global settings and a listener configuration. It demonstrates how to set parameters like trace level, context, dialplan, DTMF type, jitter size, and gatekeeper interface, as well as binding an H.323 listener to a specific IP and port. ```xml ``` -------------------------------- ### fs_cli Examples for avmd Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/applications/mod_avmd.mdx Examples of using avmd commands in the FreeSWITCH Command Line Interface (fs_cli). ```bash avmd 3e7a2707-cd5a-4b5e-8c7f-1234abcd start avmd 3e7a2707-cd5a-4b5e-8c7f-1234abcd stop avmd reload avmd show ``` -------------------------------- ### Playback PNG as Video Source with Audio Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/formats/mod_png.mdx This dialplan example demonstrates how to use the playback application to stream a PNG image as a video source. It includes an optional audio file to play simultaneously and sets a maximum duration for the stream. ```xml ``` -------------------------------- ### Start avmd with global defaults Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/applications/mod_avmd.mdx Starts audio media detection using the global default configuration for the session. ```xml ``` -------------------------------- ### Lua Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/integration/scripting.mdx This XML configuration sets up script directories for Lua modules, defines an XML handler script, and registers a startup script and an event hook. ```xml ``` -------------------------------- ### Build FreeSWITCH from Source Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/foundations/getting-started.mdx Clone the FreeSWITCH repository, generate build scripts, configure modules, compile, and install binaries and sound files. ```bash git clone https://github.com/signalwire/freeswitch.git cd freeswitch # Generate the configure script and the module build list ./bootstrap.sh -j # Optionally edit modules.conf to select which modules compile, then configure ./configure # Compile and install the binaries make make install # Install the sound files: prompts and music on hold make cd-sounds-install cd-moh-install ``` -------------------------------- ### Using the `say` dialplan application Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/say-modules.mdx Examples of how to use the `say` dialplan application to speak numbers, currency, dates, and times. Ensure the correct module and language are specified. ```xml ``` -------------------------------- ### Configure xml_rpc.conf.xml Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/xml-interfaces/mod_xml_rpc.mdx Example configuration for `xml_rpc.conf.xml`, setting the HTTP port and authentication parameters. ```xml ``` -------------------------------- ### Pickup Endpoint Prefix Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/dialplan/dptools-reference.mdx Example of using the 'pickup' endpoint prefix to register a call into a named pickup group. ```freeswitch pickup/sales ``` -------------------------------- ### Group Endpoint Prefix Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/dialplan/dptools-reference.mdx Example of using the 'group' endpoint prefix to dial all members of a directory group simultaneously. ```freeswitch group/support@example.com ``` -------------------------------- ### Inline Originate with Asterisk Dialplan Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/dialplans/mod_dialplan_asterisk.mdx This example shows how to initiate a call using the 'originate' command and direct it to use the Asterisk dialplan engine. The 'asterisk' keyword specifies the dialplan engine, and 'default' is the context to be used. ```bash originate sofia/internal/1000@pbx.example.com &park() asterisk default ``` -------------------------------- ### Loopback Endpoint Prefix Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/dialplan/dptools-reference.mdx Example of using the 'loopback' endpoint prefix to re-enter the dialplan at a specific extension and context. ```freeswitch loopback/1001/default ``` -------------------------------- ### Directory Application with Specific Domain, Dialplan, and Context Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/applications/mod_directory.mdx This example shows how to use the directory application to search within a specific domain ('example.com'), using an alternate dialplan ('XML') and context ('sales'). ```xml ``` -------------------------------- ### Sofia Gateway Endpoint Prefix Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/dialplan/dptools-reference.mdx Example of using the 'sofia/gateway' endpoint prefix to dial a number through a named gateway. ```freeswitch sofia/gateway/mycarrier/15551234567 ``` -------------------------------- ### Install OpenLDAP Development Libraries (Debian/Ubuntu) Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/xml-interfaces/mod_ldap.mdx Install the OpenLDAP client development libraries before building mod_ldap on Debian/Ubuntu systems. ```bash apt-get install libldap2-dev ``` -------------------------------- ### SignalWire Configuration File Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/integration/signalwire.mdx This XML snippet shows the default structure and commented-out parameters for the signalwire.conf.xml configuration file. Uncomment and modify parameters to override compiled-in defaults. ```xml ``` -------------------------------- ### mod_v8 Configuration with Hooks and Modules Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/integration/scripting.mdx Example configuration for mod_v8, demonstrating script caching, hook definitions for events, and loading native V8 modules. ```xml ``` -------------------------------- ### Example SMPP Gateway Configuration Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/event-handlers/mod_smpp.mdx This configuration defines a named SMPP gateway named 'example.com' with specific connection parameters for an SMPP server. Changes to this file require a FreeSWITCH restart. ```xml ``` -------------------------------- ### HTTAPI Configuration File Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/integration/xml-curl.mdx This is a sample configuration file for mod_httapi, defining global settings, profiles, and permissions for HTTP-driven call control. ```xml ``` -------------------------------- ### Error Endpoint Prefix Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/dialplan/dptools-reference.mdx Example of using the 'error' endpoint prefix to immediately return a specific Q.850 hangup cause. ```freeswitch error/USER_BUSY ``` -------------------------------- ### H.323 Configuration Example Source: https://github.com/signalwire/freeswitch-docs/blob/main/docs/module-reference/endpoints/mod_h323.mdx This XML snippet demonstrates a typical configuration for the H.323 module, including global settings and listener definitions. ```xml ```