[Pkg-voip-commits] r2626 - in libpri/trunk/debian: . patches

Mark Purcell msp at costa.debian.org
Tue Oct 24 21:22:22 UTC 2006


Author: msp
Date: 2006-10-24 21:22:22 +0000 (Tue, 24 Oct 2006)
New Revision: 2626

Modified:
   libpri/trunk/debian/changelog
   libpri/trunk/debian/patches/bristuff.dpatch
Log:
* New upstream release.
* bristuff-0.3.0-PRE-1v

Modified: libpri/trunk/debian/changelog
===================================================================
--- libpri/trunk/debian/changelog	2006-10-24 07:26:17 UTC (rev 2625)
+++ libpri/trunk/debian/changelog	2006-10-24 21:22:22 UTC (rev 2626)
@@ -1,13 +1,10 @@
-libpri (1.2.4-1) UNRELEASED; urgency=low
+libpri (1.2.4-1) unstable; urgency=low
 
-  * NOT RELEASED YET
-  * New upstream version.
+  * New upstream release.
+  * bristuff-0.3.0-PRE-1v
 
-  [ Tzafrir Cohen ]
-  * bristuff 0.3.0-PRE-1s
+ -- Mark Purcell <msp at debian.org>  Tue, 24 Oct 2006 22:21:29 +0100
 
- -- Kilian Krause <kilian at debian.org>  Tue, 24 Oct 2006 08:35:14 +0200
-
 libpri (1.2.3-1) unstable; urgency=low
 
   * New upstream release.

Modified: libpri/trunk/debian/patches/bristuff.dpatch
===================================================================
--- libpri/trunk/debian/patches/bristuff.dpatch	2006-10-24 07:26:17 UTC (rev 2625)
+++ libpri/trunk/debian/patches/bristuff.dpatch	2006-10-24 21:22:22 UTC (rev 2626)
@@ -2,66 +2,17 @@
 ## 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-1q
+## DP: The libpri part of bristuff, version bristuff-0.3.0-PRE-1v
+## DP: http://www.junghanns.net/en/download.html
 ## DP:
 ## DP: newer versions: replace the contets of the patch file literally.
 ## DP: The remove Makefile and the strange changes this libpri.patch makes to 
 ## DP: copyright statements.
 
 @DPATCH@
-diff -urN libpri-1.2.3.orig/README libpri-1.2.3/README
---- libpri-1.2.3.orig/README	2006-02-15 18:59:38.000000000 +0100
-+++ libpri-1.2.3/README	2006-01-18 12:28:07.000000000 +0100
-@@ -1,6 +1,7 @@
--libpri: An implementation of Primary 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.3.orig/TODO libpri-1.2.3/TODO
---- libpri-1.2.3.orig/TODO	2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.3/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
-diff -urN libpri-1.2.3.orig/libpri.h libpri-1.2.3/libpri.h
---- libpri-1.2.3.orig/libpri.h	2006-04-27 18:08:39.000000000 +0200
-+++ libpri-1.2.3/libpri.h	2006-07-11 11:34:59.000000000 +0200
+diff -urN libpri-1.2.4.orig/libpri.h libpri-1.2.4/libpri.h
+--- libpri-1.2.4.orig/libpri.h	2006-04-27 18:08:39.000000000 +0200
++++ libpri-1.2.4/libpri.h	2006-07-11 11:34:59.000000000 +0200
 @@ -5,6 +5,8 @@
   *
   * Copyright (C) 2001, Linux Support Services, Inc.
@@ -391,9 +342,35 @@
  
  /* Set overlap mode */
  #define PRI_SET_OVERLAPDIAL
