#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define estac 9+posin #define linea 28+posin #define durac 29+posin #define hor 4+posin #define fech 0+posin #define tranf 12+posin #define numero 33+posin #define ccost 0 #define proye 76+posin #define cuenta 0 #define pulsos 0 #define ruta 0 #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 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; aux = 0; if (i>vdurac && isdigit(buf[vfech]) && isdigit(buf[vhor]) && isalpha(buf[vtranf]) ) { k=0; for (it=0;it<4;it++) { if (isdigit(buf[vestac+it])) tel[k++] = buf[vestac+it] ; } tel[k++] = ' ' ; tel[k++] = buf[vlinea] ; tel[k++] = ' ' ; ka=k; tel[k++] = buf[vdurac] ; tel[k++] = buf[vdurac+1] ; tel[k++] = ':' ; tel[k++]= buf[vdurac+2] ; tel[k++]= buf[vdurac+3] ; tel[k++]= ':' ; tel[k++]= '0'; tel[k++]= '0'; 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+2] ; tel[k++] = buf[vfech+3] ; tel[k++] = '/'; tel[k++] = buf[vfech+0] ; tel[k++] = buf[vfech+1] ; } else { tel[k++] = buf[vfech+0] ; tel[k++] = buf[vfech+1] ; tel[k++] = '/'; tel[k++] = buf[vfech+2] ; tel[k++] = buf[vfech+3] ; } tel[k++] = '/'; tel[k++] = buf[6] ; tel[k++] = buf[7] ; tel[k++] = ' ' ; if (buf[vtranf]=='O') vtip ='O'; else vtip ='I'; tel[k++] = vtip ; tel[k++] = ' ' ; if (vtip=='O') { for (it =0;it<18;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++] = ' ' ; 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++] = '\r' ; tel[k++] = '\n' ; tel[k++] = '\0' ; } }