diff --git a/isdnlog/isdnlog/ChangeLog b/isdnlog/isdnlog/ChangeLog index 61a9fd1d..4ca816ec 100644 --- a/isdnlog/isdnlog/ChangeLog +++ b/isdnlog/isdnlog/ChangeLog @@ -1,3 +1,23 @@ +2004-09-29 Tobias Becker + + * isdnlog.c (init_variables): Set ignoreCLIP to 0. + * isdnlog.c (set_options): Set ignoreCLIP from -Ux[:y] option. + * isdnlog.c (read_param_file): Set ignoreCLIP from "ignoreCOLP=x[:y]", + use y value if present, x otherwise. + * processor.c (decode): Use ignoreCLIP instead of ignoreCOLP for + control of IE 0x6c (calling party number) handling. + + * processor.c (decode): Changes for IE 0x6c when IE is given twice, + e.g. source number from user and from network on an incoming call + (ETS 300 092-1 Annex B). Use network provided number as source + number (index [CALLING] for .onum and other in call[chan]) regardless + ignoreCLIP setting. ignoreCLIP now only controls the storage of the + user provided number to [CLIP]. The old effect of ignoreCLIP was to + look at the first IE only. Changed the calls of buildnumber and vnum + in case of number order network/user, so that [CLIP] is set right. + If there is an alias for the CLIP number, show alias and number in + parentheses (new) in "CLIP ..." notice. + 2004-09-05 Tobias Becker * isdnlog.h (ignore_unknown_PD): New global variable. diff --git a/isdnlog/isdnlog/isdnlog.8.in b/isdnlog/isdnlog/isdnlog.8.in index 8f348618..ad76c1c0 100644 --- a/isdnlog/isdnlog/isdnlog.8.in +++ b/isdnlog/isdnlog/isdnlog.8.in @@ -110,14 +110,17 @@ Ignore "housekeeping" frames. may be 1 (ignore RR=Receiver ready) or 2 (ignore EMP=Euracom Management Protokoll) frames. .TP -.B \-U\fIx\fB ignoreCOLP="value" +.B \-U\fIx[:y]\fB ignoreCOLP="value[:value]" Ignore COLP/CLIP frames when value is 1 or greater. Value 0 is default, and tells isdnlog to not ignore COLP/CLIP frames. +With value 2 the ignored COLP/CLIP number is displayed. +.br +The first value applies to COLP the second to CLIP. If only one value is given, +it applies to COLP and CLIP. .br Sometimes the COLP number is a number in a different areacode to the number that was dialled, and then the cost calculation would be wrong. .br -With value 2 the ignored COLP number is displayed. .TP .B ignoreUPD={yes|no} diff --git a/isdnlog/isdnlog/isdnlog.c b/isdnlog/isdnlog/isdnlog.c index 92a22528..ed9930fc 100644 --- a/isdnlog/isdnlog/isdnlog.c +++ b/isdnlog/isdnlog/isdnlog.c @@ -19,6 +19,11 @@ * along with this program; if not, write to the Free Software * * $Log$ + * Revision 1.73 2004/09/05 22:04:55 tobiasb + * New parameter file entry "ignoreUPD" for suppressing "Unexpected + * discrimator (...)" messages, demanded by Günther J. Niederwimmer + * on the suse-isdn mailing list. + * * Revision 1.72 2004/01/28 14:27:46 tobiasb * Second step in restricting fds at isdnlog restart and script starting. * The fd limit is now taken from getrlimit() instead of NR_OPEN. @@ -810,7 +815,7 @@ static void init_variables(int argc, char* argv[]) watchdog = 0; use_new_config = 1; - ignoreRR = ignoreCOLP = 0; + ignoreRR = ignoreCOLP = ignoreCLIP = 0; #ifdef Q931 q931dmp = 0; @@ -1018,8 +1023,15 @@ int set_options(int argc, char* argv[]) case 'u' : ignoreRR = atoi(optarg); break; - case 'U' : ignoreCOLP = atoi(optarg); - break; + case 'U' : + if ((p = strchr(optarg, ':'))) { + *p = 0; + ignoreCOLP = atoi(optarg); + ignoreCLIP = atoi(p + 1); + } + else + ignoreCOLP = ignoreCLIP = atoi(optarg); + break; case 'B' : free(vbn); vbn = strdup(optarg); @@ -1262,8 +1274,15 @@ static int read_param_file(char *FileName) if (!strcmp(Ptr->name,CONF_ENT_IGNORERR)) ignoreRR = (int)strtol(Ptr->value, NIL, 0); else - if (!strcmp(Ptr->name,CONF_ENT_IGNORECOLP)) - ignoreCOLP = (int)strtol(Ptr->value, NIL, 0); + if (!strcmp(Ptr->name,CONF_ENT_IGNORECOLP)) { + if ((p = strchr(Ptr->value, ':'))) { + *p = 0; + ignoreCOLP = atoi(Ptr->value); + ignoreCLIP = atoi(p + 1); + } + else + ignoreCOLP = ignoreCLIP = (int)strtol(Ptr->value, NIL, 0); + } else if (!strcmp(Ptr->name,CONF_ENT_VBN)) { free(vbn); diff --git a/isdnlog/isdnlog/processor.c b/isdnlog/isdnlog/processor.c index 6cc3c427..eee3a5b6 100644 --- a/isdnlog/isdnlog/processor.c +++ b/isdnlog/isdnlog/processor.c @@ -19,6 +19,11 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log$ + * Revision 1.129 2004/09/05 22:04:56 tobiasb + * New parameter file entry "ignoreUPD" for suppressing "Unexpected + * discrimator (...)" messages, demanded by Günther J. Niederwimmer + * on the suse-isdn mailing list. + * * Revision 1.128 2004/08/25 21:22:06 tobiasb * Minor fixes, required by gcc-3.4: Label at end of block, double function * declaration. Revealed by Andreas Jochens as Debian bug #266523. @@ -1430,7 +1435,7 @@ void buildnumber(char *num, int oc3, int oc3a, char *result, int version, sprintf(s, "\"%s\"", num); Q931dump(TYPE_STRING, -2, s, version); - } /* if */ + } /* if -q */ strcpy(n, num); strcpy(result, ""); @@ -1607,7 +1612,7 @@ void buildnumber(char *num, int oc3, int oc3a, char *result, int version, case 0x70 : break; /* 111 Reserved for extension */ } /* switch */ - } /* if */ + } /* if neither special number nor internal */ if (*num) strcat(result, num); @@ -2611,13 +2616,13 @@ static void decode(int chan, register char *p, int type, int version, int tei) if (*call[chan].onum[CALLING]) { /* another Calling-party? */ if (strcmp(call[chan].onum[CALLING], s)) { /* different! */ - if (ignoreCOLP && !Q931dmp) /* FIXME */ - break; - if ((call[chan].screening == 3) && ((oc3a & 3) < 3)) { /* we believe the first one! */ - strcpy(call[chan].onum[CLIP], s); - buildnumber(s, oc3, oc3a, call[chan].num[CLIP], version, &call[chan].provider, &call[chan].sondernummer[CLIP], &call[chan].intern[CLIP], &call[chan].local[CLIP], 0, 0); - strcpy(call[chan].vnum[CLIP], vnum(6, CLIP)); + /* first number was network provided, this is not */ + if (!ignoreCLIP || Q931dmp) { + strcpy(call[chan].onum[CLIP], s); + buildnumber(s, oc3, oc3a, call[chan].num[CLIP], version, &call[chan].provider, &call[chan].sondernummer[CLIP], &call[chan].intern[CLIP], &call[chan].local[CLIP], call[chan].dialin, CALLING); + strcpy(call[chan].vnum[CLIP], vnum(chan, CLIP)); + } if (Q931dmp && (*call[chan].vnum[CLIP] != '?') && *call[chan].vorwahl[CLIP] && oc3 && ((oc3 & 0x70) != 0x40)) { auto char s[BUFSIZ]; @@ -2629,14 +2634,34 @@ static void decode(int chan, register char *p, int type, int version, int tei) call[chan].area[CLIP]); Q931dump(TYPE_STRING, -2, s, version); - } /* if */ + } /* if -q */ - sprintf(s1, "CLIP %s", call[chan].vnum[CLIP]); - info(chan, PRT_SHOWNUMBERS, STATE_RING, s1); + if (!ignoreCLIP) { + if (call[chan].confentry[CLIP] != UNKNOWN) + snprintf(s1, BUFSIZ, "CLIP: %s (%s)", call[chan].vnum[CLIP], call[chan].num[CLIP]); + else + snprintf(s1, BUFSIZ, "CLIP: %s", call[chan].vnum[CLIP]); + info(chan, PRT_SHOWNUMBERS, STATE_RING, s1); + } + else if (ignoreCLIP & 0x2) { + snprintf(s1, BUFSIZ, "CLIP %s -- ignored", s); + info(chan, PRT_SHOWNUMBERS, STATE_RING, s1); + } - break; + break; /* [CALLING] remain unchanged */ + } + else if (ignoreCLIP && !Q931dmp) { + /* same as below, but first number gets ignored */ + if (ignoreCLIP & 0x2) { + snprintf(s1, BUFSIZ, "CLIP %s -- ignored", call[chan].onum[CALLING]); + info(chan, PRT_SHOWNUMBERS, STATE_RING, s1); + } } else { + /* first number was not network provided, this may be + * first number was network provided, this is too + * --> consider first number as CLIP, this number + as the default source number */ warn = 1; strcpy(call[chan].onum[CLIP], call[chan].onum[CALLING]); @@ -2671,7 +2696,7 @@ static void decode(int chan, register char *p, int type, int version, int tei) call[chan].area[CALLING]); Q931dump(TYPE_STRING, -2, s, version); - } /* if */ + } /* if -q */ if (callfile && call[chan].dialin) { FILE *cl = fopen(callfile, "a"); @@ -2688,7 +2713,10 @@ static void decode(int chan, register char *p, int type, int version, int tei) } /* if */ if (warn) { - sprintf(s1, "CLIP %s", call[chan].vnum[CLIP]); + if (call[chan].confentry[CLIP] != UNKNOWN) + snprintf(s1, BUFSIZ, "CLIP: %s (%s)", call[chan].vnum[CLIP], call[chan].num[CLIP]); + else + snprintf(s1, BUFSIZ, "CLIP: %s", call[chan].vnum[CLIP]); info(chan, PRT_SHOWNUMBERS, STATE_RING, s1); } /* if */ diff --git a/isdnlog/tools/ChangeLog b/isdnlog/tools/ChangeLog index 481d37e6..070538bd 100644 --- a/isdnlog/tools/ChangeLog +++ b/isdnlog/tools/ChangeLog @@ -1,3 +1,7 @@ +2004-09-29 Tobias Becker + + * tools.h (ignoreCLIP): New global variable, similiar ignoreCOLP. + 2004-09-27 Tobias Becker * isdnrate.c (printTable): Check provider and price (new) when diff --git a/isdnlog/tools/tools.h b/isdnlog/tools/tools.h index 9958f404..819f38ff 100644 --- a/isdnlog/tools/tools.h +++ b/isdnlog/tools/tools.h @@ -20,6 +20,11 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log$ + * Revision 1.62 2004/09/05 22:04:57 tobiasb + * New parameter file entry "ignoreUPD" for suppressing "Unexpected + * discrimator (...)" messages, demanded by Günther J. Niederwimmer + * on the suse-isdn mailing list. + * * Revision 1.61 2004/07/24 16:16:56 tobiasb * New entry `REPOPTIONS' in section [ISDNLOG] of the isdn configuration * file. This will be used for commandline options defaults of isdnrep. @@ -1177,6 +1182,7 @@ _EXTERN char mlabel[BUFSIZ]; _EXTERN char *amtsholung; _EXTERN int ignoreRR; _EXTERN int ignoreCOLP; +_EXTERN int ignoreCLIP; _EXTERN int interns0; _EXTERN char *vbn; _EXTERN char *vbnlen;