Wanpipe TDM Voice API Installation
- Wanpipe TDM API Solution
- Wanpipe TDM API Installation
- Wanpipe TDM API Configuration
- Wanpipe TDM API Startup/Operation
- Wanpipe TDM API Sample Code
- Wanpipe TDM API Sample Code Usage
- Wanpipe TDM API Production Code - Sangoma Media Gateway
- Wanpipe TDM API LibSangoma Custom Compilation
Wanpipe TDM Voice API Solution
- Wanpipe Release -> Download Here
-> TDM API Driver
-> LibSangoma User Library -> user space API.
Wanpipe TDM Voice API is currently supported on all AFT hardware.
Wanpipe Package Installation
- Untar LATEST release
- cd wanpipe-<version>/
- ./Setup install
Choose all default parameters up to Compilation Mode
Compilation Mode:
-> Choose Option 8: TDM API
- Proceed with default parameters for the rest of the installation
Setup will install full TDM API drives and LibSangoma Library
- To confirm successful installation run:
-> wanrouter hwprobe
Wanpipe Package Configuration
The wancfg_tdmapi tool will configure all wanpipe configuration files.
- Run: /usr/sbin/wancfg_tdmapi
-> For each card wancfg_tdmapi will configure the span for voice only mode or voice + dchan.
-> Furthermore, TDM API supports multiple DCHANS so on can configure
channels 1-10 as voice and 11-24 as HDLC DCHANS.
- For full description of wanpipe1.conf files please refer to attached samples below.
Wanpipe TDM API Startup & Operation
Once the above wanpipe port configuration is complete using wancfg_tdmapi configuration utility. One has to start all ports.
- wanrouter start
->This command will load and configure wanpipe drivers
-> For full wanrouter usage click here
- Full driver log and events are located in /var/log/messages
-> tail -f /var/log/messages
- At this point TDM driver is configured and ready to tx/rx voice & dchan data. One must make sure that ports are in connected state before trying to tx/rx data using the API programs.
-> wanrouter status #check status of all ports
-> wanpipemon -i w1g1 -c Ta #check T1/E1 alarms of each port
- Once all ports are connected the ifconfig command can be used to confirm that card running.
-> ifconfig
The rx/tx data packets should be incrementing
The MTU value indicates the hardware chunk size
Any rx or tx errors indicate that something is wrong with the data flow.
-> overruns
: indicate dma problems or mis-configured system.
Wanpipe TDMAPI Sample Code
Note: the /etc/wanpipe directory is created after wanpipe package installation.
Sample code for tdm api is installed in /etc/wanpipe/api/tdmapi directory.
- cd /etc/wanpipe/api/tdmapi
- make
- Read the README file on how to use sample applications
Wanpipe TDMAPI priserver Sample Code
The priserver sample code combines simple tdm_api sample file with libpri library.
The priserver is located in /etc/wanpipe/api/libsangoma/examples directory.
- cd /etc/wanpipe/api/libsangoma/examples
- make clean
- make
- make install
Note: if you get a compilation error with priserver you have not compile libsangoma with the libpri support. Pleaser refer to installing libsangoma with libpri below.
TDM API Sample Code
Usage
- aft_tdm_hdlc_test
This application is used to tx/rx HDLC data to and from a voice or dchan. It is useful as a CRC data test to confirm that all voice & dchan channels are working free of bit errors.
->./aft_tdm_hdlc_test wanpipe1 <span-chan device> <span-chan device> ....
->eg: ./aft_tdm_hdlc_test wanpipe1 s1c1
Start hdlc tx/rx on span 1 chan 1
->eg: ./aft_tdm_hdlc_test wanpipe1 s1c1 s1c2
Start hdlc tx/rx on both span 1 chan 1 and span 1 chan 2
With this application one can test the full card by specifying all spans and chans on the command line.
A small script is included in this directory that can simplify the use to this application
-> ./tdm_hdlc_test.sh "span list" "chan list"
-> eg: ./tdm_hdlc_test.sh 1 1 # Start hdlc test on span 1 chan 1
./tdm_hdlc_test.sh "1 2" 1 # Start hdlc test on chan 1 of span 1 & 2
./tdm_hdlc_test.sh 1 # Start hdlc test on all chans for span 1
Wanpipe TDM API in Production - Sangoma Media Gateway SMG
The Sangoma Media Gateway has been built on TDM API. Once can look at the the production code to see how one would use the TDM API to build a full media gateway applicatoins.
The Sangoma Media Gateway is located in every wanpipe release
- cd wanpipe-<version>
- cd ssmg/sangoma_mgd.trunk
- vi sangoma_mgd.c
-> search for all instances of "sangoma_" these are all
libsangoma api functions used in the media gateway.
Wanpipe LibSangoma Installation
Libsangoma is installed automatically during the installation process!
These instructions are here for information sake, in case one wants to recompile libsangoma library.
The LibSangoma is installed in /etc/wanpipe/api/libsangoma
- cd /etc/wanpipe/api/libsangoma
- ./configure
- make
- make install
- Add library path /usr/local/lib into /etc/ld.so.conf
- Run ldconfig to accept /etc/ld.so.conf changes.
Wanpipe LibSangoma with LibPRI Installation (Optional must be done manually)
- Download libpri from www.asterisk.org and save it into /usr/src directory.
- Untar libpri tgz file in /usr/src directory
- Change directory into libpri and run: make; make install
- cd /etc/wanpipe/api/libsangoma
- ./configure --with-libpri=/usr/src/<libpri directory>
- make
- make install
- Add library path /usr/local/lib into /etc/ld.so.conf
- Run ldconfig to accept /etc/ld.so.conf changes.
|