#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define ladat 82+posin #define estac 39+posin // llamadas entrantes #define linea 25+posin #define durac 29+posin #define hor 15+posin #define fech 5+posin #define tranf 0+posin #define numero 44+posin #define ccost 0 #define proye 70+posin #define cuenta 0 #define pulsos 0 #define ruta 0 #define prinum 0 #define ring 63+posin #define antran 0 // anexo transferido (pendiente) #define fofech europeo // formato de fecha #define lar_lin 2 #define lar_est 3 #define lar_pry 4 #define lar_num 17 #define lar_hor 8 //#define phor 15 #define num_tra 600 #define num_train 600 extern void gua_rut(char *buf); char ruanex[(lmax+1)*2][7] ; /* Rutas Consideradas como Anexos */ struct Llamad { char lin[2],num[17],pry[4],est[3] ; } lla_tra[num_tra+1] ; int max_tra ; /* abrir archivo de llamadas posibles de ser transferidas */ void abr_tra() { /* FCHAN t_arch ; char bufp[sizeof(struct Llamad)+10] ; int i,j=0,lim=sizeof(struct Llamad) ; max_tra=-1 ; if( (t_arch = _FOpen("ptelf.tra",FO_READONLY)) != -1 ) { while ( !_FEOF(t_arch) && j<=num_tra ) { i=_FGets(t_arch,bufp,lim+4); if (i==lim) { max_tra=j ; for(i=0 ;i<8 ;i++) lla_tra[j].Hor[i- 0] = bufp[i] ; for(i=8 ;i<11;i++) lla_tra[j].lin[i- 8] = bufp[i] ; for(i=11;i<28;i++) lla_tra[j].num[i-11] = bufp[i] ; for(i=28;i<32;i++) lla_tra[j].pry[i-28] = bufp[i] ; j++ ; } } _FClose(t_arch); } */ } /* cerrar archivo de llamadas posibles de transferir */ void cer_tra() { /* int j=0,lim=sizeof(struct Llamad) ; FCHAN t_arch; t_arch = _FCreate("ptelf.tra",FC_NORMAL); while (j<=max_tra) { _FWrite(t_arch,(char *)&lla_tra[j],lim); _FWrite(t_arch,"\r\n",2); j++ ; } _FClose(t_arch) ; */ } /* procedimiento que modifica informaciňn asociada a una linea*/ void mod_info(int est,int lin,int num,int pry,char *buf) { int it,i,j=max_tra,i_lin=0 ; while (i_lin!=lar_lin && j>=0 ) { for(i=0;i=0 ) { for(i=0;i0) flag = bus_li(lin,buf); if (flag == 0) { if (max_tra>=num_tra) { j=0 ; while (j=0 ) { for(i=0;i(vestac+2) && buf[vfech+2]=='/' && buf[vfech+5]=='/' && buf[vhor+2]==':' && (buf[vtranf]=='I' || buf[vtranf]=='O')) { k = 0 ; if (!isdigit(buf[vestac+1])) tel[k++] = '*'; else { for (it=0;it<3 && buf[vestac+it]!=' ';it++) tel[k++] = buf[vestac+it]; } tel[k++] = ' ' ; tel[k++] = buf[vlinea] ; tel[k++] = buf[vlinea+1] ; tel[k++] = ' ' ; if (buf[vdurac+0]!=' ') tel[k++]=buf[vdurac+0] ; else tel[k++]='0' ; if (buf[vdurac+1]!=' ') tel[k++]=buf[vdurac+1] ; else tel[k++]='0' ; tel[k++] = ':' ; if (buf[vdurac+3]!=' ') tel[k++]=buf[vdurac+3] ; else tel[k++]='0' ; if (buf[vdurac+4]!=' ') tel[k++]=buf[vdurac+4] ; else tel[k++]='0' ; tel[k++] = ':' ; if (buf[vdurac+6]!=' ') tel[k++]=buf[vdurac+6] ; else tel[k++]='0' ; if (buf[vdurac+7]!=' ') tel[k++]=buf[vdurac+7] ; else tel[k++]='0' ; tel[k++] = ' ' ; ka = k ; tel[k++] = buf[vhor] ; tel[k++] = buf[vhor+1] ; if (tel[ka]==' ') tel[ka]='0' ; tel[k++] = ':' ; tel[k++] = buf[vhor+3] ; tel[k++] = buf[vhor+4] ; tel[k++] = ' ' ; if (vfofech==europeo) { tel[k++] = buf[vfech+3] ; tel[k++] = buf[vfech+4] ; tel[k++] = '/'; tel[k++] = buf[vfech] ; tel[k++] = buf[vfech+1] ; } else { tel[k++] = buf[vfech] ; tel[k++] = buf[vfech+1] ; tel[k++] = '/'; tel[k++] = buf[vfech+3] ; tel[k++] = buf[vfech+4] ; } tel[k++] = '/'; tel[k++] = buf[vfech+6] ; tel[k++] = buf[vfech+7] ; tel[k++] = ' ' ; if (buf[vtranf]=='I') vtip = 'I'; else vtip = 'O'; tel[k++] = vtip ; tel[k++] = ' ' ; in = 0; for (it=0;it<4 && (it+vproye)