-diff -urN libpri-1.2.3.orig/pri.c libpri-1.2.3/pri.c
---- libpri-1.2.3.orig/pri.c	2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.3/pri.c	2006-07-11 12:39:20.000000000 +0200
+diff -urN libpri-1.2.4.orig/Makefile libpri-1.2.4/Makefile
+--- libpri-1.2.4.orig/Makefile	2006-04-30 17:17:47.000000000 +0200
++++ libpri-1.2.4/Makefile	2006-07-27 17:45:09.000000000 +0200
+@@ -27,6 +27,13 @@
+ # Uncomment if you want libpri to count number of Q921/Q931 sent/received
+ #LIBPRI_COUNTERS=-DLIBPRI_COUNTERS
+ 
++# Uncomment if you want libpri to always keep layer 2 up
++#LAYER2ALWAYSUP=-DLAYER2ALWAYSUP
++
++# Uncomment if you want libpri to hangup a call to an NT (p2mp) port if one
++# device sends a RELEASE COMPLETE with cause 17
++#FASTBUSYONBUSY=-DFASTBUSYONBUSY
++
+ CC=gcc
+ 
+ OSARCH=$(shell uname -s)
+@@ -38,7 +45,7 @@
+ DYNAMIC_LIBRARY=libpri.so.1.0
+ STATIC_OBJS=copy_string.o pri.o q921.o prisched.o q931.o pri_facility.o
+ DYNAMIC_OBJS=copy_string.lo pri.lo q921.lo prisched.lo q931.lo pri_facility.lo
+-CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS)
++CFLAGS=-Wall -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS) $(LAYER2ALWAYSUP) $(FASTBUSYONBUSY) -DRELAX_TRB
+ INSTALL_PREFIX=$(DESTDIR)
+ INSTALL_BASE=/usr
+ SOFLAGS = -Wl,-hlibpri.so.1.0
+diff -urN libpri-1.2.4.orig/pri.c libpri-1.2.4/pri.c
+--- libpri-1.2.4.orig/pri.c	2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.4/pri.c	2006-07-11 12:39:20.000000000 +0200
 @@ -1,24 +1,14 @@
  /*
   * libpri: An implementation of Primary Rate ISDN
@@ -745,6 +722,14 @@
  	len += sprintf(buf + len, "Overlap Dial: %d\n", pri->overlapdial);
  	len += sprintf(buf + len, "T200 Timer: %d\n", pri->timers[PRI_TIMER_T200]);
  	len += sprintf(buf + len, "T203 Timer: %d\n", pri->timers[PRI_TIMER_T203]);
+@@ -778,6 +904,7 @@
+ 	len += sprintf(buf + len, "T313 Timer: %d\n", pri->timers[PRI_TIMER_T313]);
+ 	len += sprintf(buf + len, "N200 Counter: %d\n", pri->timers[PRI_TIMER_N200]);
+ 
++
+ 	return strdup(buf);
+ }
+ 
 @@ -819,10 +946,11 @@
  	return 0;
  }
@@ -773,9 +758,24 @@
 +#endif
 +#endif
 +}
-diff -urN libpri-1.2.3.orig/pri_facility.c libpri-1.2.3/pri_facility.c
---- libpri-1.2.3.orig/pri_facility.c	2006-02-14 00:06:02.000000000 +0100
-+++ libpri-1.2.3/pri_facility.c	2006-06-06 14:26:01.000000000 +0200
+diff -urN libpri-1.2.4.orig/pridump.c libpri-1.2.4/pridump.c
+--- libpri-1.2.4.orig/pridump.c	2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.4/pridump.c	2006-01-18 12:28:07.000000000 +0100
+@@ -1,9 +1,9 @@
+ /*
+  * libpri: An implementation of Primary Rate ISDN
+  *
+- * Written by Mark Spencer <markster at digium.com>
++ * Written by Mark Spencer <markster at linux-support.net>
+  *
+- * Copyright (C) 2001-2005, Digium
++ * Copyright (C) 2001, Linux Support Services, Inc.
+  * All Rights Reserved.
+  *
+  * This program is free software; you can redistribute it and/or modify
+diff -urN libpri-1.2.4.orig/pri_facility.c libpri-1.2.4/pri_facility.c
+--- libpri-1.2.4.orig/pri_facility.c	2006-02-14 00:06:02.000000000 +0100
++++ libpri-1.2.4/pri_facility.c	2006-06-06 14:26:01.000000000 +0200
 @@ -1,26 +1,17 @@
 -/*
 - * libpri: An implementation of Primary Rate ISDN
@@ -1242,9 +1242,9 @@
  		default:
  			if (pri->debug & PRI_DEBUG_APDU) {
  				pri_message(pri, "!! Unable to handle ROSE operation %d", operation_tag);
-diff -urN libpri-1.2.3.orig/pri_facility.h libpri-1.2.3/pri_facility.h
---- libpri-1.2.3.orig/pri_facility.h	2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.3/pri_facility.h	2006-04-15 21:35:05.000000000 +0200
+diff -urN libpri-1.2.4.orig/pri_facility.h libpri-1.2.4/pri_facility.h
+--- libpri-1.2.4.orig/pri_facility.h	2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.4/pri_facility.h	2006-04-15 21:35:05.000000000 +0200
 @@ -34,7 +34,7 @@
  /* Operation ID values */
  /* Q.952 ROSE operations (Diverting) */
@@ -1293,9 +1293,9 @@
 +extern int aoc_aoce_charging_unit_encode(struct pri *pri, q931_call *c, long chargedunits, int send_facility_message);
 +
  #endif /* _PRI_FACILITY_H */
-diff -urN libpri-1.2.3.orig/pri_internal.h libpri-1.2.3/pri_internal.h
---- libpri-1.2.3.orig/pri_internal.h	2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.3/pri_internal.h	2006-04-15 21:57:19.000000000 +0200
+diff -urN libpri-1.2.4.orig/pri_internal.h libpri-1.2.4/pri_internal.h
+--- libpri-1.2.4.orig/pri_internal.h	2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.4/pri_internal.h	2006-04-15 21:57:19.000000000 +0200
 @@ -5,6 +5,8 @@
   *
   * Copyright (C) 2001, Linux Support Services, Inc.
@@ -1514,9 +1514,18 @@
  
  extern pri_event *pri_schedule_run(struct pri *pri);
  
-diff -urN libpri-1.2.3.orig/pri_q921.h libpri-1.2.3/pri_q921.h
---- libpri-1.2.3.orig/pri_q921.h	2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.3/pri_q921.h	2006-04-15 21:57:24.000000000 +0200
+@@ -250,7 +306,7 @@
+ extern pri_event *pri_mkerror(struct pri *pri, char *errstr);
+ 
+ extern void pri_message(struct pri *pri, char *fmt, ...);
+-
++  
+ 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.4.orig/pri_q921.h libpri-1.2.4/pri_q921.h
+--- libpri-1.2.4.orig/pri_q921.h	2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.4/pri_q921.h	2006-04-15 21:57:24.000000000 +0200
 @@ -5,6 +5,8 @@
   *
   * Copyright (C) 2001, Linux Support Services, Inc.
@@ -1558,9 +1567,9 @@
 +extern int q921_transmit_iframe(struct pri *pri, void *buf, int len, int cr, int tei);
  
  #endif
