[Pkg-voip-commits] r3647 - in libpri1.2/trunk/debian: . patches
tzafrir-guest at alioth.debian.org
tzafrir-guest at alioth.debian.org
Wed Jun 6 02:59:06 UTC 2007
Author: tzafrir-guest
Date: 2007-06-06 02:59:06 +0000 (Wed, 06 Jun 2007)
New Revision: 3647
Modified:
libpri1.2/trunk/debian/changelog
libpri1.2/trunk/debian/control
libpri1.2/trunk/debian/patches/bristuff.dpatch
Log:
* bristuff-0.3.0-1y-f .
* Bumped standards version to 3.7.2 .
Modified: libpri1.2/trunk/debian/changelog
===================================================================
--- libpri1.2/trunk/debian/changelog 2007-06-05 14:18:58 UTC (rev 3646)
+++ libpri1.2/trunk/debian/changelog 2007-06-06 02:59:06 UTC (rev 3647)
@@ -1,9 +1,14 @@
libpri1.2 (1.2.4-2) UNRELEASED; urgency=low
+ [ Kilian Krause ]
* NOT YET RELEASED
- -- Kilian Krause <kilian at debian.org> Wed, 30 May 2007 19:41:47 +0200
+ [ Tzafrir Cohen ]
+ * bristuff-0.3.0-1y-f .
+ * Bumped standards version to 3.7.2 .
+ -- Tzafrir Cohen <tzafrir.cohen at xorcom.com> Wed, 6 Jun 2007 05:56:48 +0300
+
libpri (1.2.4-1) unstable; urgency=low
* New upstream release.
Modified: libpri1.2/trunk/debian/control
===================================================================
--- libpri1.2/trunk/debian/control 2007-06-05 14:18:58 UTC (rev 3646)
+++ libpri1.2/trunk/debian/control 2007-06-06 02:59:06 UTC (rev 3647)
@@ -4,7 +4,7 @@
Maintainer: Debian VoIP Team <pkg-voip-maintainers at lists.alioth.debian.org>
Uploaders: Kilian Krause <kilian at debian.org>, Jose Carlos Garcia Sogo <jsogo at debian.org>, Mark Purcell <msp at debian.org>, Santiago Garcia Mantinan <manty at debian.org>, Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Build-Depends: debhelper (>> 4.0.0), dpatch
-Standards-Version: 3.6.1
+Standards-Version: 3.7.2
Package: libpri1.2-dev
Section: libdevel
Modified: libpri1.2/trunk/debian/patches/bristuff.dpatch
===================================================================
--- libpri1.2/trunk/debian/patches/bristuff.dpatch 2007-06-05 14:18:58 UTC (rev 3646)
+++ libpri1.2/trunk/debian/patches/bristuff.dpatch 2007-06-06 02:59:06 UTC (rev 3647)
@@ -2,11 +2,11 @@
## 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 bristuff-0.3.0-PRE-1v
+## DP: The libpri part of bristuff, version bristuff-0.3.0-PRE-1y-f
## 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: The remove the strange changes this libpri.patch makes to
## DP: copyright statements.
@DPATCH@
@@ -344,8 +344,8 @@
#define PRI_SET_OVERLAPDIAL
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 @@
++++ libpri-1.2.4/Makefile 2007-05-28 15:12:06.176426191 +0200
+@@ -27,6 +27,16 @@
# Uncomment if you want libpri to count number of Q921/Q931 sent/received
#LIBPRI_COUNTERS=-DLIBPRI_COUNTERS
@@ -356,21 +356,24 @@
+# device sends a RELEASE COMPLETE with cause 17
+#FASTBUSYONBUSY=-DFASTBUSYONBUSY
+
++# workaround for slowly responding COs
++#RELAXEDTIMERS=-DRELAXED_TIMERS
++
CC=gcc
OSARCH=$(shell uname -s)
-@@ -38,7 +45,7 @@
+@@ -38,7 +48,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
++CFLAGS=-Wall -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS) $(LAYER2ALWAYSUP) $(FASTBUSYONBUSY) -DRELAX_TRB $(RELAXEDTIMERS)
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
++++ libpri-1.2.4/pri.c 2007-02-02 11:16:23.000000000 +0100
@@ -1,24 +1,14 @@
/*
* libpri: An implementation of Primary Rate ISDN
@@ -530,7 +533,7 @@
void pri_destroycall(struct pri *pri, q931_call *call)
{
if (pri && call)
-@@ -499,6 +524,76 @@
+@@ -499,6 +524,83 @@
return q931_connect(pri, call, channel, nonisdn);
}
@@ -600,14 +603,21 @@
+
+int pri_deflect(struct pri *pri, q931_call *call, char *destination)
+{
-+ add_call_deflection_facility_ie(pri, call, destination);
-+ return q931_facility(pri, call);
++ if ((pri->localtype == PRI_CPE) || (pri->localtype == BRI_CPE)) {
++ add_call_rerouting_facility_ie(pri, call, destination);
++ return q931_facility(pri, call);
++ } else if (pri->localtype == BRI_CPE_PTMP) {
++ add_call_deflection_facility_ie(pri, call, destination);
++ return q931_facility(pri, call);
++ } else {
++ return -1;
++ }
+}
+
#if 0
/* deprecated routines, use pri_hangup */
int pri_release(struct pri *pri, q931_call *call, int cause)
-@@ -541,14 +636,35 @@
+@@ -541,14 +643,35 @@
return 0;
}
@@ -645,7 +655,7 @@
}
int pri_reset(struct pri *pri, int channel)
-@@ -688,15 +804,15 @@
+@@ -688,15 +811,15 @@
return q931_setup(pri, c, &req);
}
@@ -665,7 +675,7 @@
{
__pri_error = func;
}
-@@ -708,10 +824,14 @@
+@@ -708,10 +831,14 @@
va_start(ap, fmt);
vsnprintf(tmp, sizeof(tmp), fmt, ap);
va_end(ap);
@@ -684,7 +694,7 @@
}
void pri_error(struct pri *pri, char *fmt, ...)
-@@ -721,10 +841,14 @@
+@@ -721,10 +848,14 @@
va_start(ap, fmt);
vsnprintf(tmp, sizeof(tmp), fmt, ap);
va_end(ap);
@@ -703,7 +713,7 @@
}
/* Set overlap mode */
-@@ -765,11 +889,13 @@
+@@ -765,11 +896,13 @@
}
len += sprintf(buf + len, "Q921 Outstanding: %d\n", q921outstanding);
#endif
@@ -722,7 +732,7 @@
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 @@
+@@ -778,6 +911,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]);
@@ -730,7 +740,7 @@
return strdup(buf);
}
-@@ -819,10 +946,11 @@
+@@ -819,10 +953,11 @@
return 0;
}
@@ -743,7 +753,7 @@
return 0;
}
-@@ -851,3 +979,14 @@
+@@ -851,3 +986,14 @@
sr->redirectingreason = reason;
return 0;
}
@@ -758,24 +768,9 @@
+#endif
+#endif
+}
-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
++++ libpri-1.2.4/pri_facility.c 2007-01-31 15:48:56.000000000 +0100
@@ -1,26 +1,17 @@
-/*
- * libpri: An implementation of Primary Rate ISDN
@@ -1059,7 +1054,7 @@
static int rose_diverting_leg_information2_encode(struct pri *pri, q931_call *call)
{
int i = 0, j, compsp = 0;
-@@ -694,6 +702,64 @@
+@@ -694,6 +702,131 @@
return 0;
}
@@ -1121,10 +1116,77 @@
+ return 0;
+}
+
++/* Call rerouting */
++int add_call_rerouting_facility_ie(struct pri *pri, q931_call *c, char *destination) {
++ int i = 0, j, compsp = 0;
++ struct rose_component *comp, *compstk[10];
++ unsigned char buffer[256];
++ unsigned char bcie[5] = { 0x04, 0x03, 0x90, 0x90, 0xA3 };
++
++ buffer[i++] = (ASN1_CONTEXT_SPECIFIC | Q932_PROTOCOL_ROSE);
++ /* invoke */
++ ASN1_ADD_SIMPLE(comp, COMP_TYPE_INVOKE, buffer, i);
++ ASN1_PUSH(compstk, compsp, comp);
++
++ ASN1_ADD_BYTECOMP(comp, ASN1_INTEGER, buffer, i, get_invokeid(pri));
++ ASN1_ADD_BYTECOMP(comp, ASN1_INTEGER, buffer, i, ROSE_CALLREROUTING);
++
++ /* Argument sequence */
++ ASN1_ADD_SIMPLE(comp, (ASN1_CONSTRUCTOR | ASN1_SEQUENCE), buffer, i);
++ ASN1_PUSH(compstk, compsp, comp);
++
++ /* DIVERSION REASON (CFU) */
++ ASN1_ADD_BYTECOMP(comp, ASN1_ENUMERATED, buffer, i, 1);
++
++ /* arg.Address */
++ ASN1_ADD_SIMPLE(comp, (ASN1_CONSTRUCTOR | ASN1_SEQUENCE), buffer, i);
++ ASN1_PUSH(compstk, compsp, comp);
++
++ j = asn1_string_encode(0x80, &buffer[i], sizeof(buffer)-i, 20, destination, strlen(destination));
++ if(j<0) return -1;
++ i += j;
++
++ /* close Address */
++ ASN1_FIXUP(compstk, compsp, buffer, i);
++
++ /* add rerouting counter tag */
++ ASN1_ADD_BYTECOMP(comp, ASN1_INTEGER, buffer, i, 1);
++
++
++ /* IE tag */
++ j = asn1_string_encode(ASN1_APPLICATION, &buffer[i], sizeof(buffer)-i, 5, bcie, 5);
++ if(j<0) return -1;
++ i += j;
++
++ /* last rerouting number */
++ ASN1_ADD_SIMPLE(comp, (ASN1_CONTEXT_SPECIFIC | ASN1_CONSTRUCTOR | ASN1_TAG_1), buffer, i);
++ ASN1_PUSH(compstk, compsp, comp);
++
++ /* presented number unscreened */
++ ASN1_ADD_SIMPLE(comp, (ASN1_CONTEXT_SPECIFIC | ASN1_CONSTRUCTOR | ASN1_TAG_0), buffer, i);
++ ASN1_PUSH(compstk, compsp, comp);
++
++ j = asn1_string_encode(0x80, &buffer[i], sizeof(buffer)-i, 20, c->callednum, strlen(c->callednum));
++ if(j<0) return -1;
++ i += j;
++
++ /* close Address */
++ ASN1_FIXUP(compstk, compsp, buffer, i);
++
++ /* Fix length of stacked components */
++ while(compsp > 0) {
++ ASN1_FIXUP(compstk, compsp, buffer, i);
++ }
++ if (pri_call_apdu_queue(c, Q931_FACILITY, buffer, i, NULL, NULL))
++ return -1;
++
++ return 0;
++}
++
/* Sending callername information functions */
static int add_callername_facility_ies(struct pri *pri, q931_call *c, int cpe)
{
-@@ -936,7 +1002,7 @@
+@@ -936,7 +1069,7 @@
CHECK_COMPONENT(comp, ASN1_ENUMERATED, "!! Invalid AOC Charging Request argument. Expected Enumerated (0x0A) but Received 0x%02X\n");
ASN1_GET_INTEGER(comp, chargingcase);
if (chargingcase >= 0 && chargingcase <= 2) {
@@ -1133,7 +1195,7 @@
pri_message(pri, "Channel %d/%d, Call %d - received AOC charging request - charging case: %i\n",
call->ds1no, call->channelno, call->cr, chargingcase);
} else {
-@@ -1054,7 +1120,7 @@
+@@ -1054,7 +1187,7 @@
return 0;
}
@@ -1142,7 +1204,7 @@
{
/* sample data: [ 91 a1 12 02 02 3a 78 02 01 24 30 09 30 07 a1 05 30 03 02 01 01 ] */
int i = 0, res = 0, compsp = 0;
-@@ -1108,18 +1174,20 @@
+@@ -1108,18 +1241,20 @@
dump_apdu (pri, buffer, i);
/* code below is untested */
@@ -1168,7 +1230,7 @@
}
return 0;
-@@ -1152,13 +1220,15 @@
+@@ -1152,13 +1287,15 @@
NEXT_COMPONENT(comp, i);
/* No argument - return with error */
@@ -1189,7 +1251,7 @@
if (pri->debug & PRI_DEBUG_APDU)
pri_message(pri, " [ Handling operation %d ]\n", operation_tag);
-@@ -1182,7 +1252,11 @@
+@@ -1182,7 +1319,11 @@
case ROSE_DIVERTING_LEG_INFORMATION2:
if (pri->debug & PRI_DEBUG_APDU)
pri_message(pri, " Handle DivertingLegInformation2\n");
@@ -1202,7 +1264,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);
-@@ -1210,6 +1284,7 @@
+@@ -1210,6 +1351,7 @@
}
return -1;
case ROSE_AOC_AOCD_CHARGING_UNIT:
@@ -1210,7 +1272,7 @@
if (pri->debug & PRI_DEBUG_APDU) {
pri_message(pri, "ROSE %i: AOC-D Charging Unit - not handled!", operation_tag);
dump_apdu (pri, (u_int8_t *)comp, comp->len + 2);
-@@ -1224,7 +1299,7 @@
+@@ -1224,7 +1366,7 @@
case ROSE_AOC_AOCE_CHARGING_UNIT:
return aoc_aoce_charging_unit_decode(pri, call, (u_int8_t *)comp, comp->len + 2);
if (0) { /* the following function is currently not used - just to make the compiler happy */
@@ -1219,7 +1281,7 @@
return 0;
}
case ROSE_AOC_IDENTIFICATION_OF_CHARGE:
-@@ -1233,6 +1308,22 @@
+@@ -1233,6 +1375,22 @@
dump_apdu (pri, (u_int8_t *)comp, comp->len + 2);
}
return -1;
@@ -1244,7 +1306,7 @@
pri_message(pri, "!! Unable to handle ROSE operation %d", operation_tag);
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
++++ libpri-1.2.4/pri_facility.h 2007-02-01 13:21:36.000000000 +0100
@@ -34,7 +34,7 @@
/* Operation ID values */
/* Q.952 ROSE operations (Diverting) */
@@ -1254,7 +1316,7 @@
#define ROSE_DIVERTING_LEG_INFORMATION3 19
/* Q.956 ROSE operations (Advice Of Charge) */
#define ROSE_AOC_NO_CHARGING_INFO_AVAILABLE 26
-@@ -48,11 +48,15 @@
+@@ -48,11 +48,16 @@
#define ROSE_AOC_IDENTIFICATION_OF_CHARGE 37
/* Q.SIG operations */
#define SS_CNID_CALLINGNAME 0
@@ -1265,13 +1327,14 @@
#define SS_MWI_INTERROGATE 82
+#define ROSE_CALLDEFLECTION 0x0D
++#define ROSE_CALLREROUTING 0x0E
+#define ROSE_EXPLICIT_CALL_TRANSFER 0x06
+#define ROSE_MALICIOUS_CID 0x31
+
/* ROSE definitions and data structures */
#define INVOKE_IDENTIFIER 0x02
#define INVOKE_LINKED_IDENTIFIER 0x80
-@@ -180,12 +184,6 @@
+@@ -180,12 +185,6 @@
(variable) = ((variable) << 8) | (component)->data[comp_idx]; \
} while (0)
@@ -1284,12 +1347,14 @@
#define ASN1_ADD_SIMPLE(component, comptype, ptr, idx) \
do { \
(component) = (struct rose_component *)&((ptr)[(idx)]); \
-@@ -260,4 +258,8 @@
+@@ -260,4 +259,10 @@
/* Adds the "standard" ADPUs to a call */
extern int pri_call_add_standard_apdus(struct pri *pri, q931_call *call);
+extern int add_call_deflection_facility_ie(struct pri *pri, q931_call *c, char *destination);
+
++extern int add_call_rerouting_facility_ie(struct pri *pri, q931_call *c, char *destination);
++
+extern int aoc_aoce_charging_unit_encode(struct pri *pri, q931_call *c, long chargedunits, int send_facility_message);
+
#endif /* _PRI_FACILITY_H */
@@ -1796,18 +1861,6 @@
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
@@ -1856,9 +1909,12 @@
}
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 @@
++++ libpri-1.2.4/pri_timers.h 2007-04-02 14:36:33.000000000 +0200
+@@ -25,19 +25,51 @@
+ #ifndef _PRI_TIMERS_H
+ #define _PRI_TIMERS_H
++#ifdef RELAXED_TIMERS
/* -1 means we dont currently support the timer/counter */
#define PRI_TIMERS_DEFAULT { 3, /* N200 */ \
- -1, /* N201 */ \
@@ -1876,10 +1932,49 @@
-1, /* T301 */ \
-1, /* T302 */ \
- -1, /* T303 */ \
++ 6000, /* T303 */ \
++ -1, /* T304 */ \
++ 30000, /* T305 */ \
++ -1, /* T306 */ \
++ -1, /* T307 */ \
++ 6000, /* T308 */ \
++ -1, /* T309 */ \
++ -1, /* T310 */ \
++ 4000, /* T313 */ \
++ -1, /* T314 */ \
++ -1, /* T316 */ \
++ -1, /* T317 */ \
++ -1, /* T318 */ \
++ -1, /* T319 */ \
++ -1, /* T320 */ \
++ -1, /* T321 */ \
++ -1 /* T322 */ \
++ }
++#else
++/* -1 means we dont currently support the timer/counter */
++#define PRI_TIMERS_DEFAULT { 3, /* N200 */ \
++ 260, /* N201 */ \
++ 3, /* N202 */ \
++ 7, /* K */ \
++ 1000, /* T200 */ \
++ 2000, /* T201 */ \
++ 5000, /* T202 */ \
++ 10000, /* T203 */ \
++ -1, /* T300 */ \
++ -1, /* T301 */ \
++ -1, /* T302 */ \
+ 4000, /* T303 */ \
-1, /* T304 */ \
30000, /* T305 */ \
-1, /* T306 */ \
+@@ -55,6 +87,7 @@
+ -1, /* T321 */ \
+ -1 /* T322 */ \
+ }
++#endif
+
+ /* XXX Only our default timers are setup now XXX */
+ #define PRI_TIMERS_UNKNOWN PRI_TIMERS_DEFAULT
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
More information about the Pkg-voip-commits
mailing list