Author: arekm Date: Sat Feb 9 10:26:13 2008 GMT Module: SOURCES Tag: HEAD ---- Log message: - bristuffed patch from debian
---- Files affected: SOURCES: libpri-bristuff.patch (NONE -> 1.1) (NEW) ---- Diffs: ================================================================ Index: SOURCES/libpri-bristuff.patch diff -u /dev/null SOURCES/libpri-bristuff.patch:1.1 --- /dev/null Sat Feb 9 11:26:13 2008 +++ SOURCES/libpri-bristuff.patch Sat Feb 9 11:26:07 2008 @@ -0,0 +1,6100 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## bristuff.dpatch by Tzafrir Cohen <[EMAIL PROTECTED]> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: The libpri part of bristuff, version bristuff-0.4.0-test4 +## 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. + [EMAIL PROTECTED]@ +diff -urN libpri-1.4.1.orig/libpri.h libpri-1.4.1/libpri.h +--- libpri-1.4.1.orig/libpri.h 2006-04-27 18:09:11.000000000 +0200 ++++ libpri-1.4.1/libpri.h 2007-07-11 14:25:15.000000000 +0200 +@@ -5,6 +5,8 @@ + * + * Copyright (C) 2001, Linux Support Services, Inc. + * All Rights Reserved. ++ * Copyright (C) 2003-2006 Junghanns.NET GmbH ++ * Klaus-Peter Junghanns <[EMAIL PROTECTED]> + * + * 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 +@@ -26,8 +28,12 @@ + #define _LIBPRI_H + + /* Node types */ +-#define PRI_NETWORK 1 ++#define PRI_NETWORK 1 /* PTP modes, default for PRI */ + #define PRI_CPE 2 ++#define BRI_NETWORK_PTMP 3 /* PTMP modes, default for BRI */ ++#define BRI_CPE_PTMP 4 ++#define BRI_NETWORK 5 /* PTP modes */ ++#define BRI_CPE 6 + + /* Debugging */ + #define PRI_DEBUG_Q921_RAW (1 << 0) /* Show raw HDLC frames */ +@@ -76,6 +82,12 @@ + #define PRI_EVENT_NOTIFY 16 /* Notification received */ + #define PRI_EVENT_PROGRESS 17 /* When we get CALL_PROCEEDING or PROGRESS */ + #define PRI_EVENT_KEYPAD_DIGIT 18 /* When we receive during ACTIVE state */ ++#define PRI_EVENT_HOLD_REQ 19 /* R */ ++#define PRI_EVENT_RETRIEVE_REQ 20 ++#define PRI_EVENT_SUSPEND_REQ 21 /* park */ ++#define PRI_EVENT_RESUME_REQ 22 /* unpark */ ++#define PRI_EVENT_DISPLAY_RECEIVED 23 ++#define PRI_EVENT_FACILITY 24 /* Facility */ + + /* Simple states */ + #define PRI_STATE_DOWN 0 +@@ -252,11 +264,17 @@ + #define PRI_NSF_ATT_MULTIQUEST 0xF0 + #define PRI_NSF_CALL_REDIRECTION_SERVICE 0xF7 + ++#ifdef RELAX_TRB ++#define PRI_RELAX_TRB ++#endif ++ ++typedef struct q921_call q921_call; + typedef struct q931_call q931_call; + + typedef struct pri_event_generic { + /* Events with no additional information fall in this category */ + int e; ++ int tei; + } pri_event_generic; + + typedef struct pri_event_error { +@@ -275,18 +293,19 @@ + int cref; + int progress; + int progressmask; +- q931_call *call; + char useruserinfo[260]; /* User->User info */ ++ q931_call *call; + } pri_event_ringing; + + typedef struct pri_event_answer { + int e; + int channel; ++ int tei; /* belongs to this tei */ + int cref; + int progress; + int progressmask; +- q931_call *call; + char useruserinfo[260]; /* User->User info */ ++ q931_call *call; + } pri_event_answer; + + typedef struct pri_event_facname { +@@ -304,32 +323,37 @@ + int e; + int channel; /* Channel requested */ + int callingpres; /* Presentation of Calling CallerID */ +- int callingplanani; /* Dialing plan of Calling entity ANI */ ++ int callingpresuser; /* Presentation of Calling CallerID */ + int callingplan; /* Dialing plan of Calling entity */ +- char callingani[256]; /* Calling ANI */ +- char callingnum[256]; /* Calling number */ ++ int callingplanuser; /* Dialing plan of Calling entity */ ++ int callingplanani; /* Dialing plan of Calling entity ANI */ ++ char callingnum[256]; /* Calling number, network provided */ ++ char callingani[256]; /* Calling number, user provided */ + char callingname[256]; /* Calling name (if provided) */ + int calledplan; /* Dialing plan of Called number */ + int ani2; /* ANI II */ + char callednum[256]; /* Called number */ +- char redirectingnum[256]; /* Redirecting number */ +- char redirectingname[256]; /* Redirecting name */ +- int redirectingreason; /* Reason for redirect */ ++ char redirectingnum[256]; /* Redirecting number */ ++ char redirectingname[256]; /* Redirecting name */ ++ int redirectingreason; /* Reason for redirect */ + int callingplanrdnis; /* Dialing plan of Redirecting Number */ +- char useruserinfo[260]; /* User->User info */ ++ char useruserinfo[260]; /* User->User info */ + int flexible; /* Are we flexible with our channel selection? */ + int cref; /* Call Reference Number */ + int ctype; /* Call type (see PRI_TRANS_CAP_* */ +- int layer1; /* User layer 1 */ ++ int layer1; /* User layer 1 */ + int complete; /* Have we seen "Complete" i.e. no more number? */ + q931_call *call; /* Opaque call pointer */ +- char callingsubaddr[256]; /* Calling parties subaddress */ ++ int tei; /* belongs to this tei */ ++ char callingsubaddr[256]; /* Calling parties subaddress */ + int progress; + int progressmask; + char origcalledname[256]; + char origcallednum[256]; + int callingplanorigcalled; /* Dialing plan of Originally Called Number */ + int origredirectingreason; ++ char lowlayercompat[16]; ++ char highlayercompat[4]; + } pri_event_ring; + + typedef struct pri_event_hangup { +@@ -337,6 +361,8 @@ + int channel; /* Channel requested */ + int cause; + int cref; ++ int tei; ++ int inband_progress; + q931_call *call; /* Opaque call pointer */ + long aoc_units; /* Advise of Charge number of charged units */ + char useruserinfo[260]; /* User->User info */ +@@ -377,20 +403,80 @@ + char digits[64]; + } pri_event_keypad_digit; + ++typedef struct pri_event_hold_req { ++ int e; ++ int channel; ++ int cref; ++ int tei; ++ q931_call *call; ++} pri_event_hold_req; ++ ++/* euroisdn faciltiy fun */ ++typedef struct pri_event_facility_req { ++ int e; ++ int channel; ++ int cref; ++ int tei; ++ int operation; ++ char forwardnum[256]; /* Redirection destination */ ++ q931_call *call; ++} pri_event_facility_req; ++ ++typedef struct pri_event_retrieve_req { ++ int e; ++ int channel; ++ int cref; ++ int tei; ++ q931_call *call; ++} pri_event_retrieve_req; ++ ++typedef struct pri_event_suspend_req { ++ int e; ++ int channel; ++ int cref; ++ int tei; ++ q931_call *call; ++ char callid[10]; ++} pri_event_suspend_req; ++ ++typedef struct pri_event_resume_req { ++ int e; ++ int channel; ++ int cref; ++ int tei; ++ q931_call *call; ++ char callid[10]; ++} pri_event_resume_req; ++ ++typedef struct pri_event_display { ++ int e; ++ int channel; ++ int cref; ++ q931_call *call; ++ char text[256]; ++} pri_event_display; ++ ++ + typedef union { + int e; + pri_event_generic gen; /* Generic view */ + pri_event_restart restart; /* Restart view */ + pri_event_error err; /* Error view */ + pri_event_facname facname; /* Caller*ID Name on Facility */ ++ pri_event_facility_req facility; /* sservices */ + pri_event_ring ring; /* Ring */ + pri_event_hangup hangup; /* Hang up */ + pri_event_ringing ringing; /* Ringing */ + pri_event_answer answer; /* Answer */ + pri_event_restart_ack restartack; /* Restart Acknowledge */ + pri_event_proceeding proceeding; /* Call proceeding & Progress */ + pri_event_setup_ack setup_ack; /* SETUP_ACKNOWLEDGE structure */ + pri_event_notify notify; /* Notification */ ++ pri_event_hold_req hold_req; ++ pri_event_retrieve_req retrieve_req; ++ pri_event_suspend_req suspend_req; ++ pri_event_resume_req resume_req; ++ pri_event_display display; + pri_event_keypad_digit digit; /* Digits that come during a call */ + } pri_event; + +@@ -405,7 +491,9 @@ + channel operating in HDLC mode with FCS computed by the fd's driver. Also it + must be NON-BLOCKING! Frames received on the fd should include FCS. Nodetype + must be one of PRI_NETWORK or PRI_CPE. switchtype should be PRI_SWITCH_* */ +-extern struct pri *pri_new(int fd, int nodetype, int switchtype); ++extern struct pri *pri_new(int fd, int nodetype, int switchtype, int span); ++ ++extern void pri_shutdown(struct pri *pri); + + /* Create D-channel just as above with user defined I/O callbacks and data */ + extern struct pri *pri_new_cb(int fd, int nodetype, int switchtype, pri_io_cb io_read, pri_io_cb io_write, void *userdata); +@@ -429,6 +517,9 @@ + /* Enable transmission support of Facility IEs on the pri */ + extern void pri_facility_enable(struct pri *pri); + ++/* Set file descriptor for debugging to a file */ ++extern void pri_set_debug_fd(struct pri *pri, int fd); ++ + /* Run PRI on the given D-channel, taking care of any events that + need to be handled. If block is set, it will block until an event + occurs which needs to be handled */ +@@ -469,6 +560,12 @@ + /* Send a keypad facility string of digits */ + extern int pri_keypad_facility(struct pri *pri, q931_call *call, char *digits); + ++/* Send a INFO msg with display ie */ ++extern int pri_information_display(struct pri *pri, q931_call *call, char *display); ++ ++/* add a display ie to a call, so it can be sent with the next message */ ++extern int pri_add_display(struct pri *pri, q931_call *call, char *display); ++ + /* Answer the incomplete(call without called number) call on the given channel. + Set non-isdn to non-zero if you are not connecting to ISDN equipment */ + extern int pri_need_more_info(struct pri *pri, q931_call *call, int channel, int nonisdn); +@@ -477,6 +574,35 @@ + Set non-isdn to non-zero if you are not connecting to ISDN equipment */ + extern int pri_answer(struct pri *pri, q931_call *call, int channel, int nonisdn); + ++extern int pri_deflect(struct pri *pri, q931_call *call, char *destination); ++ ++/* Ack a HOLD_REQ */ ++extern int pri_hold_acknowledge(struct pri *pri, q931_call *call); ++ ++/* Reject a HOLD_REQ */ ++extern int pri_hold_reject(struct pri *pri, q931_call *call); ++ ++/* Ack a RETRIEVE_REQ */ ++extern int pri_retrieve_acknowledge(struct pri *pri, q931_call *call, int channel); ++ ++/* Reject a RETRIEVE_REQ */ ++extern int pri_retrieve_reject(struct pri *pri, q931_call *call); ++ ++/* Ack a SUSPEND_REQ */ ++extern int pri_suspend_acknowledge(struct pri *pri, q931_call *call, char *display); ++ ++/* Reject a SUSPEND_REQ */ ++extern int pri_suspend_reject(struct pri *pri, q931_call *call, char *display); ++ ++/* Reject a RESUME_REQ */ ++extern int pri_resume_reject(struct pri *pri, q931_call *call, char *display); ++ ++/* Ack a RESUME_REQ */ ++extern int pri_resume_acknowledge(struct pri *pri, q931_call *call, int channel, char *display); ++ ++/* Send a Facility Message */ ++extern int pri_facility(struct pri *pri, q931_call *call, int operation, char *arguments); ++ + /* Set CRV reference for GR-303 calls */ + + +@@ -485,14 +611,14 @@ + + /* backwards compatibility for those who don't use asterisk with libpri */ + #define pri_release(a,b,c) \ +- pri_hangup(a,b,c) ++ pri_hangup(a,b,c, -1) + + #define pri_disconnect(a,b,c) \ +- pri_hangup(a,b,c) ++ pri_hangup(a,b,c, -1) + + /* Hangup a call */ + #define PRI_HANGUP +-extern int pri_hangup(struct pri *pri, q931_call *call, int cause); ++extern int pri_hangup(struct pri *pri, q931_call *call, int cause, int aocunits); + + #define PRI_DESTROYCALL + extern void pri_destroycall(struct pri *pri, q931_call *call); +@@ -525,7 +651,7 @@ + extern void pri_sr_free(struct pri_sr *sr); + + extern int pri_sr_set_channel(struct pri_sr *sr, int channel, int exclusive, int nonisdn); +-extern int pri_sr_set_bearer(struct pri_sr *sr, int transmode, int userl1); ++extern int pri_sr_set_bearer(struct pri_sr *sr, int transmode, int userl1, char *llc); + extern int pri_sr_set_called(struct pri_sr *sr, char *called, int calledplan, int complete); + extern int pri_sr_set_caller(struct pri_sr *sr, char *caller, char *callername, int callerplan, int callerpres); + extern int pri_sr_set_redirecting(struct pri_sr *sr, char *num, int plan, int pres, int reason); +@@ -553,8 +679,8 @@ + + /* Override message and error stuff */ + #define PRI_NEW_SET_API +-extern void pri_set_message(void (*__pri_error)(struct pri *pri, char *)); +-extern void pri_set_error(void (*__pri_error)(struct pri *pri, char *)); ++extern void pri_set_message(void (*__pri_error)(char *, int span)); ++extern void pri_set_error(void (*__pri_error)(char *, int span)); + + /* Set overlap mode */ + #define PRI_SET_OVERLAPDIAL +diff -urN libpri-1.4.1.orig/Makefile libpri-1.4.1/Makefile +--- libpri-1.4.1.orig/Makefile 2006-12-30 20:17:34.000000000 +0100 ++++ libpri-1.4.1/Makefile 2007-07-11 14:25:15.000000000 +0200 +@@ -27,6 +27,16 @@ + # 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 ++ ++# workaround for slowly responding COs ++#RELAXEDTIMERS=-DRELAXED_TIMERS ++ + CC=gcc + + OSARCH=$(shell uname -s) +@@ -36,7 +46,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 -fPIC $(ALERTING) $(LIBPRI_COUNTERS) ++CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -fPIC $(ALERTING) $(LIBPRI_COUNTERS) $(LAYER2ALWAYSUP) $(FASTBUSYONBUSY) -DRELAX_TRB $(RELAXEDTIMERS) + INSTALL_PREFIX=$(DESTDIR) + INSTALL_BASE=/usr + SOFLAGS = -Wl,-hlibpri.so.1.0 +diff -urN libpri-1.4.1.orig/pri.c libpri-1.4.1/pri.c +--- libpri-1.4.1.orig/pri.c 2006-07-06 23:11:37.000000000 +0200 ++++ libpri-1.4.1/pri.c 2007-07-11 14:25:15.000000000 +0200 +@@ -1,24 +1,14 @@ + /* + * libpri: An implementation of Primary Rate ISDN + * +- * Written by Mark Spencer <[EMAIL PROTECTED]> ++ * Written by Mark Spencer <[EMAIL PROTECTED]> + * +- * Copyright (C) 2001-2005, Digium +- * All Rights Reserved. ++ * This program is confidential ( <- I dont think so! ) + * +- * 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. ++ * Copyright (C) 2001, Linux Support Services, Inc. ++ * All Rights Reserved. ++ * Copyright (C) 2003-2006 Junghanns.NET GmbH ++ * Klaus-Peter Junghanns <[EMAIL PROTECTED]> + * + */ + +@@ -48,6 +38,14 @@ + return "Network"; + case PRI_CPE: + return "CPE"; ++ case BRI_NETWORK: ++ return "Network"; ++ case BRI_CPE: ++ return "CPE"; ++ case BRI_NETWORK_PTMP: ++ return "Network (PtMP)"; ++ case BRI_CPE_PTMP: ++ return "CPE (PtMP)"; + default: + return "Invalid value"; + } +@@ -187,7 +185,7 @@ + return res; + } + +-static struct pri *__pri_new(int fd, int node, int switchtype, struct pri *master, pri_io_cb rd, pri_io_cb wr, void *userdata) ++static struct pri *__pri_new(int fd, int node, int switchtype, struct pri *master, pri_io_cb rd, pri_io_cb wr, void *userdata, int span) + { + struct pri *p; + p = malloc(sizeof(struct pri)); +@@ -207,6 +205,8 @@ + p->master = master; + p->callpool = &p->localpool; + pri_default_timers(p, switchtype); ++ p->debugfd = -1; ++ p->span = span; + #ifdef LIBPRI_COUNTERS + p->q921_rxcount = 0; + p->q921_txcount = 0; +@@ -217,7 +217,7 @@ + p->protodisc = GR303_PROTOCOL_DISCRIMINATOR; + p->sapi = Q921_SAPI_GR303_EOC; + p->tei = Q921_TEI_GR303_EOC_OPS; +- p->subchannel = __pri_new(-1, node, PRI_SWITCH_GR303_EOC_PATH, p, NULL, NULL, NULL); ++ p->subchannel = __pri_new(-1, node, PRI_SWITCH_GR303_EOC_PATH, p, NULL, NULL, NULL, span); + if (!p->subchannel) { + free(p); + p = NULL; +@@ -226,7 +226,7 @@ + p->protodisc = GR303_PROTOCOL_DISCRIMINATOR; + p->sapi = Q921_SAPI_GR303_TMC_CALLPROC; + p->tei = Q921_TEI_GR303_TMC_CALLPROC; +- p->subchannel = __pri_new(-1, node, PRI_SWITCH_GR303_TMC_SWITCHING, p, NULL, NULL, NULL); ++ p->subchannel = __pri_new(-1, node, PRI_SWITCH_GR303_TMC_SWITCHING, p, NULL, NULL, NULL, span); + if (!p->subchannel) { + free(p); + p = NULL; +@@ -242,7 +242,7 @@ + } + /* Start Q.921 layer, Wait if we're the network */ + if (p) +- q921_start(p, p->localtype == PRI_CPE); ++ q921_start(p, p->localtype == PRI_CPE, 0); + } + return p; + } +@@ -262,15 +262,16 @@ + { + /* Restart Q.921 layer */ + if (pri) { +- q921_reset(pri); +- q921_start(pri, pri->localtype == PRI_CPE); ++// XXX q921_reset(pri); ++// q921_start(pri, pri->localtype == PRI_CPE); + } + return 0; + } + +-struct pri *pri_new(int fd, int nodetype, int switchtype) ++ ++struct pri *pri_new(int fd, int nodetype, int switchtype, int span) + { +- return __pri_new(fd, nodetype, switchtype, NULL, __pri_read, __pri_write, NULL); ++ return __pri_new(fd, nodetype, switchtype, NULL, __pri_read, __pri_write, NULL, span); + } + + struct pri *pri_new_cb(int fd, int nodetype, int switchtype, pri_io_cb io_read, pri_io_cb io_write, void *userdata) +@@ -279,7 +280,7 @@ + io_read = __pri_read; + if (!io_write) + io_write = __pri_write; +- return __pri_new(fd, nodetype, switchtype, NULL, io_read, io_write, userdata); ++ return __pri_new(fd, nodetype, switchtype, NULL, io_read, io_write, userdata, -1); + } + + void *pri_get_userdata(struct pri *pri) +@@ -443,6 +444,15 @@ + return; + } + ++void pri_set_debug_fd(struct pri *pri, int fd) ++{ ++ if (!pri) ++ return; ++ pri->debugfd = fd; ++ if (pri->subchannel) ++ pri_set_debug_fd(pri->subchannel, fd); ++} ++ + int pri_acknowledge(struct pri *pri, q931_call *call, int channel, int info) + { + if (!pri || !call) +@@ -486,6 +496,21 @@ + return q931_notify(pri, call, channel, info); + } + ++int pri_information_display(struct pri *pri, q931_call *call, char *display) ++{ ++ if (!pri || !call) ++ return -1; ++ return q931_information_display(pri, call, display); ++} ++ ++int pri_add_display(struct pri *pri, q931_call *call, char *display) ++{ ++ if (!pri || !call) ++ return -1; ++ return q931_add_display(pri, call, display); ++} ++ ++ + void pri_destroycall(struct pri *pri, q931_call *call) + { + if (pri && call) +@@ -507,6 +532,83 @@ + return q931_connect(pri, call, channel, nonisdn); + } + ++int pri_hold_acknowledge(struct pri *pri, q931_call *call) ++{ ++ if (!pri || !call) ++ return -1; ++ return q931_hold_acknowledge(pri, call); ++} ++ ++int pri_hold_reject(struct pri *pri, q931_call *call) ++{ ++ if (!pri || !call) ++ return -1; ++ return q931_hold_reject(pri, call); ++} ++ ++int pri_retrieve_acknowledge(struct pri *pri, q931_call *call, int channel) ++{ ++ if (!pri || !call) ++ return -1; ++ return q931_retrieve_acknowledge(pri, call, channel); ++} ++ ++int pri_retrieve_reject(struct pri *pri, q931_call *call) ++{ ++ if (!pri || !call) ++ return -1; ++ return q931_retrieve_reject(pri, call); ++} ++ ++int pri_suspend_acknowledge(struct pri *pri, q931_call *call, char *display) ++{ ++ if (!pri || !call) ++ return -1; ++ return q931_suspend_acknowledge(pri, call, display); ++} ++ ++int pri_suspend_reject(struct pri *pri, q931_call *call, char *display) ++{ ++ if (!pri || !call) ++ return -1; ++ return q931_suspend_reject(pri, call, display); ++} ++ ++int pri_resume_reject(struct pri *pri, q931_call *call, char *display) ++{ ++ if (!pri || !call) ++ return -1; ++ return q931_resume_reject(pri, call, display); ++} ++ ++int pri_resume_acknowledge(struct pri *pri, q931_call *call, int channel, char *display) ++{ ++ if (!pri || !call) ++ return -1; ++ return q931_resume_acknowledge(pri, call, channel, display); ++} ++ ++int pri_facility(struct pri *pri, q931_call *call, int operation, char *arguments) ++{ ++ if (!pri || !call) ++ return -1; <<Diff was trimmed, longer than 597 lines>> _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
