#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define ladat 90+posin #define estac 3 +posin // llamadas entrantes #define linea 0 #define durac 37+posin #define hor 62+posin #define fech 56+posin #define tranf 0 #define numero 43+posin #define ccost 10+posin #define proye 71+posin #define cuenta 0 #define pulsos 27+posin #define ruta 68+posin #define prinum 0 +posin #define ring 0 #define antran 73+posin // anexo transferido (pendiente) #define fofech europeo // formato de fecha extern void gua_rut(char *buf); char ruanex[(lmax+1)*2][7] ; /* Rutas Consideradas como Anexos */ extern char rgua[]; // Procesos Inicialiales (Inicializar Variables, Abrir // Archivos especiales, etc) void in_central() { rgua[0] = '\0'; } // Procesos de Finalización (Cerrar Archivos especiales, etc) void fi_central() { } // Driver Propiamente tal. Las posiciones de los campos se // ingresan como parámetros, lo que permite modificar desde // Aplicación de Tarificación la posición de estos en el // Registro de Llamados. void DatCentral(char *buf, char *tel, int vestac, int vlinea,int vdurac,int vhor, int vfech, int vtranf, int vnumero, int vccost,int vproye, int vcuenta, int vpulsos, int vruta, int vprinum, int vring, int vantran, int vfofech) { int i=strlen(buf),it,k,cont,j; char aux; aux = 0;it=0;k=0;cont=0; if (i>vantran && isdigit(buf[posin+1]) && isdigit(buf[vnumero+1]) && isdigit(buf[vhor+1])) { if(isdigit(buf[vdurac-2])) { vdurac++; vhor++; vfech++; vnumero++; vruta++; vantran++; } for (j=0;j<7;j++) //estacion { if (isdigit(buf[vestac+j])) {tel[k++] = buf[vestac+j] ; cont++;} } if(cont==0)tel[k++] = '*';cont=0; tel[k++] = ' ' ; if (buf[vantran]=='#' || buf[vantran]=='-') { tel[k++]=buf[vantran]; tel[k++]=buf[vantran+1]; } else tel[k++] = '*' ; tel[k++] = ' ' ; tel[k++] = '0' ; //duracion tel[k++] = '0' ; tel[k++] = ':' ; if (buf[vdurac]!=' ') tel[k++] = buf[vdurac]; else tel[k++] = '0'; tel[k++] = buf[vdurac+1] ; tel[k++] = ':' ; tel[k++] = buf[vdurac+3] ; tel[k++] = buf[vdurac+4] ; tel[k++] = ' ' ; tel[k++] = buf[vhor] ; tel[k++] = buf[vhor+1] ; tel[k++] = ':' ; tel[k++] = buf[vhor+3] ; tel[k++] = buf[vhor+4] ; tel[k++] = ' ' ; if(buf[vdurac+1]==' ') vdurac++; if (vfofech==europeo) { tel[k++] = buf[vfech+3] ; tel[k++] = buf[vfech+4] ; tel[k++] = '/'; tel[k++] = buf[vfech+0] ; tel[k++] = buf[vfech+1] ; } else { tel[k++] = buf[vfech+0] ; tel[k++] = buf[vfech+1] ; tel[k++] = '/'; tel[k++] = buf[vfech+3] ; tel[k++] = buf[vfech+4] ; } tel[k++] = '/'; tel[k++] = buf[6] ; tel[k++] = buf[7] ; tel[k++] = ' ' ; if (buf[vccost]=='-' && buf[vccost+1]=='I' && buf[vccost+2]=='D' && buf[vccost+3]=='E') tel[k++] = 'I'; else tel[k++] = 'O' ; tel[k++] = ' ' ; for (j=0;j<12;j++) { if (isdigit(buf[vnumero+j])) {tel[k++] = buf[vnumero+j] ; cont++;} } if(cont==0)tel[k++] = '*';cont=0; tel[k++] = ' ' ; for (j=0;j<6;j++) { if (isalnum(buf[vccost+j])) { tel[k++] = buf[vccost+j] ; cont++; } } if(cont==0) { tel[k++] = '*';tel[k++] = '*';tel[k++] = '*'; cont=0; } tel[k++] = ' ' ; if (buf[vproye]=='A' && i>vantran) { for (it=vantran;it