#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define estac 18+posin #define linea 23+posin #define durac 64+posin #define hor 10 +posin #define fech 0 +posin #define tranf 19+posin #define numero 26+posin #define ccost 0 #define proye 75+posin #define cuenta 0 #define pulsos 0 #define ruta 0 #define prinum 0 #define ring 0 #define antran 0 // anexo transferido #define fofech europeo 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 ka,k,i=strlen(buf),hopm,it,j,cont; char shora[5]; char aux; aux=0; cont=0; if (i>vdurac+6 && buf[vfech+2]=='/' /*&& buf[vhor+2]==':' && isalnum(buf[vestac]) /*&& buf[vdurac+2]==':'*/ ) { k=0; //if buf[vestac]=='E') /*tel[k++] = buf[vestac];*/tel[k++] = buf[vestac+1];tel[k++] = buf[vestac+2];// anexo tel[k++] = ' '; tel[k++] = buf[vlinea]; tel[k++] = buf[vlinea+1]; tel[k++] = ' '; //ka=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] ; //ka=k; tel[k++]= ' '; shora[0] = buf[vhor] ; shora[1] = buf[vhor+1] ; shora[2] = '\0' ; hopm=atoi(shora) ; if (buf[vhor+5]=='P' && hopm< 12) itoa((hopm+12),shora,10) ; if (buf[vhor+5]=='A' && hopm==12) itoa((hopm-12),shora,10) ; if (shora[2]=='\0') { if (buf[vhor+5]=='A' && !isdigit(buf[vhor])) {tel[k++] = '0';} else {tel[k++] = shora[0] ; } tel[k++] = shora[1] ; } if (shora[1]=='\0') { tel[k++] = '0' ; tel[k++] = shora[0] ; } ka = k; if (tel[ka]==' ') tel[ka]='0' ; tel[k++] = ':' ; tel[k++] = buf[vhor+3] ; tel[k++] = buf[vhor+4] ; tel[k++] = ' ' ; if (buf[vfech]==' ') {tel[k++]='0'; tel[k++]=buf[vfech+1]; tel[k++]='/';} else {tel[k++]=buf[vfech] ;tel[k++]=buf[vfech+1]; tel[k++]='/';} if ( buf[vfech+3]=' ') { tel[k++]='0'; tel[k++]=buf[vfech+4]; tel[k++]='/';} else {tel[k++]=buf[vfech+3]; tel[k++]=buf[vfech+4]; tel[k++]='/';} tel[k++]=buf[vfech+6]; tel[k++]=buf[vfech+7]; //if (cont==0) tel[k++]='*'; cont=0; tel[k++] = ' ' ; if isdigit(buf[vnumero+3]) tel[k++]='O'; else tel[k++]='I'; tel[k++] = ' ' ; if isdigit(buf[vnumero+3]) {for(j=0;j<15;j++) //numero { if isdigit(buf[vnumero+j]) {tel[k++]=buf[vnumero+j];cont++;} } } else if (buf[vnumero+2]) {for (j=0;j<24;j++) { if (isdigit(buf[vnumero+10+j])) { tel[k++]=buf[vnumero+10+j];} } } else tel[k++]= '*'; //if (cont==0) tel[k++]='*'; cont=0; tel[k++] = ' ' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = '*' ; //ccosto tel[k++] = ' ' ; for(j=0;j<5;j++) //proy { if isdigit(buf[vproye+j]) {tel[k++]=buf[vproye+j];} else tel[k++]='*'; } //if (cont==0) tel[k++]='*'; cont=0; tel[k++] = ' ' ; tel[k++] = '*' ; // código de cuenta tel[k++] = ' ' ; for (it=0 ; it<5 ; it++) tel[k++]= '0' ; tel[k++] = ' ' ; tel[k++] = '*' ; 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++] = ' ' ; if(buf[vfech+9]=='*') tel[k++]='T'; //servicio else tel[k++]='*'; tel[k++] = '\r' ; tel[k++] = '\n' ; tel[k++] = '\0' ; } }