-diff -urN libpri-1.2.3.orig/pri_q931.h libpri-1.2.3/pri_q931.h
---- libpri-1.2.3.orig/pri_q931.h	2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.3/pri_q931.h	2006-04-15 21:57:29.000000000 +0200
+diff -urN libpri-1.2.4.orig/pri_q931.h libpri-1.2.4/pri_q931.h
+--- libpri-1.2.4.orig/pri_q931.h	2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.4/pri_q931.h	2006-04-15 21:57:29.000000000 +0200
 @@ -5,6 +5,8 @@
   *
   * Copyright (C) 2001, Linux Support Services, Inc.
@@ -1645,38 +1654,18 @@
 +//extern int q931_facility(struct pri *pri, q931_call *c, int operation, char *arguments);
 +
  #endif
-diff -urN libpri-1.2.3.orig/pri_timers.h libpri-1.2.3/pri_timers.h
---- libpri-1.2.3.orig/pri_timers.h	2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.3/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.3.orig/prisched.c libpri-1.2.3/prisched.c
---- libpri-1.2.3.orig/prisched.c	2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.3/prisched.c	2006-04-15 21:57:42.000000000 +0200
-@@ -5,6 +5,8 @@
+diff -urN libpri-1.2.4.orig/prisched.c libpri-1.2.4/prisched.c
+--- libpri-1.2.4.orig/prisched.c	2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.4/prisched.c	2006-04-15 21:57:42.000000000 +0200
+@@ -1,10 +1,12 @@
+ /*
+  * libpri: An implementation of Primary Rate ISDN
   *
-  * Copyright (C) 2001-2005, Digium
+- * Written by Mark Spencer <markster at digium.com>
++ * Written by Mark Spencer <markster at linux-support.net>
+  *
+- * Copyright (C) 2001-2005, Digium
++ * Copyright (C) 2001, Linux Support Services, Inc.
   * All Rights Reserved.
 + * Copyright (C) 2003-2006 Junghanns.NET GmbH
 + * Klaus-Peter Junghanns <kpj at junghanns.net>
@@ -1804,9 +1793,21 @@
 +	pri->pri_sched[id].callback2 = NULL;
  }
 +
-diff -urN libpri-1.2.3.orig/pritest.c libpri-1.2.3/pritest.c
---- libpri-1.2.3.orig/pritest.c	2005-11-29 19:39:18.000000000 +0100
-+++ libpri-1.2.3/pritest.c	2006-01-18 12:28:07.000000000 +0100
+diff -urN libpri-1.2.4.orig/pritest.c libpri-1.2.4/pritest.c
+--- libpri-1.2.4.orig/pritest.c	2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.4/pritest.c	2006-01-18 12:28:07.000000000 +0100
+@@ -1,9 +1,9 @@
+ /*
+  * libpri: An implementation of Primary Rate ISDN
+  *
+- * Written by Mark Spencer <markster at digium.com>
++ * Written by Mark Spencer <markster at linux-support.net>
+  *
+- * Copyright (C) 2001-2005, Digium
++ * Copyright (C) 2001, Linux Support Services, Inc.
+  * All Rights Reserved.
+  *
+  * This program is free software; you can redistribute it and/or modify
 @@ -51,8 +51,8 @@
  #define PRI_DEF_NODETYPE	PRI_CPE
  #define PRI_DEF_SWITCHTYPE	PRI_SWITCH_NI2
@@ -1853,18 +1854,59 @@
  	default:
  		fprintf(stderr, "--!! Unknown PRI event %d\n", e->e);
  	}
-diff -urN libpri-1.2.3.orig/q921.c libpri-1.2.3/q921.c
---- libpri-1.2.3.orig/q921.c	2005-12-06 22:35:50.000000000 +0100
-+++ libpri-1.2.3/q921.c	2006-08-01 09:55:53.000000000 +0200
-@@ -5,6 +5,8 @@
+diff -urN libpri-1.2.4.orig/pri_timers.h libpri-1.2.4/pri_timers.h
+--- libpri-1.2.4.orig/pri_timers.h	2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.4/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.4.orig/q921.c libpri-1.2.4/q921.c
+--- libpri-1.2.4.orig/q921.c	2005-12-06 22:35:50.000000000 +0100
++++ libpri-1.2.4/q921.c	2006-08-01 09:55:53.000000000 +0200
+@@ -1,10 +1,12 @@
+ /*
+  * libpri: An implementation of Primary Rate ISDN
   *
-  * Copyright (C) 2001-2005, Digium
+- * Written by Mark Spencer <markster at digium.com>
++ * Written by Mark Spencer <markster at linux-support.net>
+  *
+- * Copyright (C) 2001-2005, Digium
++ * Copyright (C) 2001, Linux Support Services, Inc.
   * All Rights Reserved.
 + * Copyright (C) 2003-2006 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 <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
 @@ -50,19 +52,24 @@
  	(hf).h.tei = (pri)->tei; \
  } while(0)
@@ -3792,18 +3834,33 @@
 -	/* Do the SABME XXX Maybe we should implement T_WAIT? XXX */
 -	q921_send_sabme(pri, now);
  }
