#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define ladat 82+posin #define orden 0 #define estac 6 +posin // llamadas entrantes #define linea 0 #define durac 39 +posin #define hor 23 +posin #define fech 17 +posin #define tranf 0 #define numero 24 +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 europeo // formato de fecha extern void gua_rut(char *buf); char ruanex[(lmax+1)*2][7] ; /* Rutas Consideradas como Anexos */ char *cuf; extern char rgua[]; // Procesos Iniciales (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,k,j,cont; i=strlen(buf); cont=0; if (i>buf[vnumero+20] && buf[posin+1]=='E' && buf[posin+17]=='D') { strcpy(cuf,buf); for(i=0;ibuf[vdurac+11] && buf[posin+10]=='S' && buf[vfech+2]=='/' && buf[vdurac+2]==':') { k = 0 ; for (j=0;j<3;j++) { if isdigit(cuf[vestac+j]) {tel[k++] = cuf[vestac+j] ; cont++;} } if(cont==0)tel[k++] = '*';cont=0; tel[k++] = ' '; tel[k++] = buf[vdurac] ; tel[k++] = buf[vdurac+1] ; tel[k++] = ':' ; tel[k++] = buf[vdurac+3] ; tel[k++] = buf[vdurac+4] ; tel[k++] = ':' ; tel[k++] = buf[vdurac+6] ; tel[k++] = buf[vdurac+7] ; tel[k++] = ' ' ; for (j=0;j<5;j++) { if (isdigit(cuf[vhor+j]) || cuf[vhor+j]==':') {tel[k++] = cuf[vhor+j] ; cont++;} } 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+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++] = ' ' ; tel[k++] = 'O' ; tel[k++] = ' ' ; for (j=0;j<15;j++) { if isdigit(cuf[vnumero+j]) {tel[k++] = cuf[vnumero+j] ; cont++;} } cuf[i]=' ';cuf[i]='\0'; if(cont==0)tel[k++] = '*';cont=0; tel[k++] = ' ' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = '*' ; /* centro de costo */ tel[k++] = ' ' ; tel[k++] = '*' ; //codigo de proyecto tel[k++] = ' ' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = '*' ; //codigo de cuenta tel[k++] = ' ' ; tel[k++] = ' ' ; for (i=0;i<5;i++) // tarifa o pulsos tel[k++] = '0'; tel[k++] = ' ' ; tel[k++] = '*' ; /* ruta */ tel[k++] = ' ' ; tel[k++] = '*' ; /* primer numero */ tel[k++] = ' ' ; tel[k++] = '0' ;tel[k++] = '0';tel[k++] = ':'; tel[k++] = '0' ;tel[k++] = '0' ; /* tiempo ring */ tel[k++] = ' ' ; tel[k++] = '*' ; // anexo transferido tel[k++] = '\r' ; tel[k++] = '\n' ; tel[k++] = '\0' ; } }