Open-source Rust crates · WBCI · S/PRI
The German provider switch, in Rust
WBCI 2.0 for the § 59 TKG Anbieterwechsel and Rufnummernportierung between providers, S/PRI 4.x for open-access fibre orders with the network owner: typed messages, XML proven against the official schemas, deadlines that explain themselves and the whole process as a value. Sans-I/O, so transport, signing and storage stay yours.
cargo add telco-interopor only one interface: cargo add wbci · cargo add spri
use wbci::pruefung::{self, Bestand};
use wbci::*;
// A pre-agreement (VA-KUE-MRN) arrives from the gaining provider.
let Payload::AnfrageRequest { anfrage: Anfrage::Vorabstimmung(va), .. } = Payload::from_xml(&xml)? else {
return Err("not a pre-agreement".into());
};
// As the losing provider: decide the answer from your record.
let mut bestand = Bestand::new(va.endkunde.clone(), "D123".parse()?);
bestand.rufnummern = vec![OnkzRufnummer { onkz: "30".parse()?, rufnummer: "1234567".parse()? }];
bestand.standort = va.standort().cloned();
let pruefung = pruefung::check(&va, &bestand, received, &Calendar::wbci());
assert!(pruefung.is_agreed()); // RUEM-VA, every field explained
// Follow the switch: what is due, by whom, and why.
let mut process = Process::new(Role::EkpAbg, va.clone(), Direction::Received, received)?;
process.apply(Direction::Sent, received, Teq::for_anfrage(&va.into(), Meldungscode::Ok))?;
println!("{}", process.deadlines()[0]); // EKPabg: by Do 26.11.2026 23:59 …Why you can rely on it
- 373 + 776WBCI and S/PRI payloads validated against the official XSDs on every CI run
- Fuzzedhostile XML refused with its receipt code, never a panic
- Sans-I/Ono network, no clock, no global state
- Redactedpersonal data never in
Debug, errors or logs - MSRV 1.88three external dependencies, no
unsafe - MIT / Apache-2.0dual-licensed, open source
One switch, two interfaces
The gaining provider agrees the switch with the losing provider over WBCI, then orders the line from the network owner over S/PRI with the same Vorabstimmungs-ID. telco_interop::Wechsel shows it as one timeline and checks that both sides agree.
- VA-KUE-MRNEKPauf → EKPabgpre-agreement
- RUEM-VAEKPabg → EKPaufagreed, binding date
- AKM-TREKPauf → EKPabgtakes over the line
- PVEKPauf → networkprovider-switch order
- QEBnetwork → EKPauforder admissible
- AKM-PVnetwork → EKPabgswitch announced
- RUEM-PVEKPabg → networklosing side answers
- ABM · ABM-PVnetwork → bothdate confirmed
- ERLM · ERLM-PVnetwork → bothswitched
- ENTM · ENTM-PVnetwork → bothbilling date
WBCI provider ↔ provider S/PRI provider ↔ network owner · One switch across WBCI and S/PRI
What the crates give you
Typed, all the way down
A
VorabstimmungsIdexists only if it is valid. Requests mirror the schema'sxsi:type, mandatory elements are plain fields, so an incomplete request does not compile.Know before you send
28 cited WBCI rules and 34 S/PRI rules predict the peer's refusal: wrong code for the case, a lead time too short, a Terminverschiebung where the business case has none. Each issue names the element, the clause and the code the peer would answer with.
Deadlines that explain themselves
„3 AT after the TEQ“, „before 0:00 of X−3 AT“, „10 Werktage after the TAM“: computed in German time, with every counted and skipped day and why.
The whole process as a value
A sans-I/O state machine per WBCI pre-agreement and per S/PRI order refuses what the protocol forbids, with the code to answer, and tells each side what it may do next.
The losing provider's answer, decided
Hand over your contract record and get the RUEM-VA or ABBM the check table of Anlage 1 §2.4 prescribes: names compared by sound with the AK S&P's word rules, explained field by field.
One switch, both interfaces
Wechselmerges the WBCI pre-agreement and its S/PRI orders into one timeline with both interfaces' deadlines, and checks six rules that the two agree.Test without a partner
Simulated peers — the losing provider, the network owner, the losing provider in a PV — driven by the process state machines, and 13 named scenarios that play whole switches and orders from both sides, every message valid and on time:
telco-interop simulate wechsel switch/.Safe with hostile input
No DTDs, no entity expansion; size, depth, text and every repetition bounded; fuzzed; never a panic. Personal data never appears in
Debug, errors or issues.A command line for the files
brew install hupe1980/tap/telco-interop: read and check message files, explain a code, replay a switch from one party's view with findings and deadlines, write a sandbox scenario's files. No personal data in its output.read,checkandcodealso run in the browser playground, with nothing uploaded.No transport, no lock-in
The crates read and write the payloads, bare or in a SOAP 1.1 envelope. HTTPS, WS-Security, storage and your clock stay in your application.
The crates
| Crate | Interface | Between | Status |
|---|---|---|---|
wbci | WBCI 2.0 | provider ↔ provider: the § 59 TKG switch, number porting, the losing provider's check | complete |
spri | S/PRI 4.x | service provider ↔ network owner: open-access orders, faults, diagnostics, the provider switch | complete |
telco-interop | both | one dependency for both, plus Wechsel: one switch across WBCI and S/PRI, the sandbox scenarios, the command line and its output as a library | complete |
wita-kit | WITA | service provider ↔ Deutsche Telekom: wholesale orders on Telekom lines | name reserved |
All share one foundation (carrier-core: identifiers, working-day calendar, hardened XML), which you never depend on directly.
Questions
Is this official or certified?
No. telco-interop is an independent open-source project, not affiliated with or endorsed by the AK S&P, VATM, BUGLAS or Deutsche Telekom. Every payload kind the writers produce is validated against the official XML schemas on every CI run (373 WBCI and 776 S/PRI payloads), but certification of your system with your peers remains your step.
Which specification versions are implemented?
WBCI 2.0 with the XSD V2.00, Anlage 1 „Spezifikation Vorabstimmung“ V5.4.1 and the Arbeitshandbuch WBCI 2.10; S/PRI 4.x with the schema 4.00.03, the Providervereinbarung S/PRI V4.4, Anlage 7 (EPKs) V.13 and the Arbeitshandbuch S/PRI 4.x V2.9.5. The scope page lists every document and each interpretation.
Does it do SOAP, WS-Security or HTTPS?
It reads and writes the payloads bare or inside a SOAP 1.1 envelope, and leaves the SOAP header empty for your WS-Security signer. The crates are sans-I/O: transport, TLS, signing and verification, persistence and the clock belong to your application, so they fit any HTTP stack, queue or test harness.
How are the deadlines counted?
In German time (Europe/Berlin, compiled in). WBCI working days (AT) are Monday to Friday without the nine nationwide public holidays; S/PRI Werktage are Monday to Saturday. Forwards deadlines end at 23:59 of the n-th working day, backwards ones before 0:00. Every deadline names its rule and source and lists the days it counted and skipped; other calendars, regional holidays and closing days are configurable.
Can I use only WBCI, or only S/PRI?
Yes. Depend on the wbci or the spri crate directly, or on telco-interop with one feature turned off. The identifiers both interfaces share (Vorabstimmungs-ID, LineID, carrier code) are the same types in both crates, so adding the other one later needs no conversion.
Can I try it without installing anything?
Yes. The playground reads and checks a WBCI or S/PRI payload, explains a Meldungscode and shows the sandbox scenarios in your browser, with the same output as the command line. The crates run there as WebAssembly: nothing is uploaded, and there are no cookies or analytics.
How do I test without a partner?
With the sandbox. wbci::sim and spri::sim are simulated peers — the losing provider, the network owner and the losing provider in a PV — that answer what your system sends as the protocol prescribes, inside the deadlines and without a network. telco_interop::sim plays 13 named scenarios from both sides; telco-interop simulate writes them as files. It replaces no certification with your peers.
What about personal data?
Names, addresses, phone numbers, e-mail addresses, free text and attachment content print redacted in Debug output, and errors, validation issues, timelines and findings never contain them. The losing provider's check explains its decision without personal data, so the explanation can be logged and shared.
Is WITA supported?
No. The wita-kit crate is a name reservation for Deutsche Telekom's wholesale ordering interface; nothing is implemented.
What is the licence?
MIT or Apache-2.0, at your option. The AK S&P's specifications are copyrighted documents and are not part of the repository or the packages: the crates carry their own types and synthetic test data, and the schemas are fetched by URL and pinned by SHA-256 for the conformance test.
Start with one pre-agreement
Build a Vorabstimmung, check it, write the XML and follow its deadlines.