[Asterisk-Users] libpri and zap lib

Charles E. Youse beef at nexuslabs.com
Thu May 22 11:59:26 MST 2003


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 Mar=
k for help. Also I wonder whether anyone else would be interested and helpf=
ul in them.
>
> I'm going to migrate a program to Wildcard E400P card. Our original progr=
am 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 modul=
es
> 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-channe=
ls. 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
>
>




More information about the asterisk-users mailing list