1 /*****************************************************************************\
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg **
10 \*****************************************************************************/
18 #include "extension.h"
20 struct isdn_cause isdn_cause[128] = {
21 /********************************* - **/ /*38*/
24 { /*1*/ "Unallocated number",
25 "Nummer nicht vergeben" },
26 { /*2*/ "No route to transit network",
27 "Keine Verbindung zum Netz" },
28 { /*3*/ "No route to destination",
29 "Zielnummer nicht erreichbar" },
30 { /*4*/ "<Listen to announcement...>",
31 "<Ansage hoeren...>" },
32 { /*5*/ "Misdialed trunk prefix.",
33 "Falscher Carrier-Code" },
34 { /*6*/ "Channel unacceptable",
35 "Kanal nicht akzeptiert" },
40 { /*9*/ "Preemption - circuit reserved",
41 "Vorkauf - Gasse reserviert" },
54 { /*16*/ "Normal call clearing",
55 "Normaler Verbindungsabbau" },
57 "Teilnehmer besetzt" },
58 { /*18*/ "No user responding",
59 "Teilnehmer antwortet nicht" },
60 { /*19*/ "No answer from user",
61 "Teilnehmer nimmt nicht ab" },
62 { /*20*/ "Subscriber absent",
63 "Teilnehmer nicht anwesend" },
64 { /*21*/ "Call rejected",
65 "Gespraech abgewiesen" },
66 { /*22*/ "Number changed",
67 "Rufnummer hat sich geaendert" },
74 { /*26*/ "Non-selected user clearing",
75 "Gespraech woanders angenommen" },
76 { /*27*/ "Destination out of order",
77 "Gegenstelle ausser Betrieb" },
78 { /*28*/ "Invalid number (incomplete)",
79 "Fehlerhafte Nummer (n. komplett)" },
80 { /*29*/ "Facility rejected",
81 "Funktion nicht verfuegbar" },
84 { /*31*/ "Normal, unspecified",
85 "Normal, unspezifisch" },
90 { /*34*/ "No circuit/channel available",
91 "Keine Gasse/Kanal verfuegbar" },
104 { /*41*/ "Temporary failure",
105 "Vorruebergehende Fehlfunktion" },
106 { /*42*/ "Switchting equipment congestion",
107 "Vermittlungstelle ueberlastet" },
108 { /*43*/ "Access informationen discarded",
109 "Zugriffsinformationen geloescht" },
110 { /*44*/ "No requested circuit/channel",
111 "Keine angeforderte Gasse/Kanal" },
114 { /*46*/ "Precedence call blocked",
115 "Vorverkaufanruf gesperrt" },
116 { /*47*/ "Resource unavailable, unspecified",
120 { /*49*/ "Quality of service not available",
121 "Qualitaetsmerkmal nicht verfuegbar" },
122 { /*50*/ "Requested facility not subscribed",
123 "Funktion nicht freigeschaltet" },
128 { /*53*/ "Outgoing calls barred within CUG",
129 "CUG erlaubt keine gehenden Rufe" },
132 { /*55*/ "Incoming calls barred within CUG",
133 "CUG erlaubt keine kommenden Rufe" },
136 { /*57*/ "Bearer capability not authorized",
137 "Verbindungseigenschaft verboten" },
138 { /*58*/ "Bearer capability not present",
139 "Verb.eigenschaft n. verfuegbar" },
148 { /*63*/ "Service or option not available",
149 "Dienst oder Merkmal nicht verf." },
152 { /*65*/ "Bearer capability not implement.",
153 "Verb.eigenschaft nicht unterstue." },
154 { /*66*/ "Channel type not implemented",
155 "Kanalart nicht unterstuetzt" },
160 { /*69*/ "Requested facility not implement.",
161 "Funktion nicht unterstuetzt" },
162 { /*70*/ "restricted digital informat. only",
163 "Nur eingeschraenkte digitale inf." },
180 { /*79*/ "Service or option not implemented",
181 "Dienst oder Merkmal n. unterstue." },
184 { /*81*/ "Invalid call reference value",
185 "Falsche call reference" },
186 { /*82*/ "Identified channel does not exist",
187 "Erkannter Kanal existiert nicht" },
188 { /*83*/ "No suspended call with this id",
189 "Kein geparktes Gespr. f. diese ID" },
190 { /*84*/ "Call identity in use",
192 { /*85*/ "No call suspended",
193 "Kein geparktes Gespraech" },
194 { /*86*/ "Suspended call has been cleared",
195 "Geparktes Gespraech wurde beendet" },
196 { /*87*/ "User not member of CUG",
197 "Teilnehmer nicht in der CUG" },
198 { /*88*/ "Incompatibel destination",
199 "Gegenstelle nicht kompatibel" },
202 { /*90*/ "Non-existent CUG",
203 "CUG existiert nicht" },
204 { /*91*/ "Invalid transit network selection",
205 "Falscher Carrier-Code" },
212 { /*95*/ "Invalid message, unspecified",
213 "Fehlerhafte Daten, unbekannt" },
214 { /*96*/ "Information element missing",
215 "Information wird vermisst" },
216 { /*97*/ "Message type non-existent",
217 "Message exisitiert nicht" },
218 { /*98*/ "Message not compatible with state",
219 "Message nicht komatibel" },
220 { /*99*/ "Information element not impl.",
221 "Information nicht implementiert" },
222 { /*100*/ "Invalid info element contents",
223 "Fehlerhafterhafte Information" },
224 { /*101*/ "Message not compatible with state",
225 "Message not kompatibel" },
226 { /*102*/ "Recovery on timer expiry",
227 "Fehler durch Zeitueberschreitung" },
228 { /*103*/ "Parameter non-existent",
244 { /*111*/ "Protocol error, unspecified",
245 "Protokollfehler, unbekannt" },
276 { /*127*/ "Interworking, unspecified",
277 "Zusammenspiel, unbekannt" },
280 struct isdn_cause isdn_cause_class[8] = {
281 /********************************* - **/ /*38*/
282 { /*0*/ "(Normal class)",
283 "(Normale Fehlerklasse)" },
284 { /*16*/ "(Normal class)",
285 "(Normale Fehlerklasse)" },
286 { /*32*/ "(Resource unavailable class)",
287 "(Ressourcen nicht verfuegbar)" },
288 { /*48*/ "(Service or option unavailable)",
289 "(Dienst oder Merkmal n. verfueg.)" },
290 { /*64*/ "(Service or option n.implemented)",
291 "(Dienst oder Merkmal n. vorhand.)" },
292 { /*80*/ "(Invalid message class)",
293 "(Fehlerhafte Message)" },
294 { /*96*/ "(Protocol error class)",
295 "(Klasse der Protokollfehler)" },
296 { /*112*/ "(Interworking class)",
297 "(Klasse des Zusammenspiels)" },
300 struct isdn_location isdn_location[16] = {
303 { /*1*/ "Private (Local)",
305 { /*2*/ "Public (Local)",
306 "Vermittlung (Lokal)" },
308 "Knotenvermittlung" },
309 { /*4*/ "Public (Remote)",
310 "Vermittlung (Gegenstelle)" },
311 { /*5*/ "Private (Remote)",
312 "Anlage (Gegenstelle)" },
315 { /*7*/ "International",
321 { /*10*/ "Beyond Interworking",
322 "Nicht verfuegbar" },
335 char *get_isdn_cause(int cause, int location, int type)
337 static char result[128];
340 if (cause<0 || cause>127)
345 case DISPLAY_CAUSE_NUMBER:
346 SPRINT(result, "Cause %d", cause);
349 case DISPLAY_CAUSE_ENGLISH:
350 if (isdn_cause[cause].english[0])
351 SPRINT(result, "%d - %s", cause, isdn_cause[cause].english);
352 else SPRINT(result, "%d - %s", cause, isdn_cause_class[cause>>4].english);
355 case DISPLAY_CAUSE_GERMAN:
356 if (isdn_cause[cause].german[0])
357 SPRINT(result, "%d - %s", cause, isdn_cause[cause].german);
358 else SPRINT(result, "%d - %s", cause, isdn_cause_class[cause>>4].german);
361 case DISPLAY_LOCATION_ENGLISH:
362 if (isdn_location[location].english[0])
363 SPRINT(result, "%d - %s", cause, isdn_location[location].english);
364 else SPRINT(result, "%d - Location code %d", cause, location);
367 case DISPLAY_LOCATION_GERMAN:
368 if (isdn_location[location].german[0])
369 SPRINT(result, "%d - %s", cause, isdn_location[location].german);
370 else SPRINT(result, "%d - Lokationscode %d", cause, location);
381 * collect cause for multipoint
382 * used by Process, Endpoint and Join instance when multiplexing
384 void collect_cause(int *multicause, int *multilocation, int newcause, int newlocation)
386 if (newcause == CAUSE_REJECTED) /* call rejected */
388 *multicause = newcause;
389 *multilocation = newlocation;
391 if (newcause==CAUSE_NORMAL && *multicause!=CAUSE_REJECTED) /* reject via hangup */
393 *multicause = newcause;
394 *multilocation = newlocation;
396 if (newcause==CAUSE_BUSY && *multicause!=CAUSE_REJECTED && *multicause!=CAUSE_NORMAL) /* busy */
398 *multicause = newcause;
399 *multilocation = newlocation;
401 if (newcause==CAUSE_OUTOFORDER && *multicause!=CAUSE_BUSY && *multicause!=CAUSE_REJECTED && *multicause!=CAUSE_NORMAL) /* no L1 */
403 *multicause = newcause;
404 *multilocation = newlocation;
406 if (newcause!=CAUSE_NOUSER && *multicause!=CAUSE_OUTOFORDER && *multicause!=CAUSE_BUSY && *multicause!=CAUSE_REJECTED && *multicause!=CAUSE_NORMAL) /* anything but not 18 */
408 *multicause = newcause;
409 *multilocation = newlocation;
411 if (newcause==CAUSE_NOUSER && *multicause==CAUSE_NOUSER) /* cause 18, use the location */
413 *multilocation = newlocation;
415 if (*multicause==0) /* no cause yet, use newcause (should be 18) */
417 *multicause = newcause;
418 *multilocation = newlocation;