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
I can't speak to much of what you're talking about here, but /dev/zap/channel is a pseudo-device of sorts- you can open this device and then use an ioctl() to select which channel you actually want to communicate with. e.g., fd =3D open("/dev/zap/1"); is equivalent to fd =3D open("/dev/zap/channel"); ioctl(fd, select-channel-1); Hope this helps, C. On Thu, 22 May 2003, Wu Jiang wrote:> 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 =3D open("/dev/zap/16", O_RDWR); > dfd2 =3D open("/dev/zap/48", O_RDWR); > pri1 =3D pri_new(dfd1, node, swtype); > pri2 =3D pri_new(dfd2, node, swtype); > /* check and handle the ISDN events on pri1, pri2 as shown in pritest=2Ec*/ > 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 > > =FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=FF=C0=B2=D7=AB=8A=C9=FFR=C7=AB=B2f=A2=96)=E0=96+-=02=CB^=AE+$=FDK=1E=AE=CF=E5=8A=CBl=FD=D8=A0=8A=E9=FFr=89=A1=B6=DA=FF=FF=F9b=B2=DB=FFv("=BAo=DC=A2o=E6j)fj=7F=E5=8A=CBb=9D=FA?j=CB^=AE+$=FE=EB=1E > >
Have you considered using the Asterisk API? It will almost certainly be much easier to develop your application rapidly using it. Mark On Thu, 22 May 2003, Wu Jiang wrote:> 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 > > ??????????????????????????????????????????R???f??)??+-?^?+$?K?????l??????r???????b???v("?o??o?j)fj???b???j?^?+$??>