#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define estac 38+posin #define linea 15+posin #define durac 8+posin #define hor 3+posin #define fech 0 #define tranf 13+posin #define numero 22+posin #define ccost 0 #define proye 76+posin #define cuenta 0 #define pulsos 0 #define ruta 18+posin #define prinum 0 #define ring 63+posin #define antran 0 // anexo transferido #define fofech americano #define ampm 15 #define incomin 28 extern char rgua[]; void in_central() { rgua[0]='\0'; } void fi_central() { } void fseg(char min, char *seg) { int imin ; char cseg[3] ; imin=((int)min-0x30)*6 ; itoa(imin,cseg,10) ; if (imin>9) { seg[0]=cseg[0] ; seg[1]=cseg[1] ; } else { seg[0]='0' ; seg[1]=cseg[0] ; } seg[2]='\0' ; } 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,it,k,i=strlen(buf); char aux,vtip,shora[8]; aux = 0; if (i>vestac && isdigit(buf[vhor]) && (isalpha(buf[vtranf])|| buf[vtranf]==' ')) { k=0; for (it=0;it<4;it++) { if (isdigit(buf[vestac+it])) tel[k++] = buf[vestac+it] ; } tel[k++] = ' ' ; if (isdigit(buf[vlinea+2])) { for (it=0;it<3;it++) { if (isdigit(buf[vlinea+it])) tel[k++] = buf[vlinea+it] ; } } else tel[k++] = '*' ; tel[k++] = ' ' ; ka=k; tel[k++] = '0' ; tel[k++] = buf[vdurac] ; tel[k++] = ':' ; tel[k++] = buf[vdurac+1] ; tel[k++] = buf[vdurac+2] ; tel[k++] = ':' ; fseg(buf[vdurac+3],shora) ; tel[k++] = shora[0] ; tel[k++] = shora[1] ; tel[k++] = ' ' ; tel[k++] = buf[vhor+0] ; tel[k++] = buf[vhor+1] ; tel[k++] = ':' ; tel[k++] = buf[vhor+2] ; tel[k++] = buf[vhor+3] ; tel[k++] = ' ' ; if (vfofech == europeo) { tel[k++] = buf[vfech+0] ; tel[k++] = buf[vfech+1] ; tel[k++] = buf[vfech+2] ; tel[k++] = buf[vfech+3] ; tel[k++] = buf[vfech+4] ; } else { tel[k++] = buf[vfech+0] ; tel[k++] = buf[vfech+1] ; tel[k++] = buf[vfech+2] ; tel[k++] = buf[vfech+3] ; tel[k++] = buf[vfech+4] ; } tel[k++] = buf[5] ; tel[k++] = buf[6] ; tel[k++] = buf[7] ; tel[k++] = ' ' ; if (buf[vtranf]=='I' || buf[vtranf]=='G') vtip ='I'; else vtip ='O'; tel[k++] = vtip ; tel[k++] = ' ' ; if (isdigit(buf[vnumero+14])) { for (it =0;it<15;it++) { if isdigit(buf[vnumero+it]) tel[k++]= buf[vnumero+it]; } } else tel[k++] = '*' ; tel[k++] = ' ' ; tel[k++] = '*' ; // centro de costo tel[k++] = ' ' ; tel[k++] = '*' ; // código de proyecto tel[k++] = ' ' ; tel[k++] = '*' ; // código de cuenta tel[k++] = ' ' ; for (it=0 ; it<4 ; it++) tel[k++]= '0' ; tel[k++] = ' ' ; if (isdigit(buf[vruta+2])) { for (it=0;it<3;it++) { if (isdigit(buf[vruta+it])) tel[k++] = buf[vruta+it] ; } } else tel[k++] = '*' ; 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++] = '\r' ; tel[k++] = '\n' ; tel[k++] = '\0' ; } }