#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define estac 34+posin #define linea 39+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 55+posin #define cuenta 0 #define pulsos 0 #define ruta 16+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),j,cont; char vtip,shora[8]; cont=0; if (i>(vlinea+2) && isdigit(buf[vhor]) && isdigit(buf[vdurac]) && buf[vtranf]!='J' && buf[vtranf]!='N' && isdigit(buf[vestac+2])) { k=0; if(buf[vtranf]==' ' || isdigit(buf[vestac-3])) { vtip='O'; for (j=0;j<3;j++) //estac { if (isdigit(buf[vlinea+j])) {tel[k++] = buf[vlinea+j] ;cont++;} } if(cont==0)tel[k++] = '*';cont=0; tel[k++]=' '; for (j=0;j<2;j++) //ruta como linea para llamada celulares sin marcar 09 { if (isdigit(buf[vruta+j])) {tel[k++] = buf[vruta+j] ;cont++;} } if(cont==0)tel[k++] = '*';cont=0; } else { vtip='I'; for (j=0;j<3;j++) { if (isdigit(buf[vestac+j])) {tel[k++] = buf[vestac+j] ; cont++;} } if(cont==0)tel[k++] = '*';cont=0; tel[k++]=' '; for (j=0;j<3;j++) { if (isdigit(buf[vlinea+j])) {tel[k++] = buf[vlinea+j] ; cont++;} } if(cont==0)tel[k++] = '*';cont=0; } 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++] = ' ' ; tel[k++] = vtip ; tel[k++] = ' ' ; if (vtip=='O') { for (j=0;j<15;j++) { if (isdigit(buf[vnumero+j])) {tel[k++] = buf[vnumero+j] ;cont++;} } if(cont==0)tel[k++] = '*';cont=0; } else tel[k++] = '*' ; tel[k++] = ' ' ; tel[k++] = '*' ;tel[k++] = '*' ;tel[k++] = '*' ; // centro de costo tel[k++] = ' ' ; tel[k++] = '*'; tel[k++] = ' ' ; tel[k++] = '*' ; // código de cuenta tel[k++] = ' ' ; for (it=0 ; it<5 ; it++) tel[k++]= '0' ; tel[k++] = ' ' ; for (j=0;j<2;j++) { if (isdigit(buf[vruta+j])) {tel[k++] = buf[vruta+j] ;cont++;} } if(cont==0)tel[k++] = '*';cont=0; 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' ; } }