-diff -urN libpri-1.2.3.orig/q931.c libpri-1.2.3/q931.c
---- libpri-1.2.3.orig/q931.c	2006-04-27 18:08:39.000000000 +0200
-+++ libpri-1.2.3/q931.c	2006-08-01 10:55:05.000000000 +0200
-@@ -5,6 +5,8 @@
+diff -urN libpri-1.2.4.orig/q931.c libpri-1.2.4/q931.c
+--- libpri-1.2.4.orig/q931.c	2006-07-28 16:44:15.000000000 +0200
++++ libpri-1.2.4/q931.c	2006-10-19 11:08:07.000000000 +0200
+@@ -1,10 +1,12 @@
+ /*
+  * libpri: An implementation of Primary Rate ISDN
   *
-  * Copyright (C) 2001-2005, Digium
+- * Written by Mark Spencer <markster at digium.com>
++ * Written by Mark Spencer <markster at linux-support.net>
+  *
+- * Copyright (C) 2001-2005, Digium
++ * Copyright (C) 2001, Linux Support Services, Inc.
   * All Rights Reserved.
 + * Copyright (C) 2003-2006 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>
@@ -4769,7 +4826,7 @@
  {
  	int x, y;
  	char *buf = malloc(len + 1);
--	char tmp[80];
+-	char tmp[80] = "";
 +	char tmp[80]="";
  	if (buf) {
  		x=y=0;
@@ -4883,27 +4940,7 @@
  			break;
  		default:
  			pri_error(NULL, "Call Reference Length not supported: %d\n", h->crlen);
-@@ -2071,14 +2595,14 @@
- 	int full_ie = Q931_FULL_IE(codeset, ie->ie);
- 	int base_ie;
- 
--	pri_message(NULL, "%c [", prefix);
--	pri_message(NULL, "%02x", ie->ie);
-+	pri_message(pri, "%c [", prefix);
-+	pri_message(pri, "%02x", ie->ie);
- 	if (!(ie->ie & 0x80)) {
--		pri_message(NULL, " %02x", ielen(ie)-2);
-+		pri_message(pri, " %02x", ielen(ie)-2);
- 		for (x = 0; x + 2 < ielen(ie); ++x)
--			pri_message(NULL, " %02x", ie->data[x]);
-+			pri_message(pri, " %02x", ie->data[x]);
- 	}
--	pri_message(NULL, "]\n");
-+	pri_message(pri, "]\n");
- 
- 	/* Special treatment for shifts */
- 	if((full_ie & 0xf0) == Q931_LOCKING_SHIFT)
-@@ -2098,14 +2622,46 @@
+@@ -2100,14 +2624,46 @@
  	pri_error(pri, "!! %c Unknown IE %d (len = %d)\n", prefix, base_ie, ielen(ie));
  }
  
@@ -4953,7 +4990,7 @@
  		prev = cur;
  		cur = cur->next;
  	}
-@@ -2118,6 +2674,7 @@
+@@ -2120,6 +2676,7 @@
  		/* Call reference */
  		cur->cr = cr;
  		cur->pri = pri;
@@ -4961,7 +4998,7 @@
  		/* Append to end of list */
  		if (prev)
  			prev->next = cur;
-@@ -2133,24 +2690,42 @@
+@@ -2135,24 +2692,42 @@
  	do {
  		cur = *pri->callpool;
  		pri->cref++;
@@ -5011,7 +5048,7 @@
  			if (prev)
  				prev->next = cur->next;
  			else
-@@ -2159,6 +2734,8 @@
+@@ -2161,6 +2736,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);
@@ -5020,7 +5057,7 @@
  			pri_call_apdu_queue_cleanup(cur);
  			free(cur);
  			return;
-@@ -2169,16 +2746,16 @@
+@@ -2171,16 +2748,16 @@
  	pri_error(pri, "Can't destroy call %d!\n", cr);
  }
  
@@ -5040,7 +5077,7 @@
  	return;
  }
  
-@@ -2290,6 +2867,10 @@
+@@ -2292,6 +2869,10 @@
  {
  	unsigned int x;
  	int full_ie = Q931_FULL_IE(codeset, ie->ie);
@@ -5051,7 +5088,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 +2888,36 @@
+@@ -2309,21 +2890,36 @@
  	return -1;
  }
  
@@ -5093,7 +5130,7 @@
  	}
  	if (pri->subchannel) {
  		/* On GR-303, top bit is always 0 */
-@@ -2330,13 +2926,23 @@
+@@ -2332,13 +2928,23 @@
  	mh->f = 0;
  	*hb = h;
  	*mhb = mh;
@@ -5121,7 +5158,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 +2968,11 @@
+@@ -2364,7 +2970,11 @@
  	
  	memset(buf, 0, sizeof(buf));
  	len = sizeof(buf);
@@ -5134,7 +5171,7 @@
  	mh->msg = msgtype;
  	x=0;
  	codeset = 0;
-@@ -2397,11 +3007,34 @@
+@@ -2399,11 +3009,34 @@
  	}
  	/* Invert the logic */
  	len = sizeof(buf) - len;
@@ -5170,7 +5207,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 +3072,45 @@
+@@ -2441,17 +3074,45 @@
  	return send_message(pri, c, Q931_INFORMATION, information_ies);
  }
  
@@ -5218,7 +5255,7 @@
  int q931_facility(struct pri*pri, q931_call *c)
  {
  	return send_message(pri, c, Q931_FACILITY, facility_ies);
-@@ -2463,7 +3124,6 @@
+@@ -2465,7 +3126,6 @@
  		if ((info > 0x2) || (info < 0x00))
  			return 0;
  	}
@@ -5226,7 +5263,7 @@
  	if (info >= 0)
  		c->notify = info & 0x7F;
  	else
-@@ -2506,6 +3166,8 @@
+@@ -2508,6 +3168,8 @@
  
  int q931_call_proceeding(struct pri *pri, q931_call *c, int channel, int info)
  {
@@ -5235,7 +5272,7 @@
  	if (channel) { 
  		c->ds1no = (channel & 0xff00) >> 8;
  		c->ds1explicit = (channel & 0x10000) >> 16;
-@@ -2532,8 +3194,12 @@
+@@ -2534,8 +3196,12 @@
  static int alerting_ies[] = { -1 };
  #endif
  
@@ -5248,7 +5285,7 @@
  	if (!c->proc) 
  		q931_call_proceeding(pri, c, channel, 0);
  	if (info) {
-@@ -2544,14 +3210,130 @@
+@@ -2546,14 +3212,130 @@
  		c->progressmask = 0;
  	c->ourcallstate = Q931_CALL_STATE_CALL_RECEIVED;
  	c->peercallstate = Q931_CALL_STATE_CALL_DELIVERED;
@@ -5265,8 +5302,9 @@
 +		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)
@@ -5300,9 +5338,8 @@
 +int q931_retrieve_reject(struct pri *pri, q931_call *c)
 +{
 +	return send_message(pri, c, Q931_RETRIEVE_REJECT, retrieve_reject_ies);
- }
- 
--static int connect_ies[] = {  Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, -1 };
++}
++
 +static int suspend_acknowledge_ies[] = { Q931_DISPLAY, -1 };
 +
 +int q931_suspend_acknowledge(struct pri *pri, q931_call *c, char *display)
@@ -5381,7 +5418,7 @@
  	if (channel) { 
  		c->ds1no = (channel & 0xff00) >> 8;
  		c->ds1explicit = (channel & 0x10000) >> 16;
-@@ -2569,9 +3351,39 @@
+@@ -2571,9 +3353,39 @@
  	c->ourcallstate = Q931_CALL_STATE_OVERLAP_RECEIVING;
  	c->peercallstate = Q931_CALL_STATE_OVERLAP_SENDING;
  	c->alive = 1;
@@ -5421,7 +5458,7 @@
  static void pri_connect_timeout(void *data)
  {
  	struct q931_call *c = data;
-@@ -2624,6 +3436,7 @@
+@@ -2628,6 +3440,7 @@
  
  int q931_connect(struct pri *pri, q931_call *c, int channel, int nonisdn)
  {
@@ -5429,14 +5466,16 @@
  	if (channel) { 
  		c->ds1no = (channel & 0xff00) >> 8;
  		c->ds1explicit = (channel & 0x10000) >> 16;
-@@ -2638,22 +3451,37 @@
+@@ -2642,25 +3455,37 @@
  		c->progressmask = PRI_PROG_CALLED_NOT_ISDN;
  	} else
  		c->progressmask = 0;
--	c->ourcallstate = Q931_CALL_STATE_CONNECT_REQUEST;
+-	if (pri->localtype == PRI_CPE)
+-		c->ourcallstate = Q931_CALL_STATE_CONNECT_REQUEST;
+-	else
 +	if (network) {
 +		/* WE decide when the call is up and active */
-+		c->ourcallstate = Q931_CALL_STATE_ACTIVE;
+ 		c->ourcallstate = Q931_CALL_STATE_ACTIVE;
 +	} else {
 +	    c->ourcallstate = Q931_CALL_STATE_CONNECT_REQUEST;
 +	}
@@ -5470,7 +5509,7 @@
  	c->ourcallstate = Q931_CALL_STATE_RELEASE_REQUEST;
  	/* c->peercallstate stays the same */
  	if (c->alive) {
-@@ -2669,7 +3497,14 @@
+@@ -2676,7 +3501,14 @@
  			} else {
  				c->retranstimer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T308], pri_release_finaltimeout, c);
  			}
@@ -5486,7 +5525,7 @@
  		} else
  			return send_message(pri, c, Q931_RELEASE_COMPLETE, release_ies); /* Yes, release_ies, not release_complete_ies */
  	} else
-@@ -2681,7 +3516,7 @@
+@@ -2688,7 +3520,7 @@
  int q931_restart(struct pri *pri, int channel)
  {
  	struct q931_call *c;
@@ -5495,7 +5534,7 @@
  	if (!c)
  		return -1;
  	if (!channel)
-@@ -2698,10 +3533,12 @@
+@@ -2705,10 +3537,12 @@
  	return send_message(pri, c, Q931_RESTART, restart_ies);
  }
  
@@ -5508,7 +5547,7 @@
  	c->ourcallstate = Q931_CALL_STATE_DISCONNECT_REQUEST;
  	c->peercallstate = Q931_CALL_STATE_DISCONNECT_INDICATION;
  	if (c->alive) {
-@@ -2713,14 +3550,27 @@
+@@ -2720,14 +3554,27 @@
  		if (c->retranstimer)
  			pri_schedule_del(pri, c->retranstimer);
  		c->retranstimer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T305], pri_disconnect_timeout, c);
@@ -5537,7 +5576,7 @@
  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 +3578,12 @@
