Skip to main content

mod_h323 — H.323 Endpoint (ooH323c)

mod_h323 is a FreeSWITCH endpoint module (located under src/mod/endpoints) that implements H.323 signaling using the ooH323c library layered on PTLib. It registers FreeSWITCH as an H.323 terminal or gateway, listens on TCP port 1720 (Q.931), and handles H.245 capability negotiation and RTP media setup.

Reach for this module when you need to interoperate with legacy H.323 equipment — PBXs, gatekeepers, video-conferencing endpoints, or H.323 trunks — and need gatekeeper registration, FastStart, H.245 tunneling, or T.38 fax relay over an H.323 leg.

Loading the Module

The module name to load is mod_h323. It is not present in the vanilla autoload_configs/modules.conf.xml and must be added manually before it will load at startup.

Add to autoload_configs/modules.conf.xml:

<load module="mod_h323"/>

Building the module also requires PTLib and ooH323c (see Dependencies).

Configuration: h323.conf.xml

The module reads h323.conf at load time (and on reload). The file contains a <settings> block with global parameters and a <listeners> block with one or more TCP listener definitions.

Settings parameters

ParameterPurposeAccepted ValuesDefault
trace-levelPTLib/ooH323c trace verbosity sent to the FreeSWITCH logInteger (0 = off, higher = more verbose)0
contextDialplan context for inbound callsAny valid context stringdefault
dialplanDialplan engine for inbound callsXML, Asterisk, etc.XML
codec-prefsComma-separated list of codecs to advertiseFreeSWITCH codec names: PCMA, PCMU, GSM, G729, G723, G729b, G729a, G729ab, G723.1, G723.1-5k3, G723.1a-5k3, G723.1a-6k3(none; all supported codecs)
use-rtp-timerEnable the FreeSWITCH RTP timertrue / falsefalse
rtp-timer-nameTimer name used when use-rtp-timer is truesoft or any installed timersoft
ptime-override-valueOverride the negotiated packetization time (ms)Integer ms; omit or set to -1 to disable-1 (disabled)
jitter-sizeAudio jitter buffer size in ms; supply min,max for a rangeInteger or min,max e.g. 60 or 20,100; value < 10 sets 0 (no jitter buffer)(library default)
faststartEnable H.323 FastStarttrue / falsetrue
h245tunnelingEnable H.245 tunneling inside H.225true / falsetrue
h245insetupInclude H.245 address in the Setup PDUtrue / falsetrue
dtmfinbandDetect in-band DTMFtrue / falsefalse
endpoint-nameH.323 local user name / alias advertised to the gatekeeperAny stringFreeSwitch
progress-indicationProgress Indicator value sent in Progress/Connect PDUs (Q.931 PI field)Integer 1–8 (7 is reserved; coerced to 8)8
alerting-indicationProgress Indicator value sent in Alerting PDUsInteger 0–8 (0 = omit; 7 coerced to 8)0
fax-old-asnUse the pre-standard T.38-IFP ASN encoding varianttrue / falsefalse
gk-addressGatekeeper IP or hostname; empty to disable, * to auto-discover on the LANIP, hostname, *, or empty(disabled)
gk-identiferOptional gatekeeper identifier (GK name)String(none)
gk-interfaceLocal UDP interface (IP:port) for gatekeeper RASIP:port or empty(none)
gk-retryGatekeeper registration retry interval in secondsInteger30
gk-prefixE.164 prefix to advertise to the gatekeeper (repeatable)Digit string(none)

Listener parameters

Each <listener> element inside <listeners> defines one TCP listening socket.

ParameterPurposeAccepted ValuesDefault
h323-ipLocal IP address to listen onIP address or FreeSWITCH global variable$${local_ip_v4}
h323-portTCP port for Q.931 signalingInteger1720

Configuration example

<configuration name="h323.conf" description="H323 Endpoints">
<settings>
<param name="trace-level" value="10"/>
<param name="context" value="default"/>
<param name="dialplan" value="XML"/>
<param name="codec-prefs" value="PCMA,PCMU,GSM,G729"/>
<param name="use-rtp-timer" value="true"/>
<param name="rtp-timer-name" value="soft"/>
<!-- <param name="ptime-override-value" value="20"/> -->
<param name="gk-address" value=""/>
<param name="gk-identifer" value=""/>
<param name="gk-interface" value=""/>
<param name="gk-retry" value="30"/>
<param name="faststart" value="true"/>
<param name="h245tunneling" value="true"/>
<param name="h245insetup" value="true"/>
<param name="jitter-size" value="60"/>
<param name="progress-indication" value="8"/>
<param name="alerting-indication" value="8"/>
<param name="endpoint-name" value="fs"/>
<param name="fax-old-asn" value="true"/>
</settings>
<listeners>
<listener name="default">
<param name="h323-ip" value="$${local_ip_v4}"/>
<param name="h323-port" value="1720"/>
</listener>
</listeners>
</configuration>

Originating and Receiving Calls

Receiving calls

Inbound H.323 calls arrive on the configured listener (TCP 1720 by default). The module creates a session and places it into the dialplan context specified by the context parameter. The destination number is taken from the H.225 destinationAddress alias list, or from the Q.931 Called-Party-Number if no alias is present. The channel is named h323/<destination>.

Originating calls

Use the h323 endpoint prefix in the dialplan or with originate:

originate h323/12125551212@192.0.2.10 &echo

The destination string is passed directly to the ooH323c MakeCall function. If a gatekeeper is configured, the number may be resolved by the gatekeeper rather than dialed directly.

Channel Variables

The following channel variables are read by the module at runtime:

VariableSet / ReadPurpose
progress-indicationReadOverrides the global progress-indication setting for the Progress PDU PI value on a per-call basis.
alerting-indicationReadOverrides the global alerting-indication setting for the Alerting PDU PI value on a per-call basis.
fax_enable_t38_insistReadWhen set to true, the T.38 re-INVITE sent to the peer includes the insist flag (numeric_arg = 1).
timer_nameReadIf use-rtp-timer is disabled, this variable can supply the timer name to use for the RTP session (e.g., soft).

Dependencies

mod_h323 requires PTLib and ooH323c (the Open H.323 C library) to be installed and discoverable by the build system before compilation. These libraries are not included with FreeSWITCH and are not built by default. Install them from your distribution's package manager or build from source before running ./configure and make mod_h323.

See also

Source: src/mod/endpoints/mod_h323, src/mod/endpoints/mod_h323/h323.conf.xml