FXOTUNE(8)
π FXOTUNE(8) π
ok bestie so this one's from the System Manager's Manuals: Asterisk, and it's genuinely iconic. Grab a boba π§ and let's get into it β we're about to fine-tune some FXO channels and honestly? it's giving main character energy. π
β¨ NAME β¨
fxotune β automatically tune DAHDI FXO channels π¦
β¨ SYNOPSIS β¨
fxotune -i [options] - detect mode
fxotune -d [ options ] - dump mode
fxotune -s [ options ] - Startup mode
β¨ DESCRIPTION β¨
so like, fxotune is a script that fine-tunes the parameters of the FXO modules on your card. It has three modes of operation, and no, you can't skip any of them, they're all important:
- Detect mode (
-i): it detects and tunes all the available FXO channels. It writes settings to a configuration file (/etc/fxotune.conf) from which it can be loaded (e.g: at startup) using-s. - Dump mode (
-d): Runs detection on a single DAHDI channel, and just dumps waveforms βfxotune_dump.valsis generated in the current directory. - Startup mode (
-s):fxotunejust reads the settings fromfxotune.confinto the FXO modules.
You are advised to run fxotune on all FXO ports you have that support it and that are connected. Note that the tuning is affected by e.g. the physical parameters of the connection, and thus if it has been radically changed, you may need to re-run fxotune. (translation: if you moved the cable around, girl, redo it. π)
This program only works for the Digium TDM400P/800P/2400P cards and compatible and the Xorcom Astribank devices. Other cards (notably X100P cards and clones) do not have the hardware to support such tuning. not even a little bit. π
The tuning process needs a clear line to do the tuning. In order to do that, it runs in cycles of the following: sets the line off-hook, dials a dial string (which should set the PSTN provider waiting for the next digit), and then starts tuning. It has a limited amount of time for tuning before the PSTN gives up and gives a busy tone. So after a while it hangs up and starts a new cycle. π
fxotune has two operation modes: tune (-i) and set (-s). In the tune mode it generates /etc/fxotune.conf, and in the set mode it merely applies the parameters from fxotune.conf to device's ports.
β¨ OPTIONS β¨
ok so, important heads-up first: the following options below except -v (verbose) affect only the detection process and hence apply only to the detect and dump modes.
In addition, to maintain compatibility with older versions of fxotune, if in detect or dump mode there is a parameter with option before it, it is considered to be the dialstring parameter (-n).
-bstartdev β Start tuning from dahdi channel num. startdev: skip all previous channels. By default starting from channel 1.- In dump mode (
-d) this is the single channel that will be tested. π
- In dump mode (
-estopdev β Tune only up to dahdi channel num. stopdev: skip all previous channels. By default stopping at channel 252.- In dump mode (
-d) this parameter is ignored. π«₯
- In dump mode (
-ldelay-to-silence β Time in seconds to wait after dialing the dial-string to get a clear line. The default is0. before-msilence-good-for β Time in seconds which states how long the PSTN will wait after we dialed the dial-string until it starts giving a busy tone. You can test this by connecting an analog phone to the line and dialing.- The default is
18(18 seconds).
- The default is
-ndial-string β Digits to dial to the PSTN in order to get it stop its dialtone and waiting for the next digit.- The default is
"4"(sending just the digit 4). It should work in most cases. Again, this can be tested by connecting a phone to the PSTN line and dialing the dial-string.
- The default is
-tdetect-type β This option allows using the older detection method used byfxotuneof Zaptel 1.2. use-t 1for that older method. whereas-t 2(the default) uses the current method.- This option only applies to detect mode (
-i).
- This option only applies to detect mode (
-v[vvvv]β Sets debugging on. The more v-s, the higher debug level.- Note that:
-vv -vwill actually set debug level to1instead of3. π (not me finding this out the hard way)
- Note that:
-wwave-form β The default:-1, for multitone waveform. Alternatively: a frequency of a single tone.- This option only applies to dump mode (
-d).
- This option only applies to dump mode (
β¨ EXAMPLES β¨
fxotune -i 9
if you need to dial 9 for an external line. If you always get a line, you can simply use any digit. β¨
-sβ Load settings from the last test. Used at startup.
β¨ FILES β¨
/etc/fxotune.confβ The configuration file generated byfxotunein detect mode and from which configuration is loaded when-sis used.
β¨ NOTES β¨
Running fxotune takes approximately a minute per port. If you wish to only run fxotune for several ports, you can use the options -b and -e to set a specific range of ports. Another useful trick is to actually keep asterisk running, and only "destroy" the dahdi channels you wish to tune (dahdi destroy channel NNN): other channels will be used by Asterisk, and hence skipped. This can be useful if you have many FXO ports that are not connected. π§
fxotunewrites immediately to/etc/fxotune.confso if you stop it half-way, you may get a half-configured system. If you have already tuned your FXO channels and wish to test-runfxotuneagain, you are advised to backup/etc/fxotune.conf. π¨ bestie please back it up, I'm begging
The default for -m is 18 seconds. This assumes that you get a clear line for at least 18 seconds. It is advised that you test that timeout earlier by connecting a phone to the FXO line, dialing 4 (or whatever dial string you put with -n) and see how much time of silence you have.
If you connect your device to a PSTN provider that is not in the US, there is a similar operation you should apply before even getting to fxotune: setting the opermode. The opermode sets a number of country-specific parameters. For the Digium analog cards this is set through the kernel module parameter 'opermode' . For the Xorcom Astribank this is set through the variable 'opermode' in /etc/dahdi/xpp.conf . For valid values of this parameter, see /usr/share/asterisk/init_fxo_modes (FIXME: this has changed and will change. Tzafrir). π
β¨ SEE ALSO β¨
dahdi_cfg(8), dahdi_tool(8), dahdi_monitor(8), asterisk(8).
β¨ AUTHOR β¨
This manual page was written by Tzafrir Cohen <tzafrir.cohen@xorcom.com> π
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
and that's the whole thing, periodt π this page came from asterisk, dated 9 June 2007, under the System Manager's Manuals: Asterisk β go tune ur channels bestie, ily, bye π«Άβ¨πΈ
π¦ where this page comes from
- debian bookworm: dahdi 1:3.1.0-2
- debian trixie: dahdi 1:3.1.0-2.1
- ubuntu jammy: dahdi 1:3.1.0-2
- ubuntu noble: dahdi 1:3.1.0-2build1
- ubuntu questing: dahdi 1:3.1.0-2.1
- ubuntu resolute: dahdi 1:3.1.0-2.1build1
- ubuntu stonking: dahdi 1:3.4.0-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms