[asterisk-dev] Zaptel patch advice needed

marek cervenka cervajs at fpf.slu.cz
Mon Dec 10 10:50:27 CST 2007


>> Hi!
>> I've came to a requirement to have over 256 /dev/zap/x
>> device files (512) to have 16E1's accessible (one of the
>> third party channel drivers - chan_ss7) addresses old-style
>> and needs this device files).
>
> can you please try patch below (from Denis Smirnov for 0.9 adapted to
> 1.0.0)
>
> --- transport.c.old     2007-11-27 10:16:04.000000000 +0100
> +++ transport.c 2007-12-10 16:26:42.000000000 +0100
> @@ -172,11 +172,11 @@
>  int openschannel(struct link* link)
>  {
>    ZT_BUFFERINFO bi;
> -  char devname[100];
> +  char *devname;
>    int fd, res;
>    int zapid = link->schannel + link->first_zapid;
>
> -  sprintf(devname, "/dev/zap/%d", zapid);
> +  devname = "/dev/zap/channel";
>    fd = open(devname, O_RDWR);
>    if(fd < 0) {
>      ast_log(LOG_WARNING, "Unable to open signalling link zaptel device
> %s: %s\n",
> @@ -184,6 +184,11 @@
>      goto fail;
>    }
>
> +  if (ioctl(res, ZT_SPECIFY, &zapid)) {

oops
correct this to
+  if (ioctl(fd, ZT_SPECIFY, &zapid)) {

> +    ast_log(LOG_WARNING, "Unable to specify channel %d: %s\n", zapid,
> strerror(errno));
> +    goto fail;
> +  }
> +
>    bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
>    bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
>    bi.numbufs = NUM_ZAP_BUF;

---------------------------------------
Marek Cervenka
=======================================




More information about the asterisk-dev mailing list