+@@ -2735,7 +3582,12 @@
  int q931_setup(struct pri *pri, q931_call *c, struct pri_sr *req)
  {
  	int res;
@@ -5551,7 +5590,7 @@
  	
  	c->transcapability = req->transmode;
  	c->transmoderate = TRANS_MODE_64_CIRCUIT;
-@@ -2753,6 +3608,7 @@
+@@ -2760,6 +3612,7 @@
  		c->chanflags = FLAG_EXCLUSIVE;
  	else if (c->channelno)
  		c->chanflags = FLAG_PREFERRED;
@@ -5559,7 +5598,7 @@
  	if (req->caller) {
  		libpri_copy_string(c->callernum, req->caller, sizeof(c->callernum));
  		c->callerplan = req->callerplan;
-@@ -2812,14 +3668,19 @@
+@@ -2819,14 +3672,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);
@@ -5579,7 +5618,7 @@
  	}
  	return res;
  	
-@@ -2835,7 +3696,11 @@
+@@ -2842,7 +3700,11 @@
  	if (cause > -1) {
  		c->cause = cause;
  		c->causecode = CODE_CCITT;
@@ -5592,7 +5631,7 @@
  		/* release_ies has CAUSE in it */
  		res = send_message(pri, c, Q931_RELEASE_COMPLETE, release_ies);
  	} else
-@@ -2860,6 +3725,125 @@
+@@ -2867,6 +3729,125 @@
  	return 0;
  }
  
@@ -5718,7 +5757,7 @@
  int q931_hangup(struct pri *pri, q931_call *c, int cause)
  {
  	int disconnect = 1;
-@@ -2871,7 +3855,7 @@
+@@ -2878,7 +3859,7 @@
  	/* If mandatory IE was missing, insist upon that cause code */
  	if (c->cause == PRI_CAUSE_MANDATORY_IE_MISSING)
  		cause = c->cause;
@@ -5727,7 +5766,7 @@
  		/* We'll send RELEASE_COMPLETE with these causes */
  		disconnect = 0;
  		release_compl = 1;
-@@ -2885,7 +3869,7 @@
+@@ -2892,7 +3873,7 @@
  	case Q931_CALL_STATE_NULL:
  		if (c->peercallstate == Q931_CALL_STATE_NULL)
  			/* free the resources if we receive or send REL_COMPL */
@@ -5736,7 +5775,7 @@
  		else if (c->peercallstate == Q931_CALL_STATE_RELEASE_REQUEST)
  			q931_release_complete(pri,c,cause);
  		break;
-@@ -2911,6 +3895,11 @@
+@@ -2918,6 +3899,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) {
@@ -5748,7 +5787,7 @@
  			if (disconnect)
  				q931_disconnect(pri,c,cause);
  			else if (release_compl)
-@@ -2926,8 +3915,14 @@
+@@ -2933,8 +3919,14 @@
  		break;
  	case Q931_CALL_STATE_DISCONNECT_INDICATION:
  		/* received DISCONNECT */
@@ -5763,7 +5802,7 @@
  			q931_release(pri,c,cause);
  		}
  		break;
-@@ -2941,19 +3936,17 @@
+@@ -2948,19 +3940,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:
@@ -5786,7 +5825,7 @@
  	q931_call *c;
  	q931_ie *ie;
  	unsigned int x;
-@@ -2965,6 +3958,7 @@
+@@ -2972,6 +3962,7 @@
  	int codeset, cur_codeset;
  	int last_ie[8];
  	struct apdu_event *cur = NULL;
@@ -5794,7 +5833,7 @@
  
  	memset(last_ie, 0, sizeof(last_ie));
  	if (pri->debug & PRI_DEBUG_Q931_DUMP)
-@@ -2978,13 +3972,13 @@
+@@ -2985,13 +3976,13 @@
  		   KLUDGE this by changing byte 4 from a 0xf (SERVICE) 
  		   to a 0x7 (SERVICE ACKNOWLEDGE) */
  		h->raw[h->crlen + 2] -= 0x8;
@@ -5810,7 +5849,7 @@
  	if (!c) {
  		pri_error(pri, "Unable to locate call %d\n", q931_cr(h));
  		return -1;
-@@ -3007,6 +4001,7 @@
+@@ -3014,6 +4005,7 @@
  	case Q931_SETUP:
  		if (pri->debug & PRI_DEBUG_Q931_STATE)
  			pri_message(pri, "-- Processing Q.931 Call Setup\n");
@@ -5818,7 +5857,7 @@
  		c->channelno = -1;
  		c->slotmap = -1;
  		c->chanflags = 0;
-@@ -3027,28 +4022,44 @@
+@@ -3034,28 +4026,44 @@
  		c->callername[0] = '\0';
  		c->callerani[0] = '\0';
  		c->callerplanani = -1;
@@ -5873,7 +5912,7 @@
  		c->progress = -1;
  		c->progressmask = 0;
  		break;
-@@ -3059,20 +4070,22 @@
+@@ -3066,20 +4074,22 @@
  		break;
  	case Q931_RELEASE:
  	case Q931_DISCONNECT:
@@ -5903,7 +5942,7 @@
  	case Q931_STATUS:
  		c->cause = -1;
  		c->causecode = -1;
-@@ -3089,22 +4102,32 @@
+@@ -3096,22 +4106,32 @@
  	case Q931_STATUS_ENQUIRY:
  		break;
  	case Q931_SETUP_ACKNOWLEDGE:
@@ -5940,7 +5979,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);
-@@ -3113,7 +4136,7 @@
+@@ -3120,7 +4140,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) 
@@ -5949,7 +5988,7 @@
  		return -1;
  	}
  	memset(mandies, 0, sizeof(mandies));
