#define americano 0 #define europeo 1 #define lmax 500 #define posin 18 #define estac 90 + posin #define linea 74 + posin #define durac 0 #define hor 18 + posin // driver biobio #define fech 0 #define tranf 0 #define numero 0 #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 #define fofech americano char XH[3],XM[3],XS[3],Yhor[3],Ymin[3],Yseg[3],Esegundos[2],Eminutos[2],Ehoras[2],numaxo[16],id[9]; int k,j,z,concoma,cont,cont1,cont2,connect_time,i,disconnec_time,vtipo,premier,deuxieme; int Bseg,Bmin,Bhor,Rseg,Rmin,Rhor,RTIEMPO,BTIEMPO,EDURA,Tsegundos,Tminutos,Thoras; 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) { i=strlen(buf); k=0; concoma=0; cont=0; z=0 ; vtipo=0; cont1 =0 ; cont2=0; if ( (i>vhor+8) && buf[vhor+2]==':' ) { for(j=0;j=6 ) { cont=0; for (j=0;(isdigit(buf[vnumero+13+j])) && j<24 ;j++) cont++; /// cuenta largo numero if (cont<5) /// ingresa anexo { for (j=0;(isdigit(buf[vnumero+13+j])) && j<24 ;j++) {tel[k++]=(buf[vnumero+13+j]);} if (buf[vtranf]=='2') vtipo=1; else vtipo=0; } else { for (j=0;(isdigit(numaxo[j])) && j<24 ;j++) tel[k++]=numaxo[j]; if (buf[vtranf]=='1') vtipo=1; else vtipo=0; } tel[k++]=' '; if ( isdigit(buf[vlinea]) ) tel[k++]=buf[vlinea]; // linea else tel[k++]='*'; tel[k++]=' '; /// duracion XS[0]=buf[connect_time+6]; XS[1]=buf[connect_time+7]; XS[2]='\n'; Bseg = atoi(XS); XM[0]=buf[connect_time+3]; XM[1]=buf[connect_time+4]; XM[2]='\n'; Bmin = atoi(XM); XH[0]=buf[connect_time]; XH[1]=buf[connect_time+1]; XH[2]='\n'; Bhor = atoi(XH); BTIEMPO = Bhor * 3600 + Bmin * 60 + Bseg; Yseg[0]= buf[disconnec_time+6]; Yseg[1]= buf[disconnec_time+7]; Yseg[2]='\n'; Rseg = atoi(Yseg); Ymin[0]= buf[disconnec_time+3]; Ymin[1]= buf[disconnec_time+4]; Ymin[2]='\n'; Rmin = atoi(Ymin); Yhor[0]= buf[disconnec_time]; Yhor[1]= buf[disconnec_time+1]; Yhor[2]='\r'; Rhor = atoi(Yhor); RTIEMPO = Rhor * 3600 + Rmin * 60 + Rseg; EDURA = RTIEMPO - BTIEMPO; if (EDURA > 0 ) { Tsegundos = EDURA % 60; if (EDURA < 3600 ) Tminutos = EDURA / 60; else Tminutos = EDURA % 3600; Thoras = EDURA / 3600; _itoa(Tsegundos,Esegundos,10); _itoa(Tminutos,Eminutos,10); _itoa(Thoras,Ehoras,10); //tel[k++]= '0'; //tel[k++]= '0'; if ( Thoras > 9 ) { tel[k++]= Ehoras[0]; tel[k++]= Ehoras[1]; } else { tel[k++]='0' ; tel[k++]= Ehoras[0]; } tel[k++]= ':'; if ( Tminutos > 9 ) { tel[k++]= Eminutos[0]; tel[k++]= Eminutos[1]; } else { tel[k++]='0' ; tel[k++]= Eminutos[0]; } tel[k++]= ':'; if ( Tsegundos> 9 ) { tel[k++]= Esegundos[0]; tel[k++]= Esegundos[1]; } else { tel[k++]= '0'; tel[k++]= Esegundos[0];} } else { tel[k++]='0'; tel[k++]='0'; tel[k++]=':'; tel[k++]='0'; tel[k++]='0'; tel[k++]=':'; tel[k++]='0'; tel[k++]='0'; } // fin duracion tel[k++]=' '; for(j=0;j<5;j++) { tel[k++]=buf[vhor+j]; } // hora tel[k++]=' '; if (buf[vfech+0]=='J' && buf[vfech+1]=='a' && buf[vfech+2]=='n' ) // mes { tel[k++]='1';tel[k++]='1';} else if (buf[vfech+0]=='F' && buf[vfech+1]=='e' && buf[vfech+2]=='b' ) { tel[k++]='0';tel[k++]='2';} else if (buf[vfech+0]=='M' && buf[vfech+1]=='a' && buf[vfech+2]=='r' ) { tel[k++]='0';tel[k++]='3';} else if (buf[vfech+0]=='A' && buf[vfech+1]=='p' && buf[vfech+2]=='r' ) { tel[k++]='0';tel[k++]='4';} else if (buf[vfech+0]=='M' && buf[vfech+1]=='a' && buf[vfech+2]=='y' ) { tel[k++]='0';tel[k++]='5';} else if (buf[vfech+0]=='J' && buf[vfech+1]=='u' && buf[vfech+2]=='n' ) { tel[k++]='0';tel[k++]='6';} else if (buf[vfech+0]=='J' && buf[vfech+1]=='u' && buf[vfech+2]=='l' ) { tel[k++]='0';tel[k++]='7';} else if (buf[vfech+0]=='A' && buf[vfech+1]=='u' && buf[vfech+2]=='g' ) { tel[k++]='0';tel[k++]='8';} else if (buf[vfech+0]=='S' && buf[vfech+1]=='e' && buf[vfech+2]=='p' ) { tel[k++]='0';tel[k++]='9';} else if (buf[vfech+0]=='O' && buf[vfech+1]=='c' && buf[vfech+2]=='t' ) { tel[k++]='1';tel[k++]='0';} else if (buf[vfech+0]=='N' && buf[vfech+1]=='o' && buf[vfech+2]=='v' ) { tel[k++]='1';tel[k++]='1';} else if (buf[vfech+0]=='D' && buf[vfech+1]=='e' && buf[vfech+2]=='c' ) { tel[k++]='1';tel[k++]='2';} tel[k++]='/'; tel[k++]=buf[vfech+4];tel[k++]=buf[vfech+5]; // dia tel[k++]='/'; tel[k++]=buf[vfech+9];tel[k++]=buf[vfech+10]; // aņo tel[k++]=' '; if (vtipo==1) tel[k++]='O'; // tipo de llamado entrada else tel[k++]='I'; // tipo de llamado salida tel[k++]=' '; cont=0; for (j=0;(isdigit(buf[vnumero+13+j])) && j<24 ;j++) cont++; /// cuenta largo numero if (cont>=5) /// ingresa numero { for (j=0;(isdigit(buf[vnumero+13+j])) && j<24 ;j++) tel[k++]=(buf[vnumero+13+j]);} else { for (j=0;(isdigit(numaxo[j])) && j<24 ;j++) tel[k++]=numaxo[j];} cont=0; tel[k++]=' '; tel[k++]='*';tel[k++]='*';tel[k++]='*';tel[k++]='*';// centro de costo tel[k++]=' '; tel[k++]='*';// codigo de proyecto tel[k++]=' '; tel[k++]='*';// codigo de cuenta tel[k++]=' '; tel[k++]='0';tel[k++]='0';tel[k++]='0';tel[k++]='0';// pulsos tel[k++]=' '; tel[k++]='*';tel[k++]='*';tel[k++]='*';// ruta tel[k++]=' '; tel[k++]='*'; tel[k++]=' '; tel[k++]='0';tel[k++]='0';tel[k++]=':';tel[k++]='0';tel[k++]='0'; tel[k++]=' '; tel[k++]='*';// axo tranf tel[k++]=' '; tel[k++]='*';// servicio tel[k++] = '\r' ; tel[k++] = '\n' ; tel[k++] = '\0' ; } } } }