[Pkg-voip-commits] r1250 - in libpri/trunk/debian: . patches
Tzafrir Cohen
tzafrir-guest at costa.debian.org
Tue Feb 7 22:40:55 UTC 2006
Author: tzafrir-guest
Date: 2006-02-07 22:40:51 +0000 (Tue, 07 Feb 2006)
New Revision: 1250
Modified:
libpri/trunk/debian/changelog
libpri/trunk/debian/patches/bristuff.dpatch
libpri/trunk/debian/patches/libname.dpatch
libpri/trunk/debian/rules
Log:
* bristuff 0.3.0-PRE-1k
* some changes to the libname patch (don't change links in the build dir)
* we no longer need to symlink manually (right?)
Modified: libpri/trunk/debian/changelog
===================================================================
--- libpri/trunk/debian/changelog 2006-02-07 20:02:41 UTC (rev 1249)
+++ libpri/trunk/debian/changelog 2006-02-07 22:40:51 UTC (rev 1250)
@@ -1,3 +1,11 @@
+libpri (1.2.2-2) unstable; urgency=low
+
+ * bristuff 0.3.0-PRE-1k
+ * some changes to the libname patch (don't change links in the build dir)
+ * we no longer need to symlink manually (right?)
+
+ -- Tzafrir Cohen <tzafrir.cohen at xorcom.com> Wed, 08 Feb 2006 00:39:46 +0200
+
libpri (1.2.2-1) unstable; urgency=low
[ Tzafrir Cohen ]
Modified: libpri/trunk/debian/patches/bristuff.dpatch
===================================================================
--- libpri/trunk/debian/patches/bristuff.dpatch 2006-02-07 20:02:41 UTC (rev 1249)
+++ libpri/trunk/debian/patches/bristuff.dpatch 2006-02-07 22:40:51 UTC (rev 1250)
@@ -2,61 +2,16 @@
## bristuff.dpatch by Tzafrir Cohen <tzafrir.cohen at xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
-## DP: The libpri part of bristuff, version 0.3.0-PRE-1f
+## DP: The libpri part of bristuff, version 0.3.0-PRE-1k
+## DP:
+## DP: newer versions: replace the contets of the patch file literally.
+## DP: The remove Makefile and the strange changes this libpri.patc makes to
+## DP: copyright statements.
@DPATCH@
---- libpri-1.2.1.orig/README 2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.1/README 2005-06-13 09:02:39.000000000 +0200
-@@ -1,6 +1,7 @@
--libpri: An implementation of Primate Rate ISDN
--
--Written by Mark Spencer <markster at digium.com>
-+libpri: An implementation of Primate Rate ISDN (and BRI ISDN)
-+
-+Written by Mark Spencer <markster at linux-support.net>
-+Modified for BRI support by Klaus-Peter Junghanns <kpj at junghanns.net>
-
- What is libpri?
- ===============
-@@ -9,6 +10,7 @@
- based on the Bellcore specification SR-NWT-002343 for National ISDN. As of
- May 12, 2001, it has been tested work with NI-2, Nortel DMS-100, and
- Lucent 5E Custom protocols on switches from Nortel and Lucent.
-+The BRI and euroISDN modifications are based on ETS 300 102-1.
-
- What is the license for libpri?
- ===============================
-@@ -22,9 +24,8 @@
- or the GPL of libpri.
-
- If you wish to use libpri in an application for which the GPL is not
--appropriate (e.g. a proprietary embedded system), licenses for libpri
--under more flexible terms can be readily obtained through Digium, Inc.
--at reasonable cost.
-+appropriate (e.g. a proprietary embedded system), then you have to use
-+a non-standard compliant version without BRI support.
-
-
- How do I report bugs or contribute?
-diff -urN libpri-1.2.1.orig/TODO libpri-1.2.1/TODO
---- libpri-1.2.1.orig/TODO 2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.1/TODO 2005-12-21 14:24:02.000000000 +0100
-@@ -2,9 +2,7 @@
- -- D-Channel Backup
- -- Test against 4e
-
--Q.921:
---- Support unnumbered information frames
--
- Q.931:
---- Locking Shift IE
---- Implement the 11 missing Q.931 timers
-+-- Locking Shift IE (you did that already, didnt you??)
-+-- Implement the 10 missing Q.931 timers
-+-- more facilities
-diff -urN libpri-1.2.1.orig/libpri.h libpri-1.2.1/libpri.h
---- libpri-1.2.1.orig/libpri.h 2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.1/libpri.h 2005-11-20 15:18:11.000000000 +0100
+diff -urN libpri-1.2.2.orig/libpri.h libpri-1.2.2/libpri.h
+--- libpri-1.2.2.orig/libpri.h 2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.2/libpri.h 2006-01-18 12:28:07.000000000 +0100
@@ -26,8 +26,12 @@
#define _LIBPRI_H
@@ -328,6 +283,14 @@
/* Set CRV reference for GR-303 calls */
+@@ -525,7 +644,6 @@
+ #define PRI_USER_USER_TX
+ /* Set the user user field. Warning! don't send binary data accross this field */
+ extern void pri_sr_set_useruser(struct pri_sr *sr, char *userchars);
+-
+ extern void pri_call_set_useruser(q931_call *sr, char *userchars);
+
+ extern int pri_setup(struct pri *pri, q931_call *call, struct pri_sr *req);
@@ -546,8 +664,8 @@
/* Override message and error stuff */
@@ -339,9 +302,9 @@
/* Set overlap mode */
#define PRI_SET_OVERLAPDIAL
-diff -urN libpri-1.2.1.orig/pri.c libpri-1.2.1/pri.c
---- libpri-1.2.1.orig/pri.c 2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.1/pri.c 2005-11-25 17:09:30.000000000 +0100
+diff -urN libpri-1.2.2.orig/pri.c libpri-1.2.2/pri.c
+--- libpri-1.2.2.orig/pri.c 2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.2/pri.c 2006-01-18 12:28:07.000000000 +0100
@@ -48,6 +36,14 @@
return "Network";
case PRI_CPE:
@@ -567,7 +530,7 @@
/* normal clear cause */
cause = 16;
- return q931_hangup(pri, call, cause);
-+ if ((cause == 34 || cause == 44 || cause == 82 || cause == 1 || cause == 81) && (call->ourcallstate == Q931_CALL_STATE_ACTIVE)) {
++ if ((cause == 34 || cause == 44 || cause == 82 || cause == 1 || cause == 81 || cause == 17) && (call->ourcallstate == Q931_CALL_STATE_ACTIVE)) {
+ pri_error(pri, "Cause code %d not allowed when disconnecting an active call. Changing to cause 16.\n", cause);
+ cause = 16;
+ }
@@ -683,46 +646,9 @@
+ q921_reset(pri, pri->tei, 1);
+ }
+}
-diff -urN libpri-1.2.1.orig/pri_facility.c libpri-1.2.1/pri_facility.c
---- libpri-1.2.1.orig/pri_facility.c 2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.1/pri_facility.c 2005-11-20 15:58:10.000000000 +0100
-@@ -1,26 +1,13 @@
--/*
-- * libpri: An implementation of Primary Rate ISDN
-- *
-- * Written by Matthew Fredrickson <creslin at digium.com>
-- *
-- * Copyright (C) 2004-2005, Digium
-- * All Rights Reserved.
-- *
-- * This program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License as published by
-- * the Free Software Foundation; either version 2 of the License, or
-- * (at your option) any later version.
-- *
-- * This program is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- * GNU General Public License for more details.
-- *
-- * You should have received a copy of the GNU General Public License
-- * along with this program; if not, write to the Free Software
-- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-- *
-- */
-+/*
-+ This file and it's contents are licensed under the terms and conditions
-+ of the GNU Public License. See http://www.gnu.org for details.
-+
-+ Routines for dealing with facility messages and their respective
-+ components (ROSE)
-+
-+ by Matthew Fredrickson <creslin at digium.com>
-+ Copyright (C) 2004-2005 Digium, Inc
-+*/
-
- #include "compat.h"
- #include "libpri.h"
+diff -urN libpri-1.2.2.orig/pri_facility.c libpri-1.2.2/pri_facility.c
+--- libpri-1.2.2.orig/pri_facility.c 2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.2/pri_facility.c 2006-01-19 11:55:21.000000000 +0100
@@ -208,9 +195,9 @@
if (datalen > buflen) {
/* Truncate */
@@ -997,7 +923,7 @@
int operation_tag;
unsigned char *vdata = data;
struct rose_component *comp = NULL, *invokeid = NULL, *operationid = NULL;
-+// struct addressingdataelements_presentednumberunscreened value;
++ struct addressingdataelements_presentednumberunscreened value;
do {
/* Invoke ID stuff */
@@ -1035,7 +961,7 @@
case ROSE_AOC_NO_CHARGING_INFO_AVAILABLE:
if (pri->debug & PRI_DEBUG_APDU) {
pri_message(pri, "ROSE %i: AOC No Charging Info Available - not handled!", operation_tag);
-@@ -1229,6 +1259,32 @@
+@@ -1229,6 +1259,34 @@
dump_apdu (pri, (u_int8_t *)comp, comp->len + 2);
}
return -1;
@@ -1043,6 +969,8 @@
+ // if (pri->debug & PRI_DEBUG_APDU) {
+ pri_message(pri, "ROSE %i: CD - not handled!", operation_tag);
+ dump_apdu (pri, comp->data, comp->len);
++ rose_public_party_number_decode(pri, call, comp->data + 2 , comp->len - 2, &value);
++ pri_message(pri, "party address %s\n", value.partyaddress);
+ // }
+/* GET_COMPONENT(comp, i, vdata, len);
+ if (comp->type == ASN1_SEQUENCE | ASN1_CONSTRUCTOR | ASN1_TAG_0) {
@@ -1068,9 +996,9 @@
default:
if (pri->debug & PRI_DEBUG_APDU) {
pri_message(pri, "!! Unable to handle ROSE operation %d", operation_tag);
-diff -urN libpri-1.2.1.orig/pri_facility.h libpri-1.2.1/pri_facility.h
---- libpri-1.2.1.orig/pri_facility.h 2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.1/pri_facility.h 2005-07-26 12:16:40.000000000 +0200
+diff -urN libpri-1.2.2.orig/pri_facility.h libpri-1.2.2/pri_facility.h
+--- libpri-1.2.2.orig/pri_facility.h 2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.2/pri_facility.h 2006-01-19 11:51:18.000000000 +0100
@@ -34,7 +34,7 @@
/* Operation ID values */
/* Q.952 ROSE operations (Diverting) */
@@ -1090,7 +1018,7 @@
#define SS_MWI_DEACTIVATE 81
#define SS_MWI_INTERROGATE 82
-+#define ROSE_CALLDEFLECTION 0x0D
++#define ROSE_CALLDEFLECTION 0x0D
+#define ROSE_EXPLICIT_CALL_TRANSFER 0x06
+
/* ROSE definitions and data structures */
@@ -1116,9 +1044,9 @@
+extern int add_call_deflection_facility_ie(struct pri *pri, q931_call *c, char *destination);
+
#endif /* _PRI_FACILITY_H */
-diff -urN libpri-1.2.1.orig/pri_internal.h libpri-1.2.1/pri_internal.h
---- libpri-1.2.1.orig/pri_internal.h 2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.1/pri_internal.h 2006-01-04 13:13:12.000000000 +0100
+diff -urN libpri-1.2.2.orig/pri_internal.h libpri-1.2.2/pri_internal.h
+--- libpri-1.2.2.orig/pri_internal.h 2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.2/pri_internal.h 2006-01-18 12:28:07.000000000 +0100
@@ -30,7 +30,10 @@
struct pri_sched {
struct timeval when;
@@ -1243,8 +1171,11 @@
char *callername;
int callerpres;
char *called;
-@@ -169,6 +201,10 @@
+@@ -167,8 +199,13 @@
+
+ int alive; /* Whether or not the call is alive */
int acked; /* Whether setup has been acked or not */
++ int con_acked; /* Whether CONNECT has been CONNECT_ACKNOWLEDGEd or not */
int sendhangupack; /* Whether or not to send a hangup ack */
int proc; /* Whether we've sent a call proceeding / alerting */
+ int alert; /* Whether we've sent an alerting */
@@ -1254,7 +1185,7 @@
int ri; /* Restart Indicator (Restart Indicator IE) */
-@@ -202,15 +238,18 @@
+@@ -202,15 +239,18 @@
int callerplan;
int callerplanani;
int callerpres; /* Caller presentation */
@@ -1277,7 +1208,7 @@
int nonisdn;
char callednum[256]; /* Called Number */
int complete; /* no more digits coming */
-@@ -225,16 +264,27 @@
+@@ -225,16 +265,27 @@
char redirectingnum[256]; /* Number of redirecting party */
char redirectingname[256]; /* Name of redirecting party */
@@ -1308,7 +1239,7 @@
long aoc_units; /* Advice of Charge Units */
-@@ -242,6 +292,7 @@
+@@ -242,6 +293,7 @@
};
extern int pri_schedule_event(struct pri *pri, int ms, void (*function)(void *data), void *data);
@@ -1316,7 +1247,7 @@
extern pri_event *pri_schedule_run(struct pri *pri);
-@@ -250,7 +301,7 @@
+@@ -250,7 +302,7 @@
extern pri_event *pri_mkerror(struct pri *pri, char *errstr);
extern void pri_message(struct pri *pri, char *fmt, ...);
@@ -1325,9 +1256,9 @@
extern void pri_error(struct pri *pri, char *fmt, ...);
void libpri_copy_string(char *dst, const char *src, size_t size);
-diff -urN libpri-1.2.1.orig/pri_q921.h libpri-1.2.1/pri_q921.h
---- libpri-1.2.1.orig/pri_q921.h 2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.1/pri_q921.h 2005-06-13 09:02:39.000000000 +0200
+diff -urN libpri-1.2.2.orig/pri_q921.h libpri-1.2.2/pri_q921.h
+--- libpri-1.2.2.orig/pri_q921.h 2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.2/pri_q921.h 2006-01-18 12:28:07.000000000 +0100
@@ -47,6 +47,13 @@
#define Q921_FRAMETYPE_S 0x1
@@ -1360,9 +1291,9 @@
+extern int q921_transmit_iframe(struct pri *pri, void *buf, int len, int cr, int tei);
#endif
-diff -urN libpri-1.2.1.orig/pri_q931.h libpri-1.2.1/pri_q931.h
---- libpri-1.2.1.orig/pri_q931.h 2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.1/pri_q931.h 2005-06-13 09:02:39.000000000 +0200
+diff -urN libpri-1.2.2.orig/pri_q931.h libpri-1.2.2/pri_q931.h
+--- libpri-1.2.2.orig/pri_q931.h 2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.2/pri_q931.h 2006-01-18 12:28:07.000000000 +0100
@@ -190,6 +190,10 @@
#define Q931_IE_CODESET(x) ((x) >> 8)
#define Q931_IE_IE(x) ((x) & 0xff)
@@ -1438,35 +1369,9 @@
+//extern int q931_facility(struct pri *pri, q931_call *c, int operation, char *arguments);
+
#endif
-diff -urN libpri-1.2.1.orig/pri_timers.h libpri-1.2.1/pri_timers.h
---- libpri-1.2.1.orig/pri_timers.h 2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.1/pri_timers.h 2006-01-04 12:57:32.000000000 +0100
-@@ -27,17 +27,17 @@
-
- /* -1 means we dont currently support the timer/counter */
- #define PRI_TIMERS_DEFAULT { 3, /* N200 */ \
-- -1, /* N201 */ \
-- -1, /* N202 */ \
-+ 260, /* N201 */ \
-+ 3, /* N202 */ \
- 7, /* K */ \
- 1000, /* T200 */ \
-- -1, /* T201 */ \
-- -1, /* T202 */ \
-+ 2000, /* T201 */ \
-+ 5000, /* T202 */ \
- 10000, /* T203 */ \
- -1, /* T300 */ \
- -1, /* T301 */ \
- -1, /* T302 */ \
-- -1, /* T303 */ \
-+ 4000, /* T303 */ \
- -1, /* T304 */ \
- 30000, /* T305 */ \
- -1, /* T306 */ \
-diff -urN libpri-1.2.1.orig/prisched.c libpri-1.2.1/prisched.c
---- libpri-1.2.1.orig/prisched.c 2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.1/prisched.c 2005-06-13 09:02:39.000000000 +0200
+diff -urN libpri-1.2.2.orig/prisched.c libpri-1.2.2/prisched.c
+--- libpri-1.2.2.orig/prisched.c 2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.2/prisched.c 2006-01-18 12:28:07.000000000 +0100
@@ -22,10 +22,9 @@
*
*/
@@ -1588,9 +1493,9 @@
+ pri->pri_sched[id].callback2 = NULL;
}
+
-diff -urN libpri-1.2.1.orig/pritest.c libpri-1.2.1/pritest.c
---- libpri-1.2.1.orig/pritest.c 2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.1/pritest.c 2005-06-13 09:02:39.000000000 +0200
+diff -urN libpri-1.2.2.orig/pritest.c libpri-1.2.2/pritest.c
+--- libpri-1.2.2.orig/pritest.c 2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.2/pritest.c 2006-01-18 12:28:07.000000000 +0100
@@ -51,8 +51,8 @@
#define PRI_DEF_NODETYPE PRI_CPE
#define PRI_DEF_SWITCHTYPE PRI_SWITCH_NI2
@@ -1637,18 +1542,44 @@
default:
fprintf(stderr, "--!! Unknown PRI event %d\n", e->e);
}
-diff -urN libpri-1.2.1.orig/q921.c libpri-1.2.1/q921.c
---- libpri-1.2.1.orig/q921.c 2005-12-06 22:35:50.000000000 +0100
-+++ libpri-1.2.1/q921.c 2006-01-04 15:50:03.000000000 +0100
+diff -urN libpri-1.2.2.orig/pri_timers.h libpri-1.2.2/pri_timers.h
+--- libpri-1.2.2.orig/pri_timers.h 2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.2/pri_timers.h 2006-01-18 12:28:07.000000000 +0100
+@@ -27,17 +27,17 @@
+
+ /* -1 means we dont currently support the timer/counter */
+ #define PRI_TIMERS_DEFAULT { 3, /* N200 */ \
+- -1, /* N201 */ \
+- -1, /* N202 */ \
++ 260, /* N201 */ \
++ 3, /* N202 */ \
+ 7, /* K */ \
+ 1000, /* T200 */ \
+- -1, /* T201 */ \
+- -1, /* T202 */ \
++ 2000, /* T201 */ \
++ 5000, /* T202 */ \
+ 10000, /* T203 */ \
+ -1, /* T300 */ \
+ -1, /* T301 */ \
+ -1, /* T302 */ \
+- -1, /* T303 */ \
++ 4000, /* T303 */ \
+ -1, /* T304 */ \
+ 30000, /* T305 */ \
+ -1, /* T306 */ \
+diff -urN libpri-1.2.2.orig/q921.c libpri-1.2.2/q921.c
+--- libpri-1.2.2.orig/q921.c 2005-12-06 22:35:50.000000000 +0100
++++ libpri-1.2.2/q921.c 2006-01-18 12:28:07.000000000 +0100
@@ -1,10 +1,12 @@
/*
* libpri: An implementation of Primary Rate ISDN
*
- * Written by Mark Spencer <markster at digium.com>
-+ * Written by Mark Spencer <markster at linux-support.net>
++ * Written by Mark Spencer <markster at digium.com>
*
- * Copyright (C) 2001-2005, Digium
-+ * Copyright (C) 2001, Linux Support Services, Inc.
++ * Copyright (C) 2001-2005, Digium
* All Rights Reserved.
+ * Copyright (C) 2003,2004,2005 Junghanns.NET GmbH
+ * Klaus-Peter Junghanns <kpj at junghanns.net>
@@ -3559,24 +3490,33 @@
- /* Do the SABME XXX Maybe we should implement T_WAIT? XXX */
- q921_send_sabme(pri, now);
}
-diff -urN libpri-1.2.1.orig/q931.c libpri-1.2.1/q931.c
---- libpri-1.2.1.orig/q931.c 2005-12-01 03:34:44.000000000 +0100
-+++ libpri-1.2.1/q931.c 2005-12-21 14:23:13.000000000 +0100
+diff -urN libpri-1.2.2.orig/q931.c libpri-1.2.2/q931.c
+--- libpri-1.2.2.orig/q931.c 2006-01-17 14:43:18.000000000 +0100
++++ libpri-1.2.2/q931.c 2006-01-27 05:41:13.000000000 +0100
@@ -1,10 +1,12 @@
/*
* libpri: An implementation of Primary Rate ISDN
*
- * Written by Mark Spencer <markster at digium.com>
-+ * Written by Mark Spencer <markster at linux-support.net>
++ * Written by Mark Spencer <markster at digium.com>
*
- * Copyright (C) 2001-2005, Digium
-+ * Copyright (C) 2001, Linux Support Services, Inc.
++ * Copyright (C) 2001-2005, Digium
* All Rights Reserved.
+ * Copyright (C) 2003,2004,2005 Junghanns.NET GmbH
+ * Klaus-Peter Junghanns <kpj at junghanns.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
+@@ -21,7 +23,7 @@
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+-
++
+ #include "compat.h"
+ #include "libpri.h"
+ #include "pri_internal.h"
@@ -31,6 +33,7 @@
#include <unistd.h>
@@ -3600,7 +3540,15 @@
static char *ie2str(int ie);
static char *msg2str(int msg);
-@@ -253,6 +264,10 @@
+@@ -241,6 +252,7 @@
+ static void call_init(struct q931_call *c)
+ {
+ memset(c, 0, sizeof(*c));
++ c->con_acked = 0;
+ c->alive = 0;
+ c->sendhangupack = 0;
+ c->forceinvert = -1;
+@@ -253,6 +265,10 @@
c->next = NULL;
c->sentchannel = 0;
c->newcall = 1;
@@ -3611,7 +3559,7 @@
c->ourcallstate = Q931_CALL_STATE_NULL;
c->peercallstate = Q931_CALL_STATE_NULL;
}
-@@ -272,14 +287,17 @@
+@@ -272,14 +288,17 @@
{
int x;
int pos=0;
@@ -3635,7 +3583,7 @@
case 0:
call->justsignalling = 1;
break;
-@@ -288,6 +306,7 @@
+@@ -288,6 +307,7 @@
default:
pri_error(pri, "!! Unexpected Channel selection %d\n", ie->data[0] & 3);
return -1;
@@ -3643,7 +3591,7 @@
}
#endif
if (ie->data[0] & 0x08)
-@@ -349,10 +368,16 @@
+@@ -349,10 +369,16 @@
}
/* Start with standard stuff */
@@ -3662,7 +3610,7 @@
/* Add exclusive flag if necessary */
if (call->chanflags & FLAG_EXCLUSIVE)
ie->data[pos] |= 0x08;
-@@ -369,6 +394,7 @@
+@@ -369,6 +395,7 @@
} else
pos++;
if ((call->channelno > -1) || (call->slotmap != -1)) {
@@ -3670,7 +3618,7 @@
/* We'll have the octet 8.2 and 8.3's present */
ie->data[pos++] = 0x83;
if (call->channelno > -1) {
-@@ -384,11 +410,43 @@
+@@ -384,11 +411,43 @@
ie->data[pos++] = (call->slotmap & 0xff);
return pos + 2;
}
@@ -3715,7 +3663,7 @@
pri_error(pri, "!! No channel map, no channel, and no ds1? What am I supposed to identify?\n");
return -1;
}
-@@ -734,8 +792,12 @@
+@@ -734,8 +793,12 @@
return code2str(pres, press, sizeof(press) / sizeof(press[0]));
}
@@ -3729,7 +3677,7 @@
if (len > maxlen - 1) {
num[0] = 0;
return;
-@@ -746,50 +808,75 @@
+@@ -746,50 +809,75 @@
static FUNC_DUMP(dump_called_party_number)
{
@@ -3833,7 +3781,7 @@
int i = 0;
/* To follow Q.931 (4.5.1), we must search for start of octet 4 by
walking through all bytes until one with ext bit (8) set to 1 */
-@@ -810,13 +897,17 @@
+@@ -810,13 +898,17 @@
}
}
while(!(ie->data[i++]& 0x80));
@@ -3854,7 +3802,7 @@
int i = 0;
/* To follow Q.931 (4.5.1), we must search for start of octet 4 by
walking through all bytes until one with ext bit (8) set to 1 */
-@@ -833,8 +924,12 @@
+@@ -833,8 +925,12 @@
}
}
while(!(ie->data[i++]& 0x80));
@@ -3869,7 +3817,7 @@
}
-@@ -858,7 +953,7 @@
+@@ -858,7 +954,7 @@
}
}
while(!(ie->data[i++] & 0x80));
@@ -3878,7 +3826,7 @@
return 0;
}
-@@ -866,7 +961,7 @@
+@@ -866,7 +962,7 @@
{
if (order > 1)
return 0;
@@ -3887,7 +3835,7 @@
ie->data[0] = call->redirectingplan;
ie->data[1] = call->redirectingpres;
ie->data[2] = (call->redirectingreason & 0x0f) | 0x80;
-@@ -878,67 +973,90 @@
+@@ -878,67 +974,90 @@
static FUNC_DUMP(dump_redirecting_subaddr)
{
@@ -4016,7 +3964,7 @@
return 0;
}
-@@ -946,7 +1064,7 @@
+@@ -946,7 +1065,7 @@
{
ie->data[0] = call->callerplan;
ie->data[1] = 0x80 | call->callerpres;
@@ -4025,7 +3973,7 @@
memcpy(ie->data + 2, call->callernum, strlen(call->callernum));
return strlen(call->callernum) + 4;
}
-@@ -964,11 +1082,33 @@
+@@ -964,11 +1083,58 @@
static FUNC_RECV(receive_user_user)
{
call->useruserprotocoldisc = ie->data[0] & 0xff;
@@ -4058,10 +4006,35 @@
+ return strlen(call->callednum) + 3;
+}
+
++static FUNC_RECV(receive_high_layer_compat)
++{
++ return 0;
++}
++
++static FUNC_SEND(transmit_high_layer_compat)
++{
++ if (call->transcapability != PRI_TRANS_CAP_RESTRICTED_DIGITAL && call->transcapability != PRI_TRANS_CAP_DIGITAL && call->transcapability != PRI_TRANS_CAP_DIGITAL_W_TONES) {
++ ie->data[0] = 0x91;
++ ie->data[1] = 0x81;
++ return 4;
++ }
++ return 0;
++}
++
++static FUNC_DUMP(dump_high_layer_compat)
++{
++ int x;
++ pri_message(pri, "%c High-layer compatibilty (len=%2d) [ ", prefix, len);
++ for (x=0;x<ie->len;x++)
++ pri_message(pri, "0x%02X ", ie->data[x]);
++ pri_message(pri, " ]\n");
++}
++
++
static FUNC_SEND(transmit_user_user)
{
int datalen = strlen(call->useruserinfo);
-@@ -1050,22 +1190,41 @@
+@@ -1050,22 +1216,41 @@
data++;
len--;
}
@@ -4108,7 +4081,7 @@
}
return 0;
}
-@@ -1112,6 +1271,111 @@
+@@ -1112,6 +1297,111 @@
return 0;
}
@@ -4220,7 +4193,7 @@
static FUNC_SEND(transmit_facility)
{
struct apdu_event *tmp;
-@@ -1138,6 +1402,182 @@
+@@ -1138,6 +1428,182 @@
return i + 2;
}
@@ -4403,8 +4376,16 @@
static FUNC_RECV(receive_facility)
{
int i = 0;
-@@ -1366,39 +1806,60 @@
+@@ -1346,6 +1812,7 @@
+ pri_message(pri, " ]\n");
+ }
++
+ static FUNC_DUMP(dump_time_date)
+ {
+ pri_message(pri, "%c Time Date (len=%2d) [ ", prefix, len);
+@@ -1366,39 +1833,60 @@
+
static FUNC_DUMP(dump_keypad_facility)
{
- char tmp[64];
@@ -4471,7 +4452,7 @@
if (buf) {
x=y=0;
if ((x < ie->len) && (ie->data[x] & 0x80)) {
-@@ -1413,7 +1874,7 @@
+@@ -1413,7 +1901,7 @@
}
}
@@ -4480,7 +4461,7 @@
{
char tmp[1024] = "";
int x=0;
-@@ -1423,7 +1884,7 @@
+@@ -1423,7 +1911,7 @@
((*c >= 'a') && (*c <= 'z')) ||
((*c >= '0') && (*c <= '9'))) {
if (!lastascii) {
@@ -4489,7 +4470,7 @@
tmp[x++] = ',';
tmp[x++] = ' ';
}
-@@ -1435,7 +1896,7 @@
+@@ -1435,7 +1923,7 @@
if (lastascii) {
tmp[x++] = '\'';
}
@@ -4498,7 +4479,7 @@
tmp[x++] = ',';
tmp[x++] = ' ';
}
-@@ -1448,14 +1909,14 @@
+@@ -1448,14 +1936,14 @@
}
if (lastascii)
tmp[x++] = '\'';
@@ -4516,7 +4497,7 @@
}
static FUNC_DUMP(dump_network_spec_fac)
-@@ -1465,7 +1926,7 @@
+@@ -1465,7 +1953,7 @@
pri_message(pri, code2str(ie->data[1], facilities, sizeof(facilities) / sizeof(facilities[0])));
}
else
@@ -4525,7 +4506,16 @@
pri_message(pri, " ]\n");
}
-@@ -1942,11 +2403,11 @@
+@@ -1933,7 +2421,7 @@
+ { 0, Q931_TRANSIT_NET_SELECT, "Transit Network Selection" },
+ { 1, Q931_RESTART_INDICATOR, "Restart Indicator", dump_restart_indicator, receive_restart_indicator, transmit_restart_indicator },
+ { 0, Q931_LOW_LAYER_COMPAT, "Low-layer Compatibility" },
+- { 0, Q931_HIGH_LAYER_COMPAT, "High-layer Compatibility" },
++ { 1, Q931_HIGH_LAYER_COMPAT, "High-layer Compatibility" , dump_high_layer_compat, receive_high_layer_compat, transmit_high_layer_compat },
+ { 1, Q931_PACKET_SIZE, "Packet Size" },
+ { 1, Q931_IE_FACILITY, "Facility" , dump_facility, receive_facility, transmit_facility },
+ { 1, Q931_IE_REDIRECTION_NUMBER, "Redirection Number" },
+@@ -1942,11 +2430,11 @@
{ 1, Q931_IE_INFO_REQUEST, "Feature Request" },
{ 1, Q931_IE_FEATURE_IND, "Feature Indication" },
{ 1, Q931_IE_SEGMENTED_MSG, "Segmented Message" },
@@ -4539,7 +4529,7 @@
{ 1, Q931_IE_KEYPAD_FACILITY, "Keypad Facility", dump_keypad_facility, receive_keypad_facility },
{ 0, Q931_IE_SIGNAL, "Signal", dump_signal },
{ 1, Q931_IE_SWITCHHOOK, "Switch-hook" },
-@@ -1954,6 +2415,7 @@
+@@ -1954,6 +2442,7 @@
{ 1, Q931_IE_ESCAPE_FOR_EXT, "Escape for Extension" },
{ 1, Q931_IE_CALL_STATUS, "Call Status" },
{ 1, Q931_IE_CHANGE_STATUS, "Change Status" },
@@ -4547,7 +4537,7 @@
{ 1, Q931_IE_CONNECTED_ADDR, "Connected Number", dump_connected_number },
{ 1, Q931_IE_CONNECTED_NUM, "Connected Number", dump_connected_number },
{ 1, Q931_IE_ORIGINAL_CALLED_NUMBER, "Original Called Number", dump_redirecting_number, receive_redirecting_number, transmit_redirecting_number },
-@@ -2024,7 +2486,7 @@
+@@ -2024,7 +2513,7 @@
{
if ((ie->ie & 0x80) != 0)
return 1;
@@ -4556,7 +4546,7 @@
return 2 + ie->len;
}
-@@ -2054,10 +2516,10 @@
+@@ -2054,10 +2543,10 @@
break;
case 1:
cr = h->crv[0];
@@ -4569,7 +4559,7 @@
break;
default:
pri_error(NULL, "Call Reference Length not supported: %d\n", h->crlen);
-@@ -2071,14 +2533,14 @@
+@@ -2071,14 +2560,14 @@
int full_ie = Q931_FULL_IE(codeset, ie->ie);
int base_ie;
@@ -4589,7 +4579,7 @@
/* Special treatment for shifts */
if((full_ie & 0xf0) == Q931_LOCKING_SHIFT)
-@@ -2098,14 +2560,46 @@
+@@ -2098,14 +2587,46 @@
pri_error(pri, "!! %c Unknown IE %d (len = %d)\n", prefix, base_ie, ielen(ie));
}
@@ -4639,7 +4629,7 @@
prev = cur;
cur = cur->next;
}
-@@ -2118,6 +2612,7 @@
+@@ -2118,6 +2639,7 @@
/* Call reference */
cur->cr = cr;
cur->pri = pri;
@@ -4647,7 +4637,7 @@
/* Append to end of list */
if (prev)
prev->next = cur;
-@@ -2133,24 +2628,42 @@
+@@ -2133,24 +2655,42 @@
do {
cur = *pri->callpool;
pri->cref++;
@@ -4697,7 +4687,7 @@
if (prev)
prev->next = cur->next;
else
-@@ -2159,6 +2672,8 @@
+@@ -2159,6 +2699,8 @@
pri_message(pri, "NEW_HANGUP DEBUG: Destroying the call, ourstate %s, peerstate %s\n",callstate2str(cur->ourcallstate),callstate2str(cur->peercallstate));
if (cur->retranstimer)
pri_schedule_del(pri, cur->retranstimer);
@@ -4706,7 +4696,7 @@
pri_call_apdu_queue_cleanup(cur);
free(cur);
return;
-@@ -2169,16 +2684,16 @@
+@@ -2169,16 +2711,16 @@
pri_error(pri, "Can't destroy call %d!\n", cr);
}
@@ -4726,7 +4716,7 @@
return;
}
-@@ -2290,6 +2805,10 @@
+@@ -2290,6 +2832,10 @@
{
unsigned int x;
int full_ie = Q931_FULL_IE(codeset, ie->ie);
@@ -4737,7 +4727,7 @@
if (pri->debug & PRI_DEBUG_Q931_STATE)
pri_message(pri, "-- Processing IE %d (cs%d, %s)\n", ie->ie, codeset, ie2str(full_ie));
for (x=0;x<sizeof(ies) / sizeof(ies[0]);x++) {
-@@ -2307,21 +2826,36 @@
+@@ -2307,21 +2853,36 @@
return -1;
}
@@ -4779,7 +4769,7 @@
}
if (pri->subchannel) {
/* On GR-303, top bit is always 0 */
-@@ -2330,13 +2864,23 @@
+@@ -2330,13 +2891,23 @@
mh->f = 0;
*hb = h;
*mhb = mh;
@@ -4807,7 +4797,7 @@
/* The transmit operation might dump the q921 header, so logging the q931
message body after the transmit puts the sections of the message in the
right order in the log */
-@@ -2362,7 +2906,11 @@
+@@ -2362,7 +2933,11 @@
memset(buf, 0, sizeof(buf));
len = sizeof(buf);
@@ -4820,7 +4810,7 @@
mh->msg = msgtype;
x=0;
codeset = 0;
-@@ -2397,11 +2945,34 @@
+@@ -2397,11 +2972,34 @@
}
/* Invert the logic */
len = sizeof(buf) - len;
@@ -4856,7 +4846,7 @@
static int status_ies[] = { Q931_CAUSE, Q931_CALL_STATE, -1 };
static int q931_status(struct pri *pri, q931_call *c, int cause)
-@@ -2439,17 +3010,45 @@
+@@ -2439,17 +3037,45 @@
return send_message(pri, c, Q931_INFORMATION, information_ies);
}
@@ -4904,7 +4894,7 @@
int q931_facility(struct pri*pri, q931_call *c)
{
return send_message(pri, c, Q931_FACILITY, facility_ies);
-@@ -2463,7 +3062,6 @@
+@@ -2463,7 +3089,6 @@
if ((info > 0x2) || (info < 0x00))
return 0;
}
@@ -4912,7 +4902,7 @@
if (info >= 0)
c->notify = info & 0x7F;
else
-@@ -2506,6 +3104,8 @@
+@@ -2506,6 +3131,8 @@
int q931_call_proceeding(struct pri *pri, q931_call *c, int channel, int info)
{
@@ -4921,7 +4911,7 @@
if (channel) {
c->ds1no = (channel & 0xff00) >> 8;
c->ds1explicit = (channel & 0x10000) >> 16;
-@@ -2532,8 +3132,14 @@
+@@ -2532,8 +3159,14 @@
static int alerting_ies[] = { -1 };
#endif
@@ -4936,7 +4926,7 @@
if (!c->proc)
q931_call_proceeding(pri, c, channel, 0);
if (info) {
-@@ -2544,11 +3150,126 @@
+@@ -2544,11 +3177,127 @@
c->progressmask = 0;
c->ourcallstate = Q931_CALL_STATE_CALL_RECEIVED;
c->peercallstate = Q931_CALL_STATE_CALL_DELIVERED;
@@ -4953,9 +4943,8 @@
+ return send_message(pri, c, Q931_ALERTING, alerting_BRI_ies);
+ }
+ } */
- }
-
--static int connect_ies[] = { Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, -1 };
++}
++
+static int hold_acknowledge_ies[] = { -1 };
+
+int q931_hold_acknowledge(struct pri *pri, q931_call *c)
@@ -5003,6 +4992,7 @@
+ strncpy(c->callername,display,sizeof(c->callername));
+ res = send_message(pri, c, Q931_SUSPEND_ACKNOWLEDGE, suspend_acknowledge_ies);
+ strncpy(c->callername,tempcallername,sizeof(c->callername));
++ __q931_destroycall(pri, c);
+ return res;
+}
+
@@ -5056,15 +5046,16 @@
+ res = send_message(pri, c, Q931_RESUME_ACKNOWLEDGE, resume_acknowledge_ies);
+ strncpy(c->callername,tempcallername,sizeof(c->callername));
+ return res;
-+}
+ }
+
+-static int connect_ies[] = { Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, -1 };
+
-+
+static int connect_ies[] = { Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, Q931_DISPLAY, -1 };
+static int connect_NET_ies[] = { Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, Q931_IE_TIME_DATE, -1 };
int q931_setup_ack(struct pri *pri, q931_call *c, int channel, int nonisdn)
{
-@@ -2569,9 +3290,36 @@
+@@ -2569,9 +3318,36 @@
c->ourcallstate = Q931_CALL_STATE_OVERLAP_RECEIVING;
c->peercallstate = Q931_CALL_STATE_OVERLAP_SENDING;
c->alive = 1;
@@ -5101,11 +5092,38 @@
static void pri_connect_timeout(void *data)
{
struct q931_call *c = data;
-@@ -2647,7 +3395,12 @@
+@@ -2624,6 +3400,7 @@
+
+ int q931_connect(struct pri *pri, q931_call *c, int channel, int nonisdn)
+ {
++ int network = pri->localtype == PRI_NETWORK || pri->localtype == BRI_NETWORK || pri->localtype == BRI_NETWORK_PTMP;
+ if (channel) {
+ c->ds1no = (channel & 0xff00) >> 8;
+ c->ds1explicit = (channel & 0x10000) >> 16;
+@@ -2638,16 +3415,29 @@
+ c->progressmask = PRI_PROG_CALLED_NOT_ISDN;
+ } else
+ c->progressmask = 0;
+- c->ourcallstate = Q931_CALL_STATE_CONNECT_REQUEST;
++ if (network) {
++ /* WE decide when the call is up and active */
++ c->ourcallstate = Q931_CALL_STATE_ACTIVE;
++ } else {
++ c->ourcallstate = Q931_CALL_STATE_CONNECT_REQUEST;
++ }
+ c->peercallstate = Q931_CALL_STATE_ACTIVE;
+ c->alive = 1;
++ c->con_acked = 0;
+ /* Setup timer */
+ if (c->retranstimer)
+ pri_schedule_del(pri, c->retranstimer);
c->retranstimer = 0;
- if ((pri->localtype == PRI_CPE) && (!pri->subchannel))
+- if ((pri->localtype == PRI_CPE) && (!pri->subchannel))
++ if (!network && (!pri->subchannel)) {
++ /* make sure that CPEs get a CONNECT_ACKNOWLEDGE */
c->retranstimer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T313], pri_connect_timeout, c);
- return send_message(pri, c, Q931_CONNECT, connect_ies);
++ }
+ if ((pri->localtype != PRI_CPE) && (pri->localtype != BRI_CPE) && (pri->localtype != BRI_CPE_PTMP)) {
+ // networks may send datetime
+ return send_message(pri, c, Q931_CONNECT, connect_NET_ies);
@@ -5115,7 +5133,7 @@
}
static int release_ies[] = { Q931_CAUSE, Q931_IE_USER_USER, -1 };
-@@ -2681,7 +3434,7 @@
+@@ -2681,7 +3471,7 @@
int q931_restart(struct pri *pri, int channel)
{
struct q931_call *c;
@@ -5124,7 +5142,7 @@
if (!c)
return -1;
if (!channel)
-@@ -2718,6 +3471,9 @@
+@@ -2718,9 +3508,15 @@
return 0;
}
@@ -5134,7 +5152,13 @@
static int setup_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, Q931_IE_FACILITY, Q931_PROGRESS_INDICATOR, Q931_NETWORK_SPEC_FAC, Q931_DISPLAY, Q931_IE_USER_USER,
Q931_CALLING_PARTY_NUMBER, Q931_CALLED_PARTY_NUMBER, Q931_REDIRECTING_NUMBER, Q931_SENDING_COMPLETE, Q931_IE_ORIGINATING_LINE_INFO, Q931_IE_GENERIC_DIGITS, -1 };
-@@ -2728,7 +3484,12 @@
++static int setup_bri_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, Q931_IE_FACILITY, Q931_PROGRESS_INDICATOR, Q931_NETWORK_SPEC_FAC, Q931_DISPLAY, Q931_IE_USER_USER,
++ Q931_CALLING_PARTY_NUMBER, Q931_CALLED_PARTY_NUMBER, Q931_REDIRECTING_NUMBER, Q931_SENDING_COMPLETE, Q931_IE_ORIGINATING_LINE_INFO, Q931_IE_GENERIC_DIGITS, Q931_HIGH_LAYER_COMPAT, -1 };
++
+ static int gr303_setup_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, -1 };
+
+ static int cis_setup_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, Q931_IE_FACILITY, Q931_CALLED_PARTY_NUMBER, -1 };
+@@ -2728,7 +3524,12 @@
int q931_setup(struct pri *pri, q931_call *c, struct pri_sr *req)
{
int res;
@@ -5148,7 +5172,7 @@
c->transcapability = req->transmode;
c->transmoderate = TRANS_MODE_64_CIRCUIT;
-@@ -2754,12 +3515,12 @@
+@@ -2754,12 +3555,12 @@
else if (c->channelno)
c->chanflags = FLAG_PREFERRED;
if (req->caller) {
@@ -5164,7 +5188,7 @@
if ((pri->switchtype == PRI_SWITCH_DMS100) ||
(pri->switchtype == PRI_SWITCH_ATT4ESS)) {
/* Doesn't like certain presentation types */
-@@ -2768,13 +3529,13 @@
+@@ -2768,13 +3569,13 @@
}
c->callerpres = req->callerpres;
} else {
@@ -5181,7 +5205,7 @@
c->redirectingplan = req->redirectingplan;
if ((pri->switchtype == PRI_SWITCH_DMS100) ||
(pri->switchtype == PRI_SWITCH_ATT4ESS)) {
-@@ -2785,13 +3546,13 @@
+@@ -2785,13 +3586,13 @@
c->redirectingpres = req->redirectingpres;
c->redirectingreason = req->redirectingreason;
} else {
@@ -5197,8 +5221,12 @@
c->calledplan = req->calledplan;
} else
return -1;
-@@ -2812,12 +3573,17 @@
+@@ -2812,14 +3613,19 @@
+ res = send_message(pri, c, Q931_SETUP, gr303_setup_ies);
+ else if (c->justsignalling)
res = send_message(pri, c, Q931_SETUP, cis_setup_ies);
++ else if (pri->localtype == BRI_NETWORK || pri->localtype == BRI_NETWORK_PTMP)
++ res = send_message(pri, c, Q931_SETUP, setup_bri_ies);
else
res = send_message(pri, c, Q931_SETUP, setup_ies);
+
@@ -5208,14 +5236,12 @@
c->sendhangupack = 1;
c->ourcallstate = Q931_CALL_STATE_CALL_INITIATED;
c->peercallstate = Q931_CALL_STATE_OVERLAP_SENDING;
-+// if ((pri->localtype == BRI_NETWORK) || (pri->localtype == BRI_NETWORK_PTMP) || (pri->localtype == PRI_NETWORK)) {
-+ c->t303timer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T303], pri_setup_response_timeout, c);
-+ c->t303running = 1;
-+// }
++ c->t303timer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T303], pri_setup_response_timeout, c);
++ c->t303running = 1;
}
return res;
-@@ -2833,7 +3599,11 @@
+@@ -2835,7 +3641,11 @@
if (cause > -1) {
c->cause = cause;
c->causecode = CODE_CCITT;
@@ -5228,7 +5254,7 @@
/* release_ies has CAUSE in it */
res = send_message(pri, c, Q931_RELEASE_COMPLETE, release_ies);
} else
-@@ -2858,6 +3628,117 @@
+@@ -2860,6 +3670,117 @@
return 0;
}
@@ -5282,7 +5308,7 @@
+/* pri_error(pri, "returning PRI_EVENT_HANGUP_ACK\n");
+ res = Q931_RES_HAVEEVENT;
+ pri->ev.hangup.channel = c->channelno;
-+ pri->ev.e = PRI_EVENT_HANGUP_ACK; */
++ pri->ev.e = PRI_EVENT_HANGUP_ACK; */
+ }
+ return res;
+}
@@ -5346,7 +5372,16 @@
int q931_hangup(struct pri *pri, q931_call *c, int cause)
{
int disconnect = 1;
-@@ -2883,7 +3764,7 @@
+@@ -2871,7 +3792,7 @@
+ /* If mandatory IE was missing, insist upon that cause code */
+ if (c->cause == PRI_CAUSE_MANDATORY_IE_MISSING)
+ cause = c->cause;
+- if (cause == 34 || cause == 44 || cause == 82 || cause == 1 || cause == 81) {
++ if (cause == 34 || cause == 44 || cause == 82 || cause == 1 || cause == 81 || cause == 17) {
+ /* We'll send RELEASE_COMPLETE with these causes */
+ disconnect = 0;
+ release_compl = 1;
+@@ -2885,7 +3806,7 @@
case Q931_CALL_STATE_NULL:
if (c->peercallstate == Q931_CALL_STATE_NULL)
/* free the resources if we receive or send REL_COMPL */
@@ -5355,7 +5390,7 @@
else if (c->peercallstate == Q931_CALL_STATE_RELEASE_REQUEST)
q931_release_complete(pri,c,cause);
break;
-@@ -2909,6 +3790,11 @@
+@@ -2911,6 +3832,11 @@
/* received SETUP_ACKNOWLEDGE */
/* send DISCONNECT in general */
if (c->peercallstate != Q931_CALL_STATE_NULL && c->peercallstate != Q931_CALL_STATE_DISCONNECT_REQUEST && c->peercallstate != Q931_CALL_STATE_DISCONNECT_INDICATION && c->peercallstate != Q931_CALL_STATE_RELEASE_REQUEST && c->peercallstate != Q931_CALL_STATE_RESTART_REQUEST && c->peercallstate != Q931_CALL_STATE_RESTART) {
@@ -5367,7 +5402,7 @@
if (disconnect)
q931_disconnect(pri,c,cause);
else if (release_compl)
-@@ -2924,8 +3810,14 @@
+@@ -2926,8 +3852,14 @@
break;
case Q931_CALL_STATE_DISCONNECT_INDICATION:
/* received DISCONNECT */
@@ -5382,7 +5417,7 @@
q931_release(pri,c,cause);
}
break;
-@@ -2939,19 +3831,17 @@
+@@ -2941,19 +3873,17 @@
pri_error(pri, "q931_hangup shouldn't be called in this state, ourstate %s, peerstate %s\n",callstate2str(c->ourcallstate),callstate2str(c->peercallstate));
break;
default:
@@ -5405,7 +5440,15 @@
q931_call *c;
q931_ie *ie;
unsigned int x;
-@@ -2976,13 +3866,13 @@
+@@ -2965,6 +3895,7 @@
+ int codeset, cur_codeset;
+ int last_ie[8];
+ struct apdu_event *cur = NULL;
++ int network = pri->localtype == PRI_NETWORK || pri->localtype == BRI_NETWORK || pri->localtype == BRI_NETWORK_PTMP;
+
+ memset(last_ie, 0, sizeof(last_ie));
+ if (pri->debug & PRI_DEBUG_Q931_DUMP)
+@@ -2978,13 +3909,13 @@
KLUDGE this by changing byte 4 from a 0xf (SERVICE)
to a 0x7 (SERVICE ACKNOWLEDGE) */
h->raw[h->crlen + 2] -= 0x8;
@@ -5421,7 +5464,7 @@
if (!c) {
pri_error(pri, "Unable to locate call %d\n", q931_cr(h));
return -1;
-@@ -3000,11 +3890,12 @@
+@@ -3002,11 +3933,12 @@
c->ri = -1;
break;
case Q931_FACILITY:
@@ -5435,7 +5478,7 @@
c->channelno = -1;
c->slotmap = -1;
c->chanflags = 0;
-@@ -3020,33 +3911,49 @@
+@@ -3022,33 +3954,49 @@
c->calledplan = -1;
c->callerplan = -1;
c->callerpres = -1;
@@ -5503,7 +5546,7 @@
c->progress = -1;
c->progressmask = 0;
break;
-@@ -3061,16 +3968,21 @@
+@@ -3063,16 +4011,21 @@
c->causecode = -1;
c->causeloc = -1;
c->aoc_units = -1;
@@ -5528,7 +5571,7 @@
case Q931_STATUS:
c->cause = -1;
c->causecode = -1;
-@@ -3086,22 +3998,32 @@
+@@ -3089,22 +4042,32 @@
case Q931_STATUS_ENQUIRY:
break;
case Q931_SETUP_ACKNOWLEDGE:
@@ -5565,7 +5608,7 @@
case Q931_SUSPEND_ACKNOWLEDGE:
case Q931_SUSPEND_REJECT:
pri_error(pri, "!! Not yet handling pre-handle message type %s (%d)\n", msg2str(mh->msg), mh->msg);
-@@ -3110,7 +4032,7 @@
+@@ -3113,7 +4076,7 @@
pri_error(pri, "!! Don't know how to post-handle message type %s (%d)\n", msg2str(mh->msg), mh->msg);
q931_status(pri,c, PRI_CAUSE_MESSAGE_TYPE_NONEXIST);
if (c->newcall)
@@ -5574,7 +5617,7 @@
return -1;
}
memset(mandies, 0, sizeof(mandies));
-@@ -3190,12 +4112,20 @@
+@@ -3193,12 +4156,19 @@
missingmand = 0;
for (x=0;x<MAX_MAND_IES;x++) {
if (mandies[x]) {
@@ -5583,7 +5626,6 @@
- ((mh->msg != Q931_PROGRESS) || (mandies[x] != Q931_PROGRESS_INDICATOR))) {
- pri_error(pri, "XXX Missing handling for mandatory IE %d (cs%d, %s) XXX\n", Q931_IE_IE(mandies[x]), Q931_IE_CODESET(mandies[x]), ie2str(mandies[x]));
- missingmand++;
-+ int network = pri->localtype == PRI_NETWORK || pri->localtype == BRI_NETWORK || pri->localtype == BRI_NETWORK_PTMP;
+ /* check if there is no channel identification when we're configured as network -> that's not an error */
+ if (network) {
+ if (((mh->msg == Q931_SETUP) && (mandies[x] == Q931_CHANNEL_IDENT)) ||
@@ -5600,7 +5642,7 @@
}
}
-@@ -3204,7 +4134,7 @@
+@@ -3207,7 +4177,7 @@
case Q931_RESTART:
if (missingmand) {
q931_status(pri, c, PRI_CAUSE_MANDATORY_IE_MISSING);
@@ -5609,7 +5651,7 @@
break;
}
c->ourcallstate = Q931_CALL_STATE_RESTART;
-@@ -3222,6 +4152,7 @@
+@@ -3225,6 +4195,7 @@
}
/* Must be new call */
if (!c->newcall) {
@@ -5617,7 +5659,7 @@
break;
}
if (c->progressmask & PRI_PROG_CALLER_NOT_ISDN)
-@@ -3239,27 +4170,31 @@
+@@ -3242,27 +4213,31 @@
pri->ev.ring.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
pri->ev.ring.callingpres = c->callerpres;
pri->ev.ring.callingplan = c->callerplan;
@@ -5661,7 +5703,7 @@
pri->ev.ring.layer1 = c->userl1;
pri->ev.ring.complete = c->complete;
pri->ev.ring.ctype = c->transcapability;
-@@ -3272,6 +4207,9 @@
+@@ -3275,6 +4250,9 @@
q931_release_complete(pri,c,PRI_CAUSE_INVALID_CALL_REFERENCE);
break;
}
@@ -5671,7 +5713,7 @@
c->ourcallstate = Q931_CALL_STATE_CALL_DELIVERED;
c->peercallstate = Q931_CALL_STATE_CALL_RECEIVED;
pri->ev.e = PRI_EVENT_RINGING;
-@@ -3292,17 +4230,24 @@
+@@ -3295,17 +4273,24 @@
q931_status(pri, c, PRI_CAUSE_WRONG_MESSAGE);
break;
}
@@ -5696,7 +5738,7 @@
if (c->justsignalling) { /* Make sure WE release when we initiatie a signalling only connection */
q931_release(pri, c, PRI_CAUSE_NORMAL_CLEARING);
break;
-@@ -3310,23 +4255,43 @@
+@@ -3313,23 +4298,43 @@
return Q931_RES_HAVEEVENT;
case Q931_FACILITY:
if (c->newcall) {
@@ -5729,7 +5771,7 @@
+ case 0x06: /* ECT execute */
+ pri->ev.facility.operation = 0x06;
+ break;
-+ case 0x0D:
++ case 0x0D: /* CD */
+ pri->ev.facility.operation = 0x0D;
+ strncpy(pri->ev.facility.forwardnum, c->redirectingnum, sizeof(pri->ev.facility.forwardnum) - 1);
+ break;
@@ -5753,7 +5795,7 @@
break;
}
pri->ev.e = PRI_EVENT_PROGRESS;
-@@ -3344,6 +4309,11 @@
+@@ -3347,6 +4352,11 @@
q931_status(pri,c,PRI_CAUSE_WRONG_MESSAGE);
break;
}
@@ -5765,7 +5807,22 @@
pri->ev.proceeding.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
if (mh->msg == Q931_CALL_PROCEEDING) {
pri->ev.e = PRI_EVENT_PROCEEDING;
-@@ -3370,7 +4340,7 @@
+@@ -3364,16 +4374,21 @@
+ break;
+ }
+ if (c->ourcallstate != Q931_CALL_STATE_CONNECT_REQUEST) {
++ if ((c->ourcallstate == Q931_CALL_STATE_ACTIVE) && (c->con_acked == 0) && (network)) {
++ /* sending a CONNECT_ACKNOWLEDGE is optional for CPEs */
++ } else {
+ q931_status(pri,c,PRI_CAUSE_WRONG_MESSAGE);
+- break;
++ }
++ break;
+ }
+ c->ourcallstate = Q931_CALL_STATE_ACTIVE;
+ c->peercallstate = Q931_CALL_STATE_ACTIVE;
++ c->con_acked = 1;
+ break;
case Q931_STATUS:
if (missingmand) {
q931_status(pri, c, PRI_CAUSE_MANDATORY_IE_MISSING);
@@ -5774,14 +5831,14 @@
break;
}
if (c->newcall) {
-@@ -3407,31 +4377,67 @@
+@@ -3410,31 +4425,69 @@
if (res)
return res;
}
- break;
-+ if (c->ourcallstate != c->sugcallstate) {
-+ pri_error(pri, "updating callstate, ourcallstate %d to %d\n", c->ourcallstate, c->sugcallstate);
-+ c->ourcallstate = c->sugcallstate;
++ if (c->peercallstate != c->sugcallstate) {
++ pri_error(pri, "updating callstate, peercallstate %d to %d\n", c->peercallstate, c->sugcallstate);
++ c->peercallstate = c->sugcallstate;
+ if (c->sugcallstate != Q931_CALL_STATE_ACTIVE) {
+ /* pass hangup to upper layer! */
+ if (c->alive) {
@@ -5825,13 +5882,15 @@
- return res;
- else
- q931_hangup(pri,c,c->cause);
-+ if (c->cause != PRI_CAUSE_INCOMPATIBLE_DESTINATION) {
-+ if (c->t303timer) {
++ if (pri->localtype != BRI_NETWORK_PTMP) {
++ /* only stop the T303 timer if WE are not a BRI PTMP network */
++ if (c->t303timer) {
+ c->t303running = 0;
+ pri_schedule_del(pri, c->t303timer);
-+ }
-+ c->t303timer = 0;
-+ }
++ c->t303timer = 0;
++ }
++ }
++
+ if ((pri->localtype != BRI_NETWORK_PTMP) || (c->tei == tei)) {
+ c->ourcallstate = Q931_CALL_STATE_NULL;
+ c->peercallstate = Q931_CALL_STATE_NULL;
@@ -5866,7 +5925,7 @@
break;
case Q931_RELEASE:
if (missingmand) {
-@@ -3447,6 +4453,7 @@
+@@ -3450,6 +4503,7 @@
pri->ev.e = PRI_EVENT_HANGUP;
pri->ev.hangup.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
pri->ev.hangup.cref = c->cr;
@@ -5874,7 +5933,7 @@
pri->ev.hangup.cause = c->cause;
pri->ev.hangup.call = c;
pri->ev.hangup.aoc_units = c->aoc_units;
-@@ -3475,8 +4482,14 @@
+@@ -3478,8 +4532,14 @@
pri->ev.e = PRI_EVENT_HANGUP_REQ;
pri->ev.hangup.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
pri->ev.hangup.cref = c->cr;
@@ -5889,7 +5948,7 @@
pri->ev.hangup.aoc_units = c->aoc_units;
if (c->alive)
return Q931_RES_HAVEEVENT;
-@@ -3502,14 +4515,14 @@
+@@ -3505,14 +4565,14 @@
pri->ev.e = PRI_EVENT_KEYPAD_DIGIT;
pri->ev.digit.call = c;
pri->ev.digit.channel = c->channelno | (c->ds1no << 8);
@@ -5907,7 +5966,7 @@
pri->ev.ring.complete = c->complete; /* this covers IE 33 (Sending Complete) */
return Q931_RES_HAVEEVENT;
case Q931_STATUS_ENQUIRY:
-@@ -3527,7 +4540,7 @@
+@@ -3530,7 +4590,7 @@
c->peercallstate = Q931_CALL_STATE_OVERLAP_RECEIVING;
pri->ev.e = PRI_EVENT_SETUP_ACK;
pri->ev.setup_ack.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
@@ -5916,7 +5975,7 @@
cur = c->apdus;
while (cur) {
if (!cur->sent && cur->message == Q931_FACILITY) {
-@@ -3543,19 +4556,53 @@
+@@ -3546,19 +4606,53 @@
pri->ev.notify.channel = c->channelno;
pri->ev.notify.info = c->notify;
return Q931_RES_HAVEEVENT;
@@ -5974,7 +6033,7 @@
case Q931_SUSPEND_ACKNOWLEDGE:
case Q931_SUSPEND_REJECT:
pri_error(pri, "!! Not yet handling post-handle message type %s (%d)\n", msg2str(mh->msg), mh->msg);
-@@ -3565,7 +4612,7 @@
+@@ -3568,7 +4662,7 @@
pri_error(pri, "!! Don't know how to post-handle message type %s (%d)\n", msg2str(mh->msg), mh->msg);
q931_status(pri,c, PRI_CAUSE_MESSAGE_TYPE_NONEXIST);
if (c->newcall)
@@ -5983,3 +6042,53 @@
return -1;
}
return 0;
+diff -urN libpri-1.2.2.orig/README libpri-1.2.2/README
+--- libpri-1.2.2.orig/README 2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.2/README 2006-01-18 12:28:07.000000000 +0100
+@@ -1,6 +1,7 @@
+-libpri: An implementation of Primate Rate ISDN
+-
+-Written by Mark Spencer <markster at digium.com>
++libpri: An implementation of Primate Rate ISDN (and BRI ISDN)
++
++Written by Mark Spencer <markster at digium.com>
++Modified for BRI support by Klaus-Peter Junghanns <kpj at junghanns.net>
+
+ What is libpri?
+ ===============
+@@ -9,6 +10,7 @@
+ based on the Bellcore specification SR-NWT-002343 for National ISDN. As of
+ May 12, 2001, it has been tested work with NI-2, Nortel DMS-100, and
+ Lucent 5E Custom protocols on switches from Nortel and Lucent.
++The BRI and euroISDN modifications are based on ETS 300 102-1.
+
+ What is the license for libpri?
+ ===============================
+@@ -22,9 +24,8 @@
+ or the GPL of libpri.
+
+ If you wish to use libpri in an application for which the GPL is not
+-appropriate (e.g. a proprietary embedded system), licenses for libpri
+-under more flexible terms can be readily obtained through Digium, Inc.
+-at reasonable cost.
++appropriate (e.g. a proprietary embedded system), then you have to use
++a non-standard compliant version without BRI support.
+
+
+ How do I report bugs or contribute?
+diff -urN libpri-1.2.2.orig/TODO libpri-1.2.2/TODO
+--- libpri-1.2.2.orig/TODO 2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.2/TODO 2006-01-18 12:28:07.000000000 +0100
+@@ -2,9 +2,7 @@
+ -- D-Channel Backup
+ -- Test against 4e
+
+-Q.921:
+--- Support unnumbered information frames
+-
+ Q.931:
+--- Locking Shift IE
+--- Implement the 11 missing Q.931 timers
++-- Locking Shift IE (you did that already, didnt you??)
++-- Implement the 10 missing Q.931 timers
++-- more facilities
Modified: libpri/trunk/debian/patches/libname.dpatch
===================================================================
--- libpri/trunk/debian/patches/libname.dpatch 2006-02-07 20:02:41 UTC (rev 1249)
+++ libpri/trunk/debian/patches/libname.dpatch 2006-02-07 22:40:51 UTC (rev 1250)
@@ -8,9 +8,9 @@
## DP: libpri-$(LIB_SUF).so.1
@DPATCH@
-diff -urNad libpri-1.2.2~/Makefile libpri-1.2.2/Makefile
---- libpri-1.2.2~/Makefile 2006-01-29 16:00:46.000000000 +0000
-+++ libpri-1.2.2/Makefile 2006-01-29 16:03:50.000000000 +0000
+diff -urNad libpri-1.2.2/Makefile /tmp/dpep.LmhuOM/libpri-1.2.2/Makefile
+--- libpri-1.2.2/Makefile 2006-01-19 00:23:40.000000000 +0200
++++ /tmp/dpep.LmhuOM/libpri-1.2.2/Makefile 2006-01-19 00:26:14.000000000 +0200
@@ -32,16 +32,22 @@
OSARCH=$(shell uname -s)
PROC?=$(shell uname -m)
@@ -33,7 +33,7 @@
INSTALL_BASE=/usr
-SOFLAGS = -Wl,-hlibpri.so.1.0
+INCLUDE_DIR=$(INSTALL_PREFIX)$(INSTALL_BASE)/include/$(LIB_SUF)
-+SOFLAGS = -Wl,-hlib$(LIBNAME).so.1
++SOFLAGS = -Wl,-hlib$(LIBNAME).so.1.0
LDCONFIG = /sbin/ldconfig
ifeq (${OSARCH},Linux)
LDCONFIG_FLAGS=-n
@@ -58,14 +58,14 @@
install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then restorecon -v $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/$(DYNAMIC_LIBRARY); fi
- ( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1.0 libpri.so ; ln -sf libpri.so.1.0 libpri.so.1 )
-+ ( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf lib$(LIBNAME).so.1 lib$(LIBNAME).so )
++ ( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf lib$(LIBNAME).so.1.0 lib$(LIBNAME).so ; ln -sf lib$(LIBNAME).so.1.0 lib$(LIBNAME).so.1 )
install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
if test $$(id -u) = 0; then $(LDCONFIG) $(LDCONFIG_FLAGS); fi
else
install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include -m 644 libpri.h
install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 755 $(DYNAMIC_LIBRARY)
- ( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1.0 libpri.so ; $(SOSLINK) )
-+ ( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf lib$(LIBNAME).so.1 lib$(LIBNAME).so ; $(SOSLINK) )
++ ( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf lib$(LIBNAME).so.1.0 lib$(LIBNAME).so ; $(SOSLINK) )
install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 644 $(STATIC_LIBRARY)
endif
@@ -84,12 +84,3 @@
pritest: pritest.o
$(CC) -o pritest pritest.o -L. -lpri -lzap $(CFLAGS)
-@@ -131,7 +137,7 @@
- $(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
- $(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
- $(LDCONFIG) $(LDCONFIG_FLAGS) .
-- ln -sf libpri.so.1.0 libpri.so
-+ ln -sf lib$(LIBNAME).so.1 lib$(LIBNAME).so
- ln -sf libpri.so.1.0 libpri.so.1
- $(SOSLINK)
-
Modified: libpri/trunk/debian/rules
===================================================================
--- libpri/trunk/debian/rules 2006-02-07 20:02:41 UTC (rev 1249)
+++ libpri/trunk/debian/rules 2006-02-07 22:40:51 UTC (rev 1250)
@@ -99,9 +99,10 @@
dh_installdocs
dh_installexamples
dh_installman
- ln -s libpri.so.1.0 debian/libpri1.2/usr/lib/libpri.so.1
+ # Those symlinks exis but not due to a proper ldconfig invocation:
+ #ln -s libpri.so.1.0 debian/libpri1.2/usr/lib/libpri.so.1
ifeq ($(USE_BRISTUFF),1)
- ln -s libpri-bristuffed.so.1.0 debian/libpri1.2/usr/lib/libpri-bristuffed.so.1
+ #ln -s libpri-bristuffed.so.1.0 debian/libpri1.2/usr/lib/libpri-bristuffed.so.1
endif
dh_strip
dh_compress
More information about the Pkg-voip-commits
mailing list