-@@ -3193,12 +4216,19 @@
+@@ -3200,12 +4220,19 @@
  	missingmand = 0;
  	for (x=0;x<MAX_MAND_IES;x++) {
  		if (mandies[x]) {
@@ -5974,7 +6013,7 @@
  		}
  	}
  	
-@@ -3207,7 +4237,7 @@
+@@ -3214,7 +4241,7 @@
  	case Q931_RESTART:
  		if (missingmand) {
  			q931_status(pri, c, PRI_CAUSE_MANDATORY_IE_MISSING);
@@ -5983,7 +6022,7 @@
  			break;
  		}
  		c->ourcallstate = Q931_CALL_STATE_RESTART;
-@@ -3225,6 +4255,7 @@
+@@ -3232,6 +4259,7 @@
  		}
  		/* Must be new call */
  		if (!c->newcall) {
@@ -5991,7 +6030,7 @@
  			break;
  		}
  		if (c->progressmask & PRI_PROG_CALLER_NOT_ISDN)
-@@ -3242,16 +4273,20 @@
+@@ -3249,16 +4277,20 @@
  		pri->ev.ring.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
  		pri->ev.ring.callingpres = c->callerpres;
  		pri->ev.ring.callingplan = c->callerplan;
@@ -6013,8 +6052,8 @@
 +		}
  		libpri_copy_string(pri->ev.ring.origcalledname, c->origcalledname, sizeof(pri->ev.ring.origcalledname));
  		libpri_copy_string(pri->ev.ring.origcallednum, c->origcallednum, sizeof(pri->ev.ring.origcallednum));
-                 libpri_copy_string(pri->ev.ring.redirectingnum, c->redirectingnum, sizeof(pri->ev.ring.redirectingnum));
-@@ -3261,11 +4296,13 @@
+ 		libpri_copy_string(pri->ev.ring.redirectingnum, c->redirectingnum, sizeof(pri->ev.ring.redirectingnum));
+@@ -3268,11 +4300,13 @@
  		pri->ev.ring.redirectingreason = c->redirectingreason;
  		pri->ev.ring.origredirectingreason = c->origredirectingreason;
  		pri->ev.ring.flexible = ! (c->chanflags & FLAG_EXCLUSIVE);
@@ -6029,7 +6068,7 @@
  		pri->ev.ring.redirectingreason = c->redirectingreason;
  		pri->ev.ring.progress = c->progress;
  		pri->ev.ring.progressmask = c->progressmask;
-@@ -3275,6 +4312,9 @@
+@@ -3282,6 +4316,9 @@
  			q931_release_complete(pri,c,PRI_CAUSE_INVALID_CALL_REFERENCE);
  			break;
  		}
@@ -6039,7 +6078,7 @@
  		c->ourcallstate = Q931_CALL_STATE_CALL_DELIVERED;
  		c->peercallstate = Q931_CALL_STATE_CALL_RECEIVED;
  		pri->ev.e = PRI_EVENT_RINGING;
-@@ -3295,17 +4335,24 @@
+@@ -3302,17 +4339,24 @@
  			q931_status(pri, c, PRI_CAUSE_WRONG_MESSAGE);
  			break;
  		}
@@ -6054,7 +6093,7 @@
 + 		pri->ev.answer.tei = c->tei;
  		pri->ev.answer.progress = c->progress;
  		pri->ev.answer.progressmask = c->progressmask;
