#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define ladat 150+posin #define estac 0 +posin // llamadas entrantes #define linea 12+posin #define durac 51+posin #define hor 45+posin #define fech 0 #define tranf 0 #define numero 23+posin #define ccost 0 #define proye 40+posin #define cuenta 68+posin #define pulsos 60+posin #define ruta 9+posin #define prinum 0 #define ring 0 #define antran 0 // anexo transferido (pendiente) #define fofech europeo // formato de fecha #define larnum 15 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 l=strlen(buf),i,it,k,ka; if (l>vdurac && buf[vhor+2]==':' && buf[vdurac+5]==':' && ((buf[vnumero+1]!=' ' && buf[vlinea-1]=='/') || buf[vestac+2]=='/')) { /*Se ordenan los campos en los buffer de entrada y salida*/ k=0 ; it=l ; if (buf[vlinea-1]=='/') for(i=0;i<=4;i++) tel[k++]=buf[vestac+i]; else for(i=0;i<=4 ;i++) tel[k++]=buf[vruta+i]; tel[k++] = ' '; if (buf[vlinea-1]=='/') for(i=0;i<=2;i++) tel[k++]=buf[vlinea+i]; else for(i=0;i<=2;i++) tel[k++]=buf[vestac+i-2]; tel[k++] = ' ' ; if (buf[vdurac+0]!=' ') tel[k++]=buf[vdurac+0] ; else tel[k++]='0' ; if (buf[vdurac+1]!=' ') tel[k++]=buf[vdurac+1] ; else tel[k++]='0' ; tel[k++]=':' ; if (buf[vdurac+3]!=' ') tel[k++]=buf[vdurac+3] ; else tel[k++]='0' ; if (buf[vdurac+4]!=' ') tel[k++]=buf[vdurac+4] ; else tel[k++]='0' ; tel[k++]=':' ; tel[k++]=buf[vdurac+6] ; tel[k++]=buf[vdurac+7] ; tel[k++]= ' ' ; for(i=0;i<=4;i++) tel[k++]=buf[vhor+i]; tel[k++] = ' ' ; for (i=0;i<8;i++) tel[k++] = buf[vfech+i] ; tel[k++] = ' ' ; if (buf[vlinea-1]=='/') tel[k++] = 'O' ; /*buf[incomin]*/ else tel[k++] = 'I' ; tel[k++] = ' ' ; if (buf[vlinea-1]=='/') for(i=vnumero;i<=(vnumero+larnum);i++) tel[k++]=buf[i]; else tel[k++] = '*' ; tel[k++] = ' ' ; /*No existe centro de costo para archivo solo se llena con asteriscos*/ tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = ' ' ; /*Se asigna llamada a un proyecto*/ if (buf[vproye]!=' ' || buf[vproye+1]!=' ' || buf[vproye+2]!=' ' || buf[vproye+3]!=' ') { tel[k++] = buf[vproye] ; tel[k++] = buf[vproye+1] ; tel[k++] = buf[vproye+2] ; tel[k++] = buf[vproye+3] ; } else { tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = '*' ; } tel[k++] = ' ' ; ka=k; for (i=0;i<13 && (i+vcuenta)(vpulsos+7)) { if (buf[vpulsos+5]!=' ' || buf[vpulsos+6]!=' ') for(i=0;i<7;i++) tel[k++] = buf[vpulsos+i]; else tel[k++] = '0'; } else tel[k++] = '0' ; tel[k++] = ' ' ; if (buf[vlinea-1]=='/') { tel[k++] = buf[vruta] ; tel[k++] = buf[vruta+1] ; /* ruta */ } else { tel[k++] = buf[vestac] ; tel[k++] = buf[vestac+1] ; /* 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 tranferido */ tel[k++] = '\r' ; tel[k++] = '\n' ; tel[k++] = '\0' ; } }