#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define ladat 90+posin #define estac 38+posin // llamadas entrantes #define linea 16+posin #define durac 8+posin #define hor 3+posin #define fech 0 #define tranf 0 #define numero 20+posin #define ccost 0 #define proye 0 #define cuenta 0 #define pulsos 0 #define ruta 0 #define prinum 0 #define ring 0 #define antran 0 // anexo transferido (pendiente) #define fofech americano // 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),j,k,cont,seg; char aux, cseg[3]; aux = 0; cont=0; if (i>vestac && isdigit(buf[vdurac+2]) && (buf[vdurac+5]=='A' || buf[vdurac+5]==' ') && isdigit(buf[vlinea+1]) && isdigit(buf[vestac+1])) { k = 0 ; 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<2;j++) { if (isdigit(buf[vlinea+j])) {tel[k++] = buf[vlinea+j] ; cont++;} } if(cont==0)tel[k++] = '*';cont=0; tel[k++] = ' ' ; tel[k++] = '0' ; tel[k++] = buf[vdurac] ; tel[k++] = ':'; tel[k++] = buf[vdurac+1] ; tel[k++] = buf[vdurac+2] ; tel[k++] = ':'; seg=(buf[vdurac+3]-'0')*6 ; itoa(seg,cseg,10) ; if (seg>9) {tel[k++]=cseg[0] ; tel[k++]=cseg[1] ;} else {tel[k++]='0' ; tel[k++]=cseg[0] ;} cseg[2]='\0'; tel[k++] = ' ' ; tel[k++] = buf[vhor] ; tel[k++] = buf[vhor+1] ; tel[k++] = ':'; tel[k++] = buf[vhor+2] ; tel[k++] = buf[vhor+3] ; tel[k++] = ' ' ; 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(isdigit(buf[vestac-3])) tel[k++]='O'; else tel[k++]='I'; tel[k++] = ' ' ; for (j=0;j<17;j++) { if (isdigit(buf[vnumero+j])) { tel[k++]=buf[vnumero+j]; cont++; } } tel[k++] = ' ' ; tel[k++] = '*' ;/*centro costo*/ tel[k++] = ' ' ; tel[k++] = '*' ; /* proyecto */ tel[k++] = ' ' ; tel[k++] = '*' ; // Código de Cuenta tel[k++] = ' ' ; for (j=0 ; j<5 ; j++) tel[k++]='0'; tel[k++] = ' ' ; tel[k++] = '*';tel[k++] = '*';tel[k++] = '*'; tel[k++] = ' ' ; tel[k++] = '*'; /* central */ tel[k++] = ' ' ; tel[k++] = '0';tel[k++] = '0';tel[k++] = ':';tel[k++] = '0';tel[k++] = '0';/*RING*/ tel[k++] = ' ' ; tel[k++] = '*' ; // anexo transferido tel[k++] = '\r' ; tel[k++] = '\n' ; tel[k++] = '\0' ; } }