Skip to main content

Chapter 11: Other Endpoints

FreeSWITCH ships with several endpoint modules beyond mod_sofia and mod_verto. This chapter covers the four most commonly referenced: mod_loopback, which provides an internal re-entrant channel used in dialplan construction; mod_skinny, which implements the Cisco SCCP protocol for IP desk phones; mod_rtmp, which bridges Flash/RTMP audio clients into the switch; and mod_alsa, which exposes the local ALSA sound card as a single endpoint. Only mod_loopback is enabled by default in the vanilla modules.conf.xml; the other three must be explicitly enabled.

mod_loopback

mod_loopback registers the loopback endpoint, which creates a pair of internally bridged channels (-a and -b legs) that re-enter the dialplan. It is loaded by default.

A loopback/ call creates two sessions: an outbound A-leg (loopback/\<destination\>-a) and a matching B-leg (loopback/\<destination\>-b) that enters the dialplan as an inbound call. This lets you use bridge, originate, or any bridge-based application to send a call back through the dialplan for additional routing logic, IVRs, or conference injection.

Dial String

loopback/<destination>[/<context>[/<dialplan>]]
  • <destination> is the number or string routed by the target context.
  • <context> overrides the dialplan context for the B-leg (default: default).
  • <dialplan> overrides the dialplan module (default: XML).

An alternate form routes the B-leg directly to an application:

loopback/app=<application>[:<argument>]

Configuration File

mod_loopback reads autoload_configs/loopback.conf.xml if present. No vanilla copy of this file ships with FreeSWITCH; all parameters default to the compiled-in values. The module operates without the file.

<configuration name="loopback.conf" description="Loopback Endpoint">
<settings>
<param name="early-set-loopback-id" value="false"/>
<param name="fire-bowout-on-bridge" value="false"/>
<param name="ignore-channel-ready" value="false"/>
<param name="bowout-hangup-cause" value="NORMAL_UNSPECIFIED"/>
<param name="bowout-controlled-hangup" value="false"/>
<param name="bowout-transfer-recording" value="false"/>
<param name="bowout-disable-on-inner-bridge" value="false"/>
</settings>
</configuration>

Parameters

ParameterPurposeAccepted ValuesDefault
early-set-loopback-idSet the loopback channel variables loopback_leg and is_loopback on both legs before the B-leg is answeredtrue / falsefalse
fire-bowout-on-bridgeFire loopback::direct custom events when a media-path bowout bridge is executedtrue / falsefalse
ignore-channel-readyAllow media reads to continue even when the channel is not yet in the ready statetrue / falsefalse
bowout-hangup-causeHangup cause applied to both loopback legs when a bowout terminates themAny FreeSWITCH cause nameNORMAL_UNSPECIFIED
bowout-controlled-hangupSet CF_INTERCEPTED on both legs and explicitly hang them up after a bowout bridgetrue / falsefalse
bowout-transfer-recordingTransfer active call recordings to the bridged real legs when a bowout succeedstrue / falsefalse
bowout-disable-on-inner-bridgeSuppress automatic bowout when the A-leg carries the CF_INNER_BRIDGE flagtrue / falsefalse

Bowout is the automatic replacement of the loopback bridge with a direct media bridge between the two real endpoints once both legs are answered, eliminating the loopback relay.

Channel Variables

The following channel variables influence per-call loopback behavior at runtime.

VariableEffect
loopback_bowoutSet to false on either leg to prevent automatic bowout for that call
loopback_bowout_on_executeSet to true on the A-leg to trigger a bowout-style replacement when the B-leg enters the execute state
loopback_exportComma-separated list of variable names to copy from the A-leg to the B-leg at channel creation
loopback_no_pre_answerSet to true on the originating channel to suppress the automatic pre_answer issued before the A-leg is created
loopback_initial_codecCodec string (e.g. PCMU/8000/20) to use for the initial loopback codec instead of inheriting from the originating channel

The null Endpoint

mod_loopback also registers the null endpoint. A null channel accepts and immediately terminates a call with a configurable hangup cause. It is useful in dialplan actions that require a bridgeable destination with no media. To cause a specific failure, use null/cause-\<cause-name\> (for example, null/cause-USER_BUSY).


