Compare commits

..

4 Commits

Author SHA1 Message Date
Matthew Fredrickson
26d06c939a Importing files for 1.4.9 release
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.9@663 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-01-09 20:55:55 +00:00
Matthew Fredrickson
add4571039 Creating tag for the release of libpri-1.4.9
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.9@662 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-01-09 20:55:22 +00:00
Matthew Fredrickson
10a6efc3ae Creating tag for the release of libpri-1.4.9
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.9@660 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-01-09 20:54:04 +00:00
Matthew Fredrickson
85838caabd Creating tag for the release of libpri-1.4.9
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.4.9@658 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2009-01-09 20:52:40 +00:00
7 changed files with 111 additions and 199 deletions

View File

@@ -1 +1 @@
1.4.10
1.4.9

View File

@@ -1,55 +1,3 @@
2009-04-18 Matthew Fredrickson <creslin@digium.com>
* libpri 1.4.10 released.
2009-04-02 19:33 +0000 [r726] Richard Mudgett <rmudgett@digium.com>
* pri_facility.c: Comment changes and some string content
corrections.
2009-03-26 16:01 +0000 [r715] Richard Mudgett <rmudgett@digium.com>
* libpri.h: Comment changes to note what ISDN message type causes
the event.
2009-03-19 01:39 +0000 [r711] Richard Mudgett <rmudgett@digium.com>
* pri_facility.c: Added pSS1InfoElement comments in
qsig_cf_callrerouting().
2009-03-13 01:05 +0000 [r705] Richard Mudgett <rmudgett@digium.com>
* build_tools/make_version: Use the correct branch integrated
property when generating the version string. Update the
make_version file to the latest Asterisk version with the
appropriate libpri required chage.
2009-03-04 20:31 +0000 [r701] Joshua Colp <jcolp@digium.com>
* q931.c: Make sure we only have 4 octects on unrestricted 64k data
calls. (closes issue #14507) Reported by: jsmith Patches:
64k-data.patch uploaded by jsmith (license 15) Tested by: jsmith
(closes issue #13118) Reported by: radpeter
2009-02-02 20:18 +0000 [r687] Leif Madsen <lmadsen@digium.com>
* libpri.h: Fix a small spelling error. (closes issue #14375)
Reported by: jeremy1
2009-01-27 23:22 +0000 [r680] Matthew Fredrickson <creslin@digium.com>
* q921.c: A couple of last BRI fixes in libpri... don't discard
pending iframes when we call the q921_dchannel_up routine, since
we need to be able to send the ones that were queued up while the
D-channel went down and is being reactivated. Also fix some buggy
logic in the frame transmission decision code.
2009-01-22 21:48 +0000 [r675] Matthew Fredrickson <creslin@digium.com>
* q921.c: Change behavior so that we do not send I-frames when link
is down, but instead queue them up until the link comes up and
send them out then.
2009-01-09 Matthew Fredrickson <creslin@digium.com>
* libpri 1.4.9 released.

View File

@@ -1,7 +1,7 @@
#!/bin/sh
if [ -f ${1}/.version ]; then
cat ${1}/.version
cat ${1}/.version
elif [ -d .svn ]; then
PARTS=`LANG=C svn info ${1} | ${GREP} URL | ${AWK} '{print $2;}' | sed -e 's:^.*/svn/libpri/::' | sed -e 's:/: :g'`
BRANCH=0
@@ -10,70 +10,63 @@ elif [ -d .svn ]; then
REV=`svnversion -c ${1} | cut -d: -f2`
INTEGRATED=`LANG=C svn pg automerge-propname ${1}`
if [ -z "${INTEGRATED}" ] ; then
INTEGRATED=svnmerge-integrated
fi
BASE=`LANG=C svn pg svnmerge-integrated ${1} | cut -d: -f1`
BASE=`LANG=C svn pg ${INTEGRATED} ${1} | cut -d: -f1`
if [ "${PARTS}" = "trunk" ] ; then
echo SVN-trunk-r${REV}
exit 0
fi
if [ "${PARTS}" = "trunk" ] ; then
echo SVN-trunk-r${REV}
exit 0
fi
for PART in $PARTS ; do
if [ ${TAG} != 0 ] ; then
if [ "${PART}" = "autotag_for_be" ] ; then
continue
fi
if [ "${PART}" = "autotag_for_sx00i" ] ; then
continue
fi
RESULT="${PART}"
break
fi
if [ ${TAG} != 0 ] ; then
if [ "${PART}" = "autotag_for_be" ] ; then
continue
fi
if [ "${PART}" = "autotag_for_sx00i" ] ; then
continue
fi
RESULT="${PART}"
break
fi
if [ ${BRANCH} != 0 ] ; then
if [ -z "${RESULT}" ] ; then
RESULT="${PART}"
else
RESULT="${RESULT}-${PART}"
fi
break
if [ ${BRANCH} != 0 ] ; then
if [ -z ${RESULT} ] ; then
RESULT="${PART}"
else
RESULT="${RESULT}-${PART}"
fi
break
fi
if [ ${TEAM} != 0 ] ; then
if [ -z "${RESULT}" ] ; then
RESULT="${PART}"
else
RESULT="${RESULT}-${PART}"
fi
continue
if [ ${TEAM} != 0 ] ; then
if [ -z ${RESULT} ] ; then
RESULT="${PART}"
else
RESULT="${RESULT}-${PART}"
fi
continue
fi
if [ "${PART}" = "branches" ] ; then
BRANCH=1
RESULT="branch"
continue
fi
if [ "${PART}" = "branches" ] ; then
BRANCH=1
RESULT="branch"
continue
fi
if [ "${PART}" = "tags" ] ; then
TAG=1
continue
fi
if [ "${PART}" = "tags" ] ; then
TAG=1
continue
fi
if [ "${PART}" = "team" ] ; then
TEAM=1
continue
fi
if [ "${PART}" = "team" ] ; then
TEAM=1
continue
fi
done
if [ ${TAG} != 0 ] ; then
echo ${RESULT}
echo ${RESULT}
else
echo SVN-${RESULT}-r${REV}${BASE:+-${BASE}}
echo SVN-${RESULT}-r${REV}${BASE:+-${BASE}}
fi
else
echo "UNKNOWN__and_probably_unsupported"
fi

View File

@@ -64,23 +64,23 @@
/* PRI D-Channel Events */
#define PRI_EVENT_DCHAN_UP 1 /* D-channel is up */
#define PRI_EVENT_DCHAN_DOWN 2 /* D-channel is down */
#define PRI_EVENT_DCHAN_DOWN 2 /* D-channel is down */
#define PRI_EVENT_RESTART 3 /* B-channel is restarted */
#define PRI_EVENT_CONFIG_ERR 4 /* Configuration Error Detected */
#define PRI_EVENT_RING 5 /* Incoming call (SETUP) */
#define PRI_EVENT_HANGUP 6 /* Call got hung up (RELEASE/RELEASE_COMPLETE/other) */
#define PRI_EVENT_RINGING 7 /* Call is ringing (ALERTING) */
#define PRI_EVENT_ANSWER 8 /* Call has been answered (CONNECT) */
#define PRI_EVENT_RING 5 /* Incoming call */
#define PRI_EVENT_HANGUP 6 /* Call got hung up */
#define PRI_EVENT_RINGING 7 /* Call is ringing (alerting) */
#define PRI_EVENT_ANSWER 8 /* Call has been answered */
#define PRI_EVENT_HANGUP_ACK 9 /* Call hangup has been acknowledged */
#define PRI_EVENT_RESTART_ACK 10 /* Restart complete on a given channel (RESTART_ACKNOWLEDGE) */
#define PRI_EVENT_RESTART_ACK 10 /* Restart complete on a given channel */
#define PRI_EVENT_FACNAME 11 /* Caller*ID Name received on Facility */
#define PRI_EVENT_INFO_RECEIVED 12 /* Additional info (digits) received (INFORMATION) */
#define PRI_EVENT_PROCEEDING 13 /* When we get CALL_PROCEEDING */
#define PRI_EVENT_INFO_RECEIVED 12 /* Additional info (keypad) received */
#define PRI_EVENT_PROCEEDING 13 /* When we get CALL_PROCEEDING or PROGRESS */
#define PRI_EVENT_SETUP_ACK 14 /* When we get SETUP_ACKNOWLEDGE */
#define PRI_EVENT_HANGUP_REQ 15 /* Requesting the higher layer to hangup (DISCONNECT) */
#define PRI_EVENT_NOTIFY 16 /* Notification received (NOTIFY) */
#define PRI_EVENT_PROGRESS 17 /* When we get PROGRESS */
#define PRI_EVENT_KEYPAD_DIGIT 18 /* When we receive during ACTIVE state (INFORMATION) */
#define PRI_EVENT_HANGUP_REQ 15 /* Requesting the higher layer to hangup */
#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 */
/* Simple states */
#define PRI_STATE_DOWN 0
@@ -595,7 +595,7 @@ int pri_setup(struct pri *pri, q931_call *call, struct pri_sr *req);
/* Set a call has a call indpendent signalling connection (i.e. no bchan) */
int pri_sr_set_connection_call_independent(struct pri_sr *req);
/* Send an MWI indication to a remote location. If activate is non zero, activates, if zero, deactivates */
/* Send an MWI indication to a remote location. If activate is non zero, activates, if zero, decativates */
int pri_mwi_activate(struct pri *pri, q931_call *c, char *caller, int callerplan, char *callername, int callerpres, char *called, int calledplan);
/* Send an MWI deactivate request to a remote location */

View File

@@ -1289,15 +1289,15 @@ int qsig_cf_callrerouting(struct pri *pri, q931_call *c, const char* dest, const
/* pSS1InfoElement */
ASN1_ADD_SIMPLE(comp, (ASN1_APPLICATION | ASN1_TAG_0 ), buffer, i);
ASN1_PUSH(compstk, compsp, comp);
buffer[i++] = (0x04); /* Bearer Capability IE */
buffer[i++] = (0x03); /* len */
buffer[i++] = (0x80); /* ETSI Standard, Speech */
buffer[i++] = (0x90); /* circuit mode, 64kbit/s */
buffer[i++] = (0xa3); /* level1 protocol, a-law */
buffer[i++] = (0x95); /* locking shift to codeset 5 (national use) */
buffer[i++] = (0x32); /* Unknown ie */
buffer[i++] = (0x01); /* Unknown ie len */
buffer[i++] = (0x81); /* Unknown ie body */
buffer[i++] = (0x04); /* add BC */
buffer[i++] = (0x03);
buffer[i++] = (0x80);
buffer[i++] = (0x90);
buffer[i++] = (0xa3);
buffer[i++] = (0x95);
buffer[i++] = (0x32);
buffer[i++] = (0x01);
buffer[i++] = (0x81);
ASN1_FIXUP(compstk, compsp, buffer, i);
/* lastReroutingNr [1]*/
@@ -1425,6 +1425,7 @@ int anfpr_initiate_transfer(struct pri *pri, q931_call *c1, q931_call *c2)
/* Channel 1 */
buffer[i++] = (ASN1_CONTEXT_SPECIFIC | Q932_PROTOCOL_EXTENSIONS);
/* Interpretation component */
ASN1_ADD_SIMPLE(comp, COMP_TYPE_NFE, buffer, i);
ASN1_PUSH(compstk, compsp, comp);
@@ -1432,7 +1433,6 @@ int anfpr_initiate_transfer(struct pri *pri, q931_call *c1, q931_call *c2)
ASN1_ADD_BYTECOMP(comp, (ASN1_CONTEXT_SPECIFIC | ASN1_TAG_2), buffer, i, 0);
ASN1_FIXUP(compstk, compsp, buffer, i);
/* Interpretation component */
ASN1_ADD_BYTECOMP(comp, COMP_TYPE_INTERPRETATION, buffer, i, 2); /* reject - to get feedback from QSIG switch */
ASN1_ADD_SIMPLE(comp, COMP_TYPE_INVOKE, buffer, i);
@@ -1447,22 +1447,15 @@ int anfpr_initiate_transfer(struct pri *pri, q931_call *c1, q931_call *c2)
ASN1_ADD_SIMPLE(comp, (ASN1_SEQUENCE | ASN1_CONSTRUCTOR), buffer, i);
ASN1_PUSH(compstk, compsp, comp);
buffer[i++] = (0x0a);/* Enumeration endDesignation */
buffer[i++] = (0x01);/* Len */
buffer[i++] = (0x00);/* primaryEnd */
buffer[i++] = (0x81);/* redirectionNumber = presentationRestricted */
buffer[i++] = (0x00);/* Len */
buffer[i++] = (0x0a);/* Enumeration callStatus */
buffer[i++] = (0x01);/* Len */
buffer[i++] = (0x01);/* alerting */
/*
* Where does this element come from? It is not in Q.SIG ECMA-178.
* We send this but we will not accept it.
* This seems to be a cut and paste error from eect_initiate_transfer().
*/
buffer[i++] = (0x0a);
buffer[i++] = (0x01);
buffer[i++] = (0x00);
buffer[i++] = (0x81);
buffer[i++] = (0x00);
buffer[i++] = (0x0a);
buffer[i++] = (0x01);
buffer[i++] = (0x01);
ASN1_ADD_WORDCOMP(comp, ASN1_INTEGER, buffer, i, call_reference);
ASN1_FIXUP(compstk, compsp, buffer, i);
ASN1_FIXUP(compstk, compsp, buffer, i);
@@ -1487,6 +1480,7 @@ int anfpr_initiate_transfer(struct pri *pri, q931_call *c1, q931_call *c2)
compsp = 0;
buffer2[i++] = (ASN1_CONTEXT_SPECIFIC | Q932_PROTOCOL_EXTENSIONS);
/* Interpretation component */
ASN1_ADD_SIMPLE(comp, COMP_TYPE_NFE, buffer2, i);
ASN1_PUSH(compstk, compsp, comp);
@@ -1494,7 +1488,6 @@ int anfpr_initiate_transfer(struct pri *pri, q931_call *c1, q931_call *c2)
ASN1_ADD_BYTECOMP(comp, (ASN1_CONTEXT_SPECIFIC | ASN1_TAG_2), buffer2, i, 0);
ASN1_FIXUP(compstk, compsp, buffer2, i);
/* Interpretation component */
ASN1_ADD_BYTECOMP(comp, COMP_TYPE_INTERPRETATION, buffer2, i, 2); /* reject */
ASN1_ADD_SIMPLE(comp, COMP_TYPE_INVOKE, buffer2, i);
@@ -1509,22 +1502,15 @@ int anfpr_initiate_transfer(struct pri *pri, q931_call *c1, q931_call *c2)
ASN1_ADD_SIMPLE(comp, (ASN1_SEQUENCE | ASN1_CONSTRUCTOR), buffer2, i);
ASN1_PUSH(compstk, compsp, comp);
buffer2[i++] = (0x0a);/* Enumeration endDesignation */
buffer2[i++] = (0x01);/* Len */
buffer2[i++] = (0x01);/* secondaryEnd */
buffer2[i++] = (0x81);/* redirectionNumber = presentationRestricted */
buffer2[i++] = (0x00);/* Len */
buffer2[i++] = (0x0a);/* Enumeration callStatus */
buffer2[i++] = (0x01);/* Len */
buffer2[i++] = (0x01);/* alerting */
/*
* Where does this element come from? It is not in Q.SIG ECMA-178.
* We send this but we will not accept it.
* This seems to be a cut and paste error from eect_initiate_transfer().
*/
buffer2[i++] = (0x0a);
buffer2[i++] = (0x01);
buffer2[i++] = (0x01);
buffer2[i++] = (0x81);
buffer2[i++] = (0x00);
buffer2[i++] = (0x0a);
buffer2[i++] = (0x01);
buffer2[i++] = (0x01);
ASN1_ADD_WORDCOMP(comp, ASN1_INTEGER, buffer2, i, call_reference);
ASN1_FIXUP(compstk, compsp, buffer2, i);
ASN1_FIXUP(compstk, compsp, buffer2, i);
@@ -2281,7 +2267,7 @@ int rose_reject_decode(struct pri *pri, q931_call *call, q931_ie *ie, unsigned c
return 0;
} else {
pri_message(pri, "Unable to handle reject on switchtype %d!\n", pri->switchtype);
pri_message(pri, "Unable to handle return result on switchtype %d!\n", pri->switchtype);
return -1;
}
@@ -2344,7 +2330,8 @@ int rose_return_error_decode(struct pri *pri, q931_call *call, q931_ie *ie, unsi
return 0;
} else {
pri_message(pri, "Unable to handle return error on switchtype %d!\n", pri->switchtype);
pri_message(pri, "Unable to handle return result on switchtype %d!\n", pri->switchtype);
return -1;
}
} while(0);

54
q921.c
View File

@@ -268,31 +268,12 @@ static void reschedule_t203(struct pri *pri)
pri->t203_timer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T203], t203_expire, pri);
}
static void q921_send_queued_iframes(struct pri *pri)
{
struct q921_frame *f;
f = pri->txqueue;
while(f && (pri->windowlen < pri->window)) {
if (!f->transmitted) {
/* Send it now... */
if (pri->debug & PRI_DEBUG_Q921_DUMP)
pri_message(pri, "-- Finally transmitting %d, since window opened up (%d)\n", f->h.n_s, pri->windowlen);
f->transmitted++;
pri->windowlen++;
f->h.n_r = pri->v_r;
f->h.p_f = 0;
q921_transmit(pri, (q921_h *)(&f->h), f->len);
}
f = f->next;
}
}
static pri_event *q921_ack_rx(struct pri *pri, int ack, int send_untransmitted_frames)
{
int x;
int cnt=0;
pri_event *ev;
struct q921_frame *f;
/* Make sure the ACK was within our window */
for (x=pri->v_a; (x != pri->v_s) && (x != ack); Q921_INC(x));
if (x != ack) {
@@ -328,7 +309,20 @@ static pri_event *q921_ack_rx(struct pri *pri, int ack, int send_untransmitted_f
if (!pri->busy && send_untransmitted_frames) {
pri->retrans = 0;
/* Search for something to send */
q921_send_queued_iframes(pri);
f = pri->txqueue;
while(f && (pri->windowlen < pri->window)) {
if (!f->transmitted) {
/* Send it now... */
if (pri->debug & PRI_DEBUG_Q921_DUMP)
pri_message(pri, "-- Finally transmitting %d, since window opened up (%d)\n", f->h.n_s, pri->windowlen);
f->transmitted++;
pri->windowlen++;
f->h.n_r = pri->v_r;
f->h.p_f = 0;
q921_transmit(pri, (q921_h *)(&f->h), f->len);
}
f = f->next;
}
}
if (pri->debug & PRI_DEBUG_Q921_DUMP)
pri_message(pri, "-- Waiting for acknowledge, restarting T200 counter\n");
@@ -521,7 +515,7 @@ int q921_transmit_iframe(struct pri *pri, void *buf, int len, int cr)
pri->txqueue = f;
/* Immediately transmit unless we're in a recovery state, or the window
size is too big */
if ((pri->q921_state == Q921_LINK_CONNECTION_ESTABLISHED) && (!pri->retrans && !pri->busy)) {
if (!pri->retrans && !pri->busy) {
if (pri->windowlen < pri->window) {
pri->windowlen++;
q921_transmit(pri, (q921_h *)(&f->h), f->len);
@@ -538,14 +532,9 @@ int q921_transmit_iframe(struct pri *pri, void *buf, int len, int cr)
pri_schedule_del(pri, pri->t203_timer);
pri->t203_timer = 0;
}
/* Check this so that we don't try to send frames while multi frame mode is down */
if (pri->q921_state == Q921_LINK_CONNECTION_ESTABLISHED) {
if (pri->debug & PRI_DEBUG_Q921_DUMP)
pri_message(pri, "Starting T_200 timer\n");
reschedule_t200(pri);
}
if (pri->debug & PRI_DEBUG_Q921_DUMP)
pri_message(pri, "Starting T_200 timer\n");
reschedule_t200(pri);
} else {
pri_error(pri, "!! Out of memory for Q.921 transmit\n");
return -1;
@@ -787,6 +776,9 @@ void q921_dump(struct pri *pri, q921_h *h, int len, int showraw, int txrx)
static pri_event *q921_dchannel_up(struct pri *pri)
{
/* Reset counters, etc */
q921_reset(pri);
/* Stop any SABME retransmissions */
if (pri->sabme_timer) {
pri_schedule_del(pri, pri->sabme_timer);
@@ -807,8 +799,6 @@ static pri_event *q921_dchannel_up(struct pri *pri)
/* Notify Layer 3 */
q931_dl_indication(pri, PRI_EVENT_DCHAN_UP);
q921_send_queued_iframes(pri);
/* Report event that D-Channel is now up */
pri->ev.gen.e = PRI_EVENT_DCHAN_UP;
return &pri->ev;

6
q931.c
View File

@@ -825,12 +825,6 @@ static FUNC_SEND(transmit_bearer_capability)
/* Apparently EuroISDN switches don't seem to like user layer 2/3 */
return 4;
}
if ((tc & PRI_TRANS_CAP_DIGITAL) && (call->transmoderate == TRANS_MODE_64_CIRCUIT)) {
/* Unrestricted digital 64k data calls don't use user layer 2/3 */
return 4;
}
if (call->transmoderate != TRANS_MODE_PACKET) {
/* If you have an AT&T 4ESS, you don't send any more info */
if ((pri->switchtype != PRI_SWITCH_ATT4ESS) && (call->userl1 > -1)) {