#define americano 0 #define europeo 1 #define lmax 200 #define posin 18 #define ladat 82+posin #define estac 0+posin // llamadas entrantes #define linea 45+posin #define durac 35+posin #define hor 24+posin #define fech 13+posin #define tranf 10+posin #define numero 51+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 (pendiente) #define fofech europeo // formato de fecha #define larnum 20 extern void gua_rut(char *buf); char ruanex[(lmax+1)*2][7] ; /* Rutas Consideradas como Anexos */ extern char rgua[]; // Procesos Inicialiales (Inicializar Variables, Abrir // Archivos especiales, etc) void in_central() { rgua[0] = '\0'; } // Procesos de Finalización (Cerrar Archivos especiales, etc) void fi_central() { } // Driver Propiamente tal. Las posiciones de los campos se // ingresan como parámetros, lo que permite modificar desde // Aplicación de Tarificación la posición de estos en el // Registro de Llamados. 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 l=strlen(buf),it,k,ka; if (l>vnumero && buf[vfech+2]=='/' && buf[vfech+5]=='/' && buf[vhor+2]==':' && buf[vdurac+2]==':' && buf[vdurac+5]==':' && (buf[vtranf]=='E' || buf[vtranf]=='S' || buf[vtranf]=='T')) { k = 0 ; tel[k++] = buf[vestac] ; tel[k++] = buf[vestac+1] ; tel[k++] = buf[vestac+2] ; tel[k++] = buf[vestac+3] ; tel[k++] = buf[vestac+4] ; tel[k++] = buf[vestac+5] ; tel[k++] = ' ' ; tel[k++] = buf[vlinea] ; tel[k++] = buf[vlinea+1] ; tel[k++] = buf[vlinea+2] ; tel[k++] = buf[vlinea+3] ; tel[k++] = ' ' ; if (buf[vdurac+0]!=' ') tel[k++]=buf[vdurac+0] ; else tel[k++]='0' ; if (buf[vdurac+1]!=' ') tel[k++]=buf[vdurac+1] ; else tel[k++]='0' ; tel[k++] = ':' ; if (buf[vdurac+3]!=' ') tel[k++]=buf[vdurac+3] ; else tel[k++]='0' ; if (buf[vdurac+4]!=' ') tel[k++]=buf[vdurac+4] ; else tel[k++]='0' ; tel[k++] = ':' ; if (buf[vdurac+6]!=' ') tel[k++]=buf[vdurac+6] ; else tel[k++]='0' ; if (buf[vdurac+7]!=' ') tel[k++]=buf[vdurac+7] ; else tel[k++]='0' ; tel[k++] = ' ' ; ka = k ; tel[k++] = buf[vhor] ; tel[k++] = buf[vhor+1] ; if (tel[ka]==' ') tel[ka]='0' ; tel[k++] = ':' ; tel[k++] = buf[vhor+3] ; tel[k++] = buf[vhor+4] ; tel[k++] = ' ' ; if (vfofech==europeo){ tel[k++] = buf[vfech+3] ; tel[k++] = buf[vfech+4] ; 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+3] ; tel[k++] = buf[vfech+4] ; } tel[k++] = '/'; tel[k++] = buf[vfech+6] ; tel[k++] = buf[vfech+7] ; tel[k++] = ' ' ; if (buf[vtranf]=='S' || (buf[vtranf]=='T' && isdigit(buf[vnumero]))) tel[k++]='O' ; else tel[k++] = 'I' ; tel[k++] = ' ' ; if (l<=(vnumero+2)) tel[k++] = '*' ; for (it=vnumero; it<(vnumero+larnum) && it<(l-2) ; it++) tel[k++] = buf[it] ; tel[k++] = ' ' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = '*' ; /* centro de costo */ tel[k++] = ' ' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = '*' ; tel[k++] = '*' ; /* proyecto */ tel[k++] = ' ' ; tel[k++] ='*' ; /* cuenta */ tel[k++] = ' ' ; 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 tranferido */ tel[k++] = '\r' ; tel[k++] = '\n' ; tel[k++] = '\0' ; } }