ztloop is a linux kernel module developed by Druid Software Ltd that emulates a PRI card where the first 2 spans are connected in loopback.
It also allows tapping of data transmission between span 1 and 2 using spans 3 and 4.
Clocking code is borrowed from the ztdummy module.
ztloop allows developers to test user space applications without the need for installing a zaptel based PRI card.
Example with Illustration
The following diagram illustrates an example of a setup using the ztloop.
/etc/zaptel.conf is thus configured like it would be for a regular PRI card.
2 userspace applications have opened the D channel of their respective span (16 & 47) and are transmitting data.
What is sent over /dev/zap/16 is received by /dev/zap/47 and vice versa.
ztloop automatically configures pseudo span 3 to monitor transmission over span 1 and pseudo span 4 to monitor transmission over span 2.
In other words, an application can open /dev/zap/78 to tap transmission over /dev/zap/16, and /dev/zap/109 to tap transmission over /dev/zap/47.
Obviously, the above applies to b channels as well.

See also
- Zaptel
- Asterisk config zaptel.conf
- ztdummy: Dummy zaptel timer, to be used when no zaptel hardware is present
- ztloop with CAS support – improved version of ztloop – useful for MFC-R2 testing
- dahdi_loop – loop for DAHDI (translation from German)