#define americano 0 #define europeo 1 #define lmax 200 // 200 #define posin 18 #define estac 25+posin #define linea 19+posin #define durac 35+posin #define hor 9+posin #define fech 0+posin #define tranf 78+posin #define numero 44+posin // hipad #define ccost 0 #define proye 0+posin #define cuenta 0 #define pulsos 0 #define ruta 0 #define prinum 0 #define ring 25+posin #define antran 0 // anexo transferido /* #define americano 0 #define europeo 1 #define lmax 200 // 200 #define posin 18 #define estac 21+posin #define linea 17+posin #define durac 20+posin #define hor 8+posin #define fech 0+posin #define tranf 75+posin #define numero 38+posin // hipad bolivia #define ccost 0 #define proye 0+posin #define cuenta 0 #define pulsos 0 #define ruta 0 #define prinum 0 #define ring 25+posin #define antran 0 // anexo transferido */ #define fofech americano // ok extern void gua_rut(char *buf); char ruanex[(lmax+1)*2][7] ; /* Rutas Consideradas como Anexos */ extern char rgua[]; void in_central() { rgua[0]='\0'; } void fi_central() { } 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; k =0; j=0; i = strlen(buf) ; if (i>vtranf || buf[vdurac+2]==':' ) { if (isdigit(buf[vestac+1])) for (j=0;j<4;j++) { if (isdigit(buf[vestac+j])) { tel[k++]=buf[vestac+j];} // anexo } tel[k++]=' '; if (isdigit(buf[vlinea]) && isdigit(buf[vlinea+1])) {tel[k++]=buf[vlinea]; tel[k++]=buf[vlinea+1]; } //// linea else if (buf[vlinea]==' ' && isdigit(buf[vlinea+1])) {tel[k++]=buf[vlinea+1];} else tel[k++]='*'; tel[k++]=' '; if( buf[vdurac+2]==':') for (j=0;j<8;j++) { if (isgraph(buf[vdurac+j])) { tel[k++]=buf[vdurac+j]; } //duracion } else {tel[k++]='0';tel[k++]='0';tel[k++]=':';tel[k++]='0';tel[k++]='0';tel[k++]=':';tel[k++]='0';tel[k++]='0';} tel[k++]=' '; for (j=0;j<5;j++) {tel[k++]=buf[vhor+j];} // hora tel[k++]=' '; tel[k++]=buf[vfech+3];tel[k++]=buf[vfech+4];tel[k++]='/';tel[k++]=buf[vfech];tel[k++]=buf[vfech+1]; tel[k++]='/'; tel[k++]=buf[vfech+6];tel[k++]=buf[vfech+7]; // fecha tel[k++]=' '; if (buf[vtranf]=='2') tel[k++]='O'; else if (buf[vtranf]=='6') tel[k++]='O'; else if (buf[vtranf]=='1') tel[k++]='I'; else if (buf[vtranf]=='5') tel[k++]='I'; // tipo de llamada else if (buf[vtranf]=='7') tel[k++]='I'; else if (buf[vtranf]=='8') tel[k++]='O'; tel[k++]=' '; if (isdigit(buf[vnumero])) { for (j=0;j<16 && isdigit(buf[vnumero+j]);j++) { tel[k++]=buf[vnumero+j];}} else tel[k++]='*'; tel[k++]=' '; tel[k++]='*'; tel[k++]='*'; tel[k++]='*'; // centro de costo tel[k++]=' '; if ( !isdigit(buf[vestac])) {for (j=0;j<4;j++) { if (isdigit(buf[vestac+j])) { tel[k++]=buf[vestac+j];} // anexo } } else tel[k++]='*'; // cod pro tel[k++]=' '; tel[k++]='*'; tel[k++]=' '; tel[k++]='0';tel[k++]='0';tel[k++]='0';tel[k++]='0'; tel[k++]=' '; tel[k++]='*'; tel[k++]='*'; tel[k++]='*'; tel[k++]=' '; tel[k++]='*'; tel[k++]=' '; if (isdigit(buf[vring])) {for (j=0;j<5;j++) {tel[k++]= buf[vring+j];}} else { tel[k++]='0';tel[k++]='0';tel[k++]=':';tel[k++]='0';tel[k++]='0';} tel[k++]=' '; tel[k++]='*'; //anexo tranf tel[k++]=' '; tel[k++]='*'; // servicio tel[k++] = '\r' ; tel[k++] = '\n' ; tel[k++] = '\0' ; } }