-                 libpri_copy_string(pri->ev.answer.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
+ 		libpri_copy_string(pri->ev.answer.useruserinfo, c->useruserinfo, sizeof(pri->ev.answer.useruserinfo));
  		c->useruserinfo[0] = '\0';
  		q931_connect_acknowledge(pri, c);
 + 		if (pri->localtype == BRI_NETWORK_PTMP) {
@@ -6064,7 +6103,7 @@
  		if (c->justsignalling) {  /* Make sure WE release when we initiatie a signalling only connection */
  			q931_release(pri, c, PRI_CAUSE_NORMAL_CLEARING);
  			break;
-@@ -3313,23 +4360,43 @@
+@@ -3320,23 +4364,43 @@
  			return Q931_RES_HAVEEVENT;
  	case Q931_FACILITY:
  		if (c->newcall) {
@@ -6121,7 +6160,7 @@
  			break;
  		}
  		pri->ev.e = PRI_EVENT_PROGRESS;
-@@ -3347,6 +4414,11 @@
+@@ -3354,6 +4418,11 @@
  			q931_status(pri,c,PRI_CAUSE_WRONG_MESSAGE);
  			break;
  		}
@@ -6133,7 +6172,7 @@
  		pri->ev.proceeding.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
  		if (mh->msg == Q931_CALL_PROCEEDING) {
  			pri->ev.e = PRI_EVENT_PROCEEDING;
-@@ -3364,16 +4436,21 @@
+@@ -3381,16 +4450,21 @@
  			break;
  		}
  		if (c->ourcallstate != Q931_CALL_STATE_CONNECT_REQUEST) {
@@ -6157,16 +6196,15 @@
  			break;
  		}
  		if (c->newcall) {
-@@ -3410,31 +4487,70 @@
+@@ -3429,32 +4503,69 @@
  			if (res)
  				return res;
  		}
 -		break;
-+		if (c->peercallstate != c->sugcallstate) {
++		if (c->ourcallstate != c->sugcallstate) {
 +            	    pri_error(pri, "updating callstate, peercallstate %d to %d\n", c->peercallstate, c->sugcallstate);
-+//        	    c->peercallstate = c->sugcallstate;
 +        	    c->ourcallstate = c->sugcallstate;
-+            	    if (c->sugcallstate != Q931_CALL_STATE_ACTIVE) {
++            	    if ((c->sugcallstate != Q931_CALL_STATE_ACTIVE) &&(c->sugcallstate != Q931_CALL_STATE_CALL_INITIATED)) {
 +                        /* pass hangup to upper layer! */
 +                        if (c->alive) {
 +                                pri->ev.e = PRI_EVENT_HANGUP;
@@ -6189,10 +6227,11 @@
 -		c->ourcallstate = Q931_CALL_STATE_NULL;
 -		c->peercallstate = Q931_CALL_STATE_NULL;
 -		pri->ev.hangup.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
--		pri->ev.hangup.cref = c->cr;          		
--		pri->ev.hangup.cause = c->cause;      		
--		pri->ev.hangup.call = c;              		
--                libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
+-		pri->ev.hangup.cause = c->cause;
+-		pri->ev.hangup.cref = c->cr;
+-		pri->ev.hangup.call = c;
+-		pri->ev.hangup.aoc_units = c->aoc_units;
+-		libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo));
 -		c->useruserinfo[0] = '\0';
 -		/* Free resources */
 -		if (c->alive) {
@@ -6252,22 +6291,33 @@
  		break;
  	case Q931_RELEASE:
  		if (missingmand) {
-@@ -3450,6 +4566,7 @@
+@@ -3469,11 +4580,12 @@
+ 		c->ourcallstate = Q931_CALL_STATE_NULL;
  		pri->ev.e = PRI_EVENT_HANGUP;
  		pri->ev.hangup.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
+-		pri->ev.hangup.cause = c->cause;
  		pri->ev.hangup.cref = c->cr;
 +		pri->ev.hangup.tei = c->tei;
- 		pri->ev.hangup.cause = c->cause;
++		pri->ev.hangup.cause = c->cause;
  		pri->ev.hangup.call = c;
  		pri->ev.hangup.aoc_units = c->aoc_units;
-@@ -3478,9 +4595,16 @@
+-		libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo));
++                libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
+ 		c->useruserinfo[0] = '\0';
+ 		/* Don't send release complete if they send us release 
+ 		   while we sent it, assume a NULL state */
+@@ -3497,12 +4609,17 @@
+ 		/* Return such an event */
  		pri->ev.e = PRI_EVENT_HANGUP_REQ;
  		pri->ev.hangup.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
+-		pri->ev.hangup.cause = c->cause;
  		pri->ev.hangup.cref = c->cr;
 +		pri->ev.hangup.tei = c->tei;
- 		pri->ev.hangup.cause = c->cause;
++		pri->ev.hangup.cause = c->cause;
  		pri->ev.hangup.call = c;
  		pri->ev.hangup.aoc_units = c->aoc_units;
+-		libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo));
+-		c->useruserinfo[0] = '\0';
 +		if (c->progressmask & PRI_PROG_INBAND_AVAILABLE) {
 +		    pri->ev.hangup.inband_progress = 1;
 +		} else {
@@ -6277,7 +6327,7 @@
  		if (c->alive)
  			return Q931_RES_HAVEEVENT;
  		else
-@@ -3511,7 +4635,7 @@
+@@ -3533,7 +4650,7 @@
  		pri->ev.e = PRI_EVENT_INFO_RECEIVED;
  		pri->ev.ring.call = c;
  		pri->ev.ring.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
@@ -6286,7 +6336,7 @@
  		libpri_copy_string(pri->ev.ring.callingsubaddr, c->callingsubaddr, sizeof(pri->ev.ring.callingsubaddr));
  		pri->ev.ring.complete = c->complete; 	/* this covers IE 33 (Sending Complete) */
  		return Q931_RES_HAVEEVENT;
-@@ -3531,7 +4655,6 @@
+@@ -3553,7 +4670,6 @@
  		pri->ev.e = PRI_EVENT_SETUP_ACK;
  		pri->ev.setup_ack.channel = c->channelno | (c->ds1no << 8) | (c->ds1explicit << 16);
  		pri->ev.setup_ack.call = c;
@@ -6294,7 +6344,7 @@
  		cur = c->apdus;
  		while (cur) {
  			if (!cur->sent && cur->message == Q931_FACILITY) {
-@@ -3547,19 +4670,53 @@
+@@ -3569,19 +4685,53 @@
  		pri->ev.notify.channel = c->channelno;
  		pri->ev.notify.info = c->notify;
  		return Q931_RES_HAVEEVENT;
@@ -6352,7 +6402,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);
-@@ -3569,7 +4726,7 @@
+@@ -3591,7 +4741,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) 
@@ -6361,3 +6411,53 @@
  		return -1;
  	}
  	return 0;
+diff -urN libpri-1.2.4.orig/README libpri-1.2.4/README
+--- libpri-1.2.4.orig/README	2006-02-15 18:59:38.000000000 +0100
++++ libpri-1.2.4/README	2006-01-18 12:28:07.000000000 +0100
+@@ -1,6 +1,7 @@
+-libpri: An implementation of Primary 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.4.orig/TODO libpri-1.2.4/TODO
+--- libpri-1.2.4.orig/TODO	2005-11-29 19:39:18.000000000 +0100
++++ libpri-1.2.4/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




More information about the Pkg-voip-commits mailing list