mod_skinny

mod_skinny implements the Cisco Skinny Client Control Protocol (SCCP), supporting Cisco IP phones that use SCCP firmware. It is not loaded by default.

Configuration Files

mod_skinny uses two configuration layers:

  1. autoload_configs/skinny.conf.xml - the top-level file that includes profile definitions.
  2. skinny_profiles/*.xml - one file per SCCP listener profile.

skinny.conf.xml contains only the include directive:

<configuration name="skinny.conf" description="Skinny Endpoints">
<profiles>
<X-PRE-PROCESS cmd="include" data="../skinny_profiles/*.xml"/>
</profiles>
</configuration>

Each file under skinny_profiles/ defines one listener profile. The vanilla profile is skinny_profiles/internal.xml:

<profile name="internal">
<settings>
<param name="domain" value="$${domain}"/>
<param name="ip" value="$${local_ip_v4}"/>
<param name="port" value="2000"/>
<param name="patterns-dialplan" value="XML"/>
<param name="patterns-context" value="skinny-patterns"/>
<param name="dialplan" value="XML"/>
<param name="context" value="default"/>
<param name="keep-alive" value="60"/>
<param name="date-format" value="D/M/Y"/>
<param name="odbc-dsn" value=""/>
<param name="debug" value="4"/>
<param name="auto-restart" value="true"/>
<param name="digit-timeout" value="10000"/>
</settings>
<soft-key-set-sets>
<!-- ... -->
</soft-key-set-sets>
<device-types>
<!-- ... -->
</device-types>
</profile>

Profile Parameters

Changing ip or port sets a PFLAG_SHOULD_RESPAWN flag on the profile. odbc-dsn cannot be changed while the listener socket is open.

ParameterPurposeAccepted ValuesDefault (compiled-in)
domainDomain name sent to phones in SCCP messagesHostname or IP string(none; required)
ipIP address the SCCP TCP listener binds toIPv4 address(none; required)
portTCP port the SCCP listener binds toInteger2000
dialplanDialplan module for inbound calls from registered phonesModule nameXML
contextDialplan context for inbound callsContext namedefault
patterns-dialplanDialplan module used to resolve dial-pattern matchingModule nameXML
patterns-contextDialplan context used to resolve dial-pattern matchingContext nameskinny-patterns
keep-aliveInterval in seconds between keep-alive messages sent to phonesInteger (seconds)60 (vanilla: 60)
date-formatDate format string pushed to phone displaysD/M/Y, M/D/Y, Y/M/D, etc.(none; vanilla: D/M/Y)
odbc-dsnODBC data source name for device/line registration persistenceDSN string(empty; uses SQLite)
digit-timeoutMilliseconds to wait for the next digit during dialingInteger (ms)10000
debugVerbosity of SCCP debug loggingInteger0 (compiled-in); vanilla sets 4
auto-restartAutomatically restart the profile listener on configuration reloadtrue / falsetrue
non-blockingUse non-blocking I/O on the listener sockettrue / falsefalse
ext-voicemailExtension dialed when a phone presses the voicemail softkeyExtension stringvmain
ext-redialExtension dialed when a phone presses the redial softkeyExtension stringredial
ext-meetmeExtension dialed when a phone presses the meet-me softkeyExtension stringconference
ext-pickupExtension dialed when a phone presses the pickup softkeyExtension stringpickup
ext-cfwdallExtension dialed when a phone presses the call-forward-all softkeyExtension stringcfwdall

Soft Key Sets

The <soft-key-set-sets> block inside a profile defines the buttons displayed on the phone screen for each call state. The vanilla profile provides a default set with entries for states such as KeySetOnHook, KeySetConnected, KeySetOnHold, KeySetRingIn, KeySetOffHook, KeySetConnectedWithTransfer, KeySetDigitsAfterDialingFirstDigit, KeySetRingOut, KeySetOffHookWithFeatures, and KeySetInUseHint. Each entry maps a state name to a comma-separated list of softkey names (for example, SoftkeyEndcall, SoftkeyHold, SoftkeyTransfer).

Device Types

The <device-types> block allows per-model firmware overrides. Each <device-type> entry identifies a phone model by its id attribute and accepts a firmware-version parameter specifying the firmware string pushed to matching devices.

<device-types>
<device-type id="Cisco ATA 186">
<param name="firmware-version" value="ATA030101SCCP04"/>
</device-type>
</device-types>

mod_rtmp

mod_rtmp implements the Real-Time Messaging Protocol (RTMP), allowing Flash-based browser clients to place and receive calls through FreeSWITCH. It is not loaded by default.

Configuration File

autoload_configs/rtmp.conf.xml contains one or more named profiles. The vanilla file ships with a single default profile:

<configuration name="rtmp.conf" description="RTMP Endpoint">
<profiles>
<profile name="default">
<settings>
<param name="bind-address" value="0.0.0.0:1935"/>
<param name="context" value="public"/>
<param name="dialplan" value="XML"/>
<param name="auth-calls" value="true"/>
<param name="buffer-len" value="50"/>
<param name="chunksize" value="512"/>
</settings>
</profile>
</profiles>
</configuration>

Parameters

The table below lists the compiled-in defaults. The vanilla rtmp.conf.xml overrides three of them: auth-calls is true, chunksize is 512, and buffer-len is 50.

ParameterPurposeAccepted ValuesCompiled Default
bind-addressIP address and port the RTMP listener binds to; not reloadableip:port string0.0.0.0:1935
contextDialplan context for inbound RTMP callsContext namepublic
dialplanDialplan module for inbound RTMP callsModule nameXML
ioI/O transport module; not reloadabletcptcp
auth-callsReject unauthenticated inbound callstrue / falsefalse (vanilla: true)
chunksizeMaximum size in bytes of outbound RTMP chunksInteger (128-65536)128 (vanilla: 512)
buffer-lenMedia buffer length in milliseconds sent to Flash clientsInteger (0-INT32_MAX)500 (vanilla: 50)

bind-address and io are applied at profile load time and are not reloadable at runtime. All other parameters accept live reload via reload mod_rtmp.


mod_alsa

mod_alsa exposes the local ALSA sound card as a single FreeSWITCH endpoint, allowing the server host machine to act as a phone handset. It is not loaded by default and is only useful on systems with a local audio device (for example, an embedded appliance or development workstation).

Configuration File

autoload_configs/alsa.conf.xml configures the single global device. The module fails to load if the file is absent. The vanilla file ships with only the 5 parameters shown in the example below; the remaining parameters listed in the table accept defaults when omitted.

<configuration name="alsa.conf" description="Soundcard Endpoint">
<settings>
<param name="dialplan" value="XML"/>
<param name="cid-name" value="N800 Alsa"/>
<param name="cid-num" value="5555551212"/>
<param name="sample-rate" value="8000"/>
<param name="codec-ms" value="20"/>
</settings>
</configuration>

Parameters

ParameterPurposeAccepted ValuesDefault
dialplanDialplan module used for inbound calls from the sound cardModule namedefault
cid-nameCaller ID name presented on outbound calls from this deviceString(none)
cid-numCaller ID number presented on outbound calls from this deviceString(none)
sample-rateAudio sample rate in Hz for both capture and playbackInteger8000
codec-msCodec packet interval in milliseconds; must be a multiple of 10 and no greater than SWITCH_MAX_INTERVALInteger20
device-nameALSA device name passed to snd_pcm_open for both capture and playbackALSA device stringdefault
ring-filePath to an audio file played through the speaker when an inbound call is ringingFile path(none)
hold-filePath to an audio file played to the held party; can be overridden per-call with the pa_hold_file channel variableFile path(none)
ring-intervalSeconds between ring-file playback repetitionsInteger (seconds)5
timer-nameFreeSWITCH timer module used for codec pacingTimer namesoft
debugEnable debug logging for the moduleInteger (0 or 1)0

mod_alsa supports only one active audio device at a time. Only the call flagged as master receives and sends audio; all other concurrent calls receive comfort noise or the hold file. The channel variable pa_ring_file overrides ring-file per outbound call.