So I’ve been messing with AMR modems for a while. This topic isn’t really about them but rather about the “infrastructure” I’m trying to get running so I can actually test and use them. I mention them here just so that you can keep them in mind as another potential variable/source of issues …
What I was trying here is to get basically a few FXS ports that are uplinked to the OCTOI community network. Here’s the setup :
Hardware wise :
- Raspberry Pi 5 with a PCIe breakout and connected to that a PCIe->PCI bridge
- A Digium TDM410 PCI card with 4 FXS modules
- An icE1usb connected to the RPi5 via USB
- It’s properly connected to a GPS signal
- The first port is connected to a loopback plug, the second port is not used
- Two AMR modems connected to a test computer
- Interface to the computer is through
osmo-amrmodule I’m working on - Software wise, I run a modified
slmodemdthat’s been adapted to interface with my hardware
- Interface to the computer is through
The connection to the OCTOI network is not typical. Instead, the E1OIP link doesn’t go to the icE1usb but instead to an internal trunkdev virtual device. However to get any kind of stability, you need a good clock source and this is what the icE1usb is for and also why it has a loopback plug because you need the link to be up to be a valid clock source.
On the software side, I’m running DAHDI (obviously) driver stack, osmo-e1d for the OCTOI uplink and GPSDO status and yate for the call routing.
Let’s review the configuration.
modprobe wctdm24xxp companding=alaw
modprobe icE1usb
modprobe dahdi-trunkdev
Modules are loaded as above and in this order so the span order is the same everytime. By default for analog cards the wctdm24xxp driver (for the TDM410 card) uses ulaw but because on E1 we use alaw I force it to use alaw as well to avoid the conversion and the potential signal degradation that goes with it.
Next step is to create the trunkdev. I also change access rights so I can run a bunch of that stuff as a normal user. And then finally load the DADHI configuration.
dahdi-tools/trunkdev/dahdi_trunkdev create octoi
chgrp users /dev/dahdi/* -R
chmod g+rw /dev/dahdi/* -R
dahdi-tools/dahdi_cfg -c dahdi-tools/system.conf
And speaking of that system.conf, here’s what I’m using :
# Span 1: TDM410P
fxoks=1-4
alaw=1-4
# Span 2: icE1usb port 0
span=2,1,0,ccs,hdb3,crc4
bchan=5-35
# Span 3: icE1usb port 1
# unused
# Span 4: trunkdev
span=4,0,0,ccs,hdb3,crc4
bchan=67-81,83-97
dchan=82
# Global data
loadzone = be
defaultzone = be
Mostly standard stuff, just making sure to set the FXS as alaw here as well and then configuring the icE1usb as the clock master. And configuring the trunkdev with the proper dchan for the uplink to OCTOI.
Next step is then to start osmo-e1d which will handle the OCTOI uplink to our virtual span trunkdev.
osmo-e1d -c osmo-e1d.cfg
And associated osmo-e1d.cfg :
octoi-client YOUR_OCTOI_ENDPOINT_IP 10013
local-bind 0.0.0.0 3333
account YOUR_OCTOI_USERNAME
mode dahdi-trunkdev
dahdi-trunkdev name octoi
dahdi-trunkdev line-number 0
prefill-frame-count 200
e1d
interface 0 dahdi-trunkdev
trunkdev-name octoi
line 0
mode e1oip
interface 1 icE1usb
usb-serial YOUR_ICE1USB_SERIAL_HERE
And then finally start yate :
yate
Its configuration is in multiple files. I’ll try to remember all I had to add :
In zapcard.conf:
[card-fxs]
type=FXS
span=WCTDM/0
voicechans=1-4
format=alaw
[octoi]
type=E1
span=trunkdev/octoi/0
dtmfdetect=disable
In ysigchan.conf:
[octoi]
type=isdn-pri-cpe
sig=octoi
voice=octoi
switchtype=euro-isdn-e1
channelsync=0
In analog.conf:
[chan-fxs]
type=FXS
spans=card-fxs
And then finally the dialplan in regexroute.conf :
[contexts]
; Analog (FXS) incoming
${address}^chan-fxs/\(.*\)$=from_analog_ctx;called=off-hook
; OCTOI incoming
${address}^octoi/\(.*\)$=from_octoi_ctx
[from_analog_ctx]
; Direct FXS lines
^100\(.\)$=analog/chan-fxs/\1
; To OCTOI
^0\(........\)$=sig/\1;trunk=octoi
; as long as we are in overlap (variable set by php script), bail out
${overlapped}yes=goto overlapped
; Off-Hook from FXS
^off-hook$=external/nodata/overlapped.php;accept_call=true;tonedetect_in=yes
[from_octoi_ctx]
^2460100\(.\)$=analog/chan-fxs/\1
[default]
[overlapped]
; avoid enum routing as long as the dialled number is incomplete
.*=;error=incomplete;enumroute=false
Ok, that’s it for the setup description. I will write about the results in a following post …