#define americano 0 #define europeo 1 #define lmax 200 // 200 #define posin 18 #define ladat 82+posin #define estac 8+posin #define linea 1+posin #define durac 27+posin #define hor 14+posin #define fech 0 #define tranf 40+posin #define numero 60+posin #define ccost 0 #define proye 49+posin #define cuenta 0 #define pulsos 0 #define ruta 0 #define prinum 0 #define ring 75+posin #define antran 0 // anexo transferido #define fofech americano 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 ka,it,k,i=strlen(buf),hopm, cont, j,lar_num; char shora[5]; char aux ; aux=0;cont=0;k=0;ka=0;lar_num=0; if (i>vdurac && buf[vfech+2]=='/' && buf[vhor+2]==':' && isdigit(buf[estac]) && isdigit(buf[vnumero+4])) { for (j=0;j<4 && isdigit(buf[vestac+j]);j++) tel[k++]=buf[vestac+j]; if(j==0)tel[k++] = '*'; tel[k++]=' '; for (j=0;j<4 && isdigit(buf[vlinea+j]);j++) tel[k++]=buf[vlinea+j]; if(j==0)tel[k++] = '*'; tel[k++] = ' ' ; if isdigit(buf[vdurac]) { tel[k++]= '0' ; tel[k++]= '0' ; tel[k++]= ':' ; tel[k++]= buf[vdurac] ; tel[k++]= buf[vdurac+1] ; tel[k++]= buf[vdurac+2] ; tel[k++]= buf[vdurac+3] ; tel[k++]= buf[vdurac+4] ; } else tel[k++]= '*'; tel[k++]= ' ' ; ka=k; shora[0] = buf[vhor] ; shora[1] = buf[vhor+1] ; shora[2] = '\0' ; hopm=atoi(shora) ; if (buf[vhor+6]=='P' && hopm< 12) itoa((hopm+12),shora,10) ; if (buf[vhor+6]=='A' && hopm==12) itoa((hopm-12),shora,10) ; if (shora[2]=='\0') { tel[k++] = shora[0] ; tel[k++] = shora[1] ; } if (shora[1]=='\0') { tel[k++] = '0' ; tel[k++] = shora[0] ; } if (tel[ka]==' ') tel[ka]='0' ; tel[k++] = ':' ; tel[k++] = buf[vhor+3] ; tel[k++] = buf[vhor+4] ; tel[k++] = ' ' ; ka=k; for (it=0 ; it<8 ; it++) tel[k++] = buf[vfech+it] ; if (vfofech==europeo) { tel[ka+0] = buf[vfech+3]; tel[ka+1] = buf[vfech+4]; tel[ka+3] = buf[vfech+0]; tel[ka+4] = buf[vfech+1]; } if (tel[ka]==' ') tel[ka] = '0' ; if (tel[ka+3]==' ') tel[ka+3] = '0' ; ka = k; tel[k++] = ' ' ; if ( buf[vtranf]=='I') { tel[k++] = 'I' ; lar_num=14; } else { tel[k++] = 'O' ; lar_num=20; } tel[k++] = ' ' ; for(j=0;(j