#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define ladat 82+posin #define estac 4+posin // llamadas entrantes #define linea 12+posin #define durac 35 +posin #define hor 28 +posin #define fech 19 +posin #define tranf 8 +posin #define numero 53+posin #define ccost 0 #define proye 48+posin #define cuenta 42+posin #define pulsos 43 +posin #define ruta 13+posin #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 */ 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,k1,k2; int hotel=vproye+1, nume2=vnumero+7, nume3=vnumero+11, nume4=vnumero+17; if (i>vhor && buf[vfech+2]=='/' && buf[vfech+5]=='/' && buf[vhor+2]==':' && (buf[vtranf]=='<' || buf[vtranf+2]=='>'|| buf[hotel]=='P' || buf[hotel]=='D' || buf[hotel]=='N')) { if (buf[vtranf]=='<' || buf[vtranf+2]=='>') { k = 0; tel[k++] = buf[vestac] ; tel[k++] = buf[vestac+1] ; tel[k++] = buf[vestac+2] ; tel[k++] = ' ' ; tel[k++] = buf[vlinea] ; tel[k++] = buf[vlinea+1] ; tel[k++] = ' ' ; if (buf[vdurac-1]==' ' && buf[vdurac]==' ') { tel[k++]='0' ; tel[k++]='0' ; } if (isdigit(buf[vdurac-1])) { tel[k++]=buf[vdurac-1] ; tel[k++]=buf[vdurac] ; } if (buf[vdurac-1]==' ' && buf[vdurac]!=' ') { tel[k++]='0' ; tel[k++]=buf[vdurac] ; } tel[k++]=':' ; if (buf[vdurac+2]==' ') tel[k++]='0' ; else tel[k++]=buf[vdurac+2] ; tel[k++]= buf[vdurac+3] ; tel[k++]= ':' ; tel[k++]= buf[vdurac+5] ; tel[k++]= buf[vdurac+6] ; tel[k++]= ' ' ; k1 = k ; tel[k++] = buf[vhor] ; tel[k++] = buf[vhor+1] ; if (tel[k1]==' ') tel[k1]='0' ; if (tel[k1+1]==' ') tel[k1+1]='0' ; tel[k++] = ':' ; tel[k++] = buf[vhor+3] ; tel[k++] = buf[vhor+4] ; tel[k++] = ' ' ; if (vfofech == europeo) { k1 = k; tel[k++] = buf[vfech+3] ; tel[k++] = buf[vfech+4] ; tel[k++] = '/'; k2 = k; tel[k++] = buf[vfech] ; tel[k++] = buf[vfech+1] ; } else { k1 = k; tel[k++] = buf[vfech+0] ; tel[k++] = buf[vfech+1] ; tel[k++] = '/'; k2 = k; tel[k++] = buf[vfech+3] ; tel[k++] = buf[vfech+4] ; } tel[k++] = '/'; tel[k++] = buf[vfech+6] ; tel[k++] = buf[vfech+7] ; if (tel[k1] == ' ') tel[k1] = '0' ; if (tel[k2] == ' ') tel[k2] = '0' ; tel[k++] = ' ' ; if ( buf[vtranf+0]=='<' ) tel[k++] = 'I' ; if ( buf[vtranf+2]=='>' ) tel[k++] = 'O' ; tel[k++] = ' ' ; k1 = k; if (buf[vnumero]==' ' && buf[vnumero+1]==' ') buf[vnumero]='3' ; for (it=vnumero; it