#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define ladat 82+posin #define estac 42+posin // llamadas entrantes #define linea 29+posin #define durac 32+posin #define hor 19+posin #define fech 9+posin #define tranf 4+posin #define numero 45+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 num_tra 600 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 ; k = 0 ;cont=0; if (i>vproye && buf[vfech+2]=='/' && buf[vfech+5]=='/' && buf[vhor+2]==':' && buf[vdurac+2]==':' && buf[vdurac+5]==':' && (buf[vtranf]=='I' || buf[vtranf]=='O')) { for (j=0;j<3;j++) { if (isdigit(buf[vestac+j])) {tel[k++] = buf[vestac+j] ; cont++;} } if(cont==0)tel[k++] = '*';cont=0; tel[k++] = ' ' ; for (j=0;j<3;j++) { if (isdigit(buf[vlinea+j])) {tel[k++] = buf[vlinea+j] ; cont++;} } if(cont==0)tel[k++] = '*';cont=0; tel[k++] = ' ' ; for (j=0;j<8;j++) { if (isdigit(buf[vdurac+j]) || buf[vdurac+j]==':') {tel[k++] = buf[vdurac+j] ; cont++;} } if(cont==0)tel[k++] = '*';cont=0; tel[k++] = ' ' ; for (j=0;j<5;j++) { if (isdigit(buf[vhor+j]) || buf[vhor+j]==':') {tel[k++] = buf[vhor+j] ; cont++;} } if(cont==0)tel[k++] = '*';cont=0; 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++] = ' ' ; tel[k++] = buf[vtranf] ; tel[k++] = ' ' ; if (buf[tranf] == 'O') { for (j=0;j<20;j++) { if (isdigit(buf[vnumero+j])) {tel[k++] = buf[vnumero+j] ; cont++;} } if(cont==0)tel[k++] = '*';cont=0; } else if (buf[vtranf] == 'I') tel[k++] = '*' ; tel[k++] = ' ' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = ' ' ; for (j=0;j<3;j++) { if (isdigit(buf[vproye+j])) {tel[k++] = buf[vproye+j] ; cont++;} } if(cont==0)tel[k++] = '*';cont=0; tel[k++] = ' ' ; tel[k++] = '*' ; tel[k++] = ' ' ; for (it=0 ; it<5 ; it++) tel[k++]='0' ; tel[k++] = ' ' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = '*' ; /* ruta */ tel[k++] = ' ' ; tel[k++] = '*' ; /* primer numero */ tel[k++] = ' ' ; if (buf[vtranf]=='I') { for (j=0;j<5;j++) /* tiempo ring */ { if (isdigit(buf[vring+j]) || buf[vring+j]==':') {tel[k++] = buf[vring+j] ; cont++;} } if(cont==0)tel[k++] = '*';cont=0; } else { tel[k++] = '0' ; tel[k++] = '0' ; tel[k++] = ':' ; tel[k++] = '0' ; tel[k++] = '0' ; } tel[k++] = ' ' ; tel[k++] = '*' ; // anexo transferido tel[k++] = '\r' ; tel[k++] = '\n' ; tel[k++] = '\0' ; } }