[Asterisk-Users] libpri and zap lib

Wu Jiang wujiang at rogers.com
Thu May 22 11:04:53 MST 2003


Hello all,

I have some questions about the libpri and zap lib. I've sent mail to Mark for help. Also I wonder whether anyone else would be interested and helpful in them.

I'm going to migrate a program to Wildcard E400P card. Our original program is based on C API similar to the functions provided in libpri.h and zap.h, so I want to use the E400P card in the following way:
1. install and make zapata, zaptel, libpri
2. load the modules:
    modprobe zaptel
    modprobe tor2
3. edit the /etc/zaptel.conf, the run zaptel/ztcfg to configure the modules
4. run my program

My program will do the followings:
1. open D-channel /dev/zap/16 , /dev/zap/48 and run pri routine on it:
    dfd1 = open("/dev/zap/16", O_RDWR);
    dfd2 = open("/dev/zap/48", O_RDWR);
    pri1 = pri_new(dfd1, node, swtype);
    pri2 = pri_new(dfd2, node, swtype);
    /* check and handle the ISDN events on pri1, pri2 as shown in pritest.c*/
2.detect DTMF, play audio file, bridge channels, disconnect channels with zap functions:
    zap_getdtmf();        /* check DTMF*/
    zap_playf();          /* play audio file*/
    zap_conf();           /* bridge 2 channels*/
    zap_clearlinks();     /* disconnect bridged channels*/

Is the above a feasible way? 

In the Asterisk code,  the /dev/zap/channel is used for all ISDN D-channels. I haven't understood it clearly. Could you please explain its usage?

Thanks a lot,

James



More information about the asterisk-users mailing list