#define americano 0 #define europeo 1 #define lmax 300 #define posin 18 #define ladat 120+posin #define estac 58+posin // llamadas entrantes #define linea 104+posin #define durac 12+posin #define hor 7 +posin #define fech 3 +posin #define tranf 23+posin #define numero 26+posin #define ccost 0 #define proye 85+posin #define cuenta 68+posin #define pulsos 17+posin #define ruta 102+posin #define prinum 0+posin #define ring 99+posin #define antran 0 // anexo transferido (pendiente) #define fofech americano // formato de fecha /* #define americano 0 // POSICIONES ESPECIALES PARA BP *****++ #define europeo 1 #define lmax 300 #define posin 18 #define ladat 123+posin #define estac 61+posin // llamadas entrantes #define linea 107+posin #define durac 15+posin #define hor 10 +posin #define fech 6 +posin #define tranf 26+posin #define numero 29+posin #define ccost 0 #define proye 88+posin #define cuenta 71+posin #define pulsos 20+posin #define ruta 105+posin #define prinum 0+posin #define ring 102+posin #define antran 0 // anexo transferido (pendiente) #define fofech americano*/ #define larnum 34 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) { char segu[3],anexoE[8], anexoS[8],tilla,tipo; // , bogota, cupiagua, cusiana, yopal, conbog,concus, concup, conyop; char aux; int i=strlen(buf),it,k,ka,minu,cont,contS,contE,j,conlin; double anexS, anexE; aux = 0; contE=0; contS=0;j=0;conlin=0; if (i>(vlinea+2)) { tilla = (buf[vtranf]==' ' || buf[vtranf]=='A' || buf[vtranf]=='D' || buf[vtranf]=='G' || buf[vtranf]=='I' || buf[vtranf]=='J' || buf[vtranf]=='L') ; tilla = (tilla || buf[vtranf]=='N' || buf[vtranf]=='M' || buf[vtranf]=='T' || buf[vtranf]=='V' || buf[vtranf]=='X' || buf[vtranf]=='Y') ; tilla = (tilla && isdigit(buf[vfech]) && isdigit(buf[vhor]) && isdigit(buf[vdurac]) && isdigit(buf[vring])) ; } else tilla = FALSE; contE=0; contS=0;j=0;conlin=0; // bogota=FALSE; cupiagua=FALSE; cusiana=FALSE; yopal=FALSE; // conbog= FALSE; concup= FALSE; concus=FALSE ; conyop= FALSE; for (j=0;j<8;j++) if (isdigit(buf[vestac+j])) { anexoS[contS]= buf[vestac+j]; contS++;} for (j=0;j<8;j++) if (isdigit(buf[vestac-8+j])) { anexoE[contE] = buf[vestac-8+j];contE++;} anexS = atof(anexoS); anexE = atof(anexoE); if ( buf[vestac-6]==' ' && buf[vestac+4]==' ' ) // interna { for (j=0;j<4;j++) { anexoS[j]=buf[vestac+j]; anexoE[j]=buf[vestac-5+j]; } } //if (buf[vprinum]=='B') bogota = TRUE; //else if (buf[vprinum]=='Y') yopal = TRUE; //else if (buf[vprinum]=='C' && buf[vprinum+2]=='P') cupiagua= TRUE; //else if (buf[vprinum]=='C' && buf[vprinum+2]=='S') cusiana = TRUE; /* if (cupiagua) { if (contE<5 && contS<5) if (( 6700<=anexS && anexS<=6999) || (3197<=anexS && anexS<=3199)) concup = TRUE; //interna if (contE>5 && contS<5) if (( 6700<=anexS && anexS<=6999) || (3197<=anexS && anexS<=3199)) concup = TRUE; //salida if (contE<5 && contS>5) if (( 6700<=anexE && anexE<=6999) || (3197<=anexE && anexE<=3199)) concup = TRUE; //entrada } else if (cusiana) { if (contE<5 && contS<5) if ( (6000<=anexS && anexS<=6499) || anexS==333 ) concus = TRUE; //interna if (contE>5 && contS<5) if ( (6000<=anexS && anexS<=6499) || anexS==333 ) concus = TRUE; //salida if (contE<5 && contS>5) if ( (6000<=anexE && anexE<=6499) || anexE==333 ) concus = TRUE; //entrada } else if (yopal) { if (contE<5 && contS<5) if ( 6500<=anexS && anexS<=6699 ) conyop = TRUE; //interna if (contE>5 && contS<5) if ( 6500<=anexS && anexS<=6699 ) conyop = TRUE; //salida if (contE<5 && contS>5) if ( 6500<=anexE && anexE<=6699 ) conyop = TRUE; //entrada } else if (bogota) { if (contE<5 && contS<5) {if ( 3000<=anexS && anexS<=4999 ) {conbog = TRUE;}} //interna else if (contE>5 && contS<5) {if ( 3000<=anexS && anexS<=4999 ) {conbog = TRUE;}} //salida else if (contE<5 && contS>5) {if ( 3000<=anexE && anexE <=4999 ) {conbog = TRUE;}} //entrada else conbog = FALSE;*/ //} // conbog = ( tilla && ( (buf[vestac]=='¿3' || buf[vestac]==4) && buf[vestac+5]==' ' ) || ( (buf[vestac-5]=='3' || buf[vestac-5]=='4') && buf[vestac-6]==' ')); if ( (contE<5 || contS<5 ) && tilla /*&& (conbog && bogota) || (cupiagua && concup) ||( cusiana && concus) || ( conyop && yopal ) */) { k = 0 ; if (buf[vestac-6]==' ' && buf[vestac+4]==' ') tipo='T'; else if (buf[vestac-6]==' ' && buf[vestac+4]!=' ') tipo='I'; else if (buf[vestac-6]!=' ' && buf[vestac+4]==' ') tipo='O'; else if (buf[vtranf]=='M') tipo='O'; else if (buf[vtranf]=='I') tipo='I'; else if (buf[vtranf]=='D') tipo='I'; else if (buf[vtranf]=='J') tipo='T'; else if (buf[vtranf]=='A') tipo='I'; else if (buf[vtranf]==' ' && buf[vestac-6]==' ') tipo='T'; else if (buf[vtranf]=='N') tipo='T'; else if (buf[vtranf]==' ' && buf[vestac-6]!=' ') tipo='O'; else if (buf[vtranf]=='T') tipo='I'; else tipo='O'; cont=0; if ( tipo=='O' || tipo=='T' ) { for (it=0;it<8 && buf[vestac+it]!=' ' ;it++) {tel[k++] = buf[vestac+it]; cont++;}} else if ( tipo=='T' && buf[vtranf]==' ' && buf[vestac+5]==' ') {for (it=0;it<4;it++) if (isdigit(buf[vestac+it])){ tel[k++]=buf[vestac+it];cont++;}} else if (tipo=='I') {for (it=0;it<4 ;it++) if ( isdigit(buf[vestac-5+it])) {tel[k++]=buf[vestac-5+it];cont++;}} else if (buf[vtranf-1]=='N' && buf[vtranf]=='I') {for (it=0;it<8 && (vlinea-1+it)