Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aedba2b175 | ||
|
|
2527a957f0 |
27
ChangeLog
27
ChangeLog
@@ -1,30 +1,3 @@
|
||||
2006-10-17 Kevin P. Fleming <kpfleming@digium.com>
|
||||
|
||||
* libpri 1.2.4 Released
|
||||
|
||||
2006-07-28 14:44 +0000 [r368] Matt Frederickson <creslin@digium.com>
|
||||
|
||||
* q931.c: Make sure we send any pending facilty APDUs after we get
|
||||
proceeding. (#7551)
|
||||
|
||||
2006-07-12 19:08 +0000 [r360] Russell Bryant <russell@digium.com>
|
||||
|
||||
* q931.c: ensure buffer is initialized (issue #7512, klaus3000)
|
||||
|
||||
2006-07-07 15:36 +0000 [r358] Matt Frederickson <creslin@digium.com>
|
||||
|
||||
* q931.c: Fix for #7378 (namespace collision)
|
||||
|
||||
2006-06-02 16:05 +0000 [r342-347] Matt Frederickson <creslin@digium.com>
|
||||
|
||||
* q931.c: Minor state fix. (#7269)
|
||||
|
||||
* q931.c: Fix for 7115 (Don't call pri_message multiple times per
|
||||
line)
|
||||
|
||||
* q931.c: Fixes to fill in non-filled fields in libpri. (Issue
|
||||
#7241) Thanks flefoll!
|
||||
|
||||
2006-05-30 Kevin P. Fleming <kpfleming@digium.com>
|
||||
|
||||
* libpri 1.2.3 Released
|
||||
|
||||
76
q931.c
76
q931.c
@@ -43,7 +43,7 @@ struct msgtype {
|
||||
int mandies[MAX_MAND_IES];
|
||||
};
|
||||
|
||||
static struct msgtype msgs[] = {
|
||||
struct msgtype msgs[] = {
|
||||
/* Call establishment messages */
|
||||
{ Q931_ALERTING, "ALERTING" },
|
||||
{ Q931_CALL_PROCEEDING, "CALL PROCEEDING" },
|
||||
@@ -89,7 +89,7 @@ static struct msgtype msgs[] = {
|
||||
{ NATIONAL_SERVICE_ACKNOWLEDGE, "SERVICE ACKNOWLEDGE" },
|
||||
};
|
||||
|
||||
static struct msgtype causes[] = {
|
||||
struct msgtype causes[] = {
|
||||
{ PRI_CAUSE_UNALLOCATED, "Unallocated (unassigned) number" },
|
||||
{ PRI_CAUSE_NO_ROUTE_TRANSIT_NET, "No route to specified transmit network" },
|
||||
{ PRI_CAUSE_NO_ROUTE_DESTINATION, "No route to destination" },
|
||||
@@ -136,7 +136,7 @@ static struct msgtype causes[] = {
|
||||
{ PRI_CAUSE_INTERWORKING, "Interworking, unspecified" },
|
||||
};
|
||||
|
||||
static struct msgtype facilities[] = {
|
||||
struct msgtype facilities[] = {
|
||||
{ PRI_NSF_SID_PREFERRED, "CPN (SID) preferred" },
|
||||
{ PRI_NSF_ANI_PREFERRED, "BN (ANI) preferred" },
|
||||
{ PRI_NSF_SID_ONLY, "CPN (SID) only" },
|
||||
@@ -1398,7 +1398,7 @@ static FUNC_DUMP(dump_display)
|
||||
{
|
||||
int x, y;
|
||||
char *buf = malloc(len + 1);
|
||||
char tmp[80] = "";
|
||||
char tmp[80];
|
||||
if (buf) {
|
||||
x=y=0;
|
||||
if ((x < ie->len) && (ie->data[x] & 0x80)) {
|
||||
@@ -1907,7 +1907,7 @@ static FUNC_DUMP(dump_signal)
|
||||
}
|
||||
|
||||
|
||||
static struct ie ies[] = {
|
||||
struct ie ies[] = {
|
||||
/* Codeset 0 - Common */
|
||||
{ 1, NATIONAL_CHANGE_STATUS, "Change Status" },
|
||||
{ 0, Q931_LOCKING_SHIFT, "Locking Shift", dump_shift },
|
||||
@@ -2070,17 +2070,15 @@ static inline void q931_dumpie(struct pri *pri, int codeset, q931_ie *ie, char p
|
||||
unsigned int x;
|
||||
int full_ie = Q931_FULL_IE(codeset, ie->ie);
|
||||
int base_ie;
|
||||
char *buf = malloc(ielen(ie) * 3 + 1);
|
||||
int buflen = 0;
|
||||
|
||||
buf[0] = '\0';
|
||||
pri_message(NULL, "%c [", prefix);
|
||||
pri_message(NULL, "%02x", ie->ie);
|
||||
if (!(ie->ie & 0x80)) {
|
||||
buflen += sprintf(buf, " %02x", ielen(ie)-2);
|
||||
pri_message(NULL, " %02x", ielen(ie)-2);
|
||||
for (x = 0; x + 2 < ielen(ie); ++x)
|
||||
buflen += sprintf(buf + buflen, " %02x", ie->data[x]);
|
||||
pri_message(NULL, " %02x", ie->data[x]);
|
||||
}
|
||||
pri_message(pri, "%c [%02x%s]\n", prefix, ie->ie, buf);
|
||||
free(buf);
|
||||
pri_message(NULL, "]\n");
|
||||
|
||||
/* Special treatment for shifts */
|
||||
if((full_ie & 0xf0) == Q931_LOCKING_SHIFT)
|
||||
@@ -2608,11 +2606,9 @@ static void pri_release_finaltimeout(void *data)
|
||||
pri->schedev = 1;
|
||||
pri->ev.e = PRI_EVENT_HANGUP_ACK;
|
||||
pri->ev.hangup.channel = c->channelno;
|
||||
pri->ev.hangup.cause = c->cause;
|
||||
pri->ev.hangup.cref = c->cr;
|
||||
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));
|
||||
q931_hangup(pri, c, c->cause);
|
||||
}
|
||||
|
||||
@@ -2642,10 +2638,7 @@ int q931_connect(struct pri *pri, q931_call *c, int channel, int nonisdn)
|
||||
c->progressmask = PRI_PROG_CALLED_NOT_ISDN;
|
||||
} else
|
||||
c->progressmask = 0;
|
||||
if (pri->localtype == PRI_CPE)
|
||||
c->ourcallstate = Q931_CALL_STATE_CONNECT_REQUEST;
|
||||
else
|
||||
c->ourcallstate = Q931_CALL_STATE_ACTIVE;
|
||||
c->ourcallstate = Q931_CALL_STATE_CONNECT_REQUEST;
|
||||
c->peercallstate = Q931_CALL_STATE_ACTIVE;
|
||||
c->alive = 1;
|
||||
/* Setup timer */
|
||||
@@ -3261,9 +3254,9 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
libpri_copy_string(pri->ev.ring.callednum, c->callednum, sizeof(pri->ev.ring.callednum));
|
||||
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));
|
||||
libpri_copy_string(pri->ev.ring.redirectingname, c->redirectingname, sizeof(pri->ev.ring.redirectingname));
|
||||
libpri_copy_string(pri->ev.ring.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
|
||||
libpri_copy_string(pri->ev.ring.redirectingnum, c->redirectingnum, sizeof(pri->ev.ring.redirectingnum));
|
||||
libpri_copy_string(pri->ev.ring.redirectingname, c->redirectingname, sizeof(pri->ev.ring.redirectingname));
|
||||
libpri_copy_string(pri->ev.ring.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
|
||||
c->useruserinfo[0] = '\0';
|
||||
pri->ev.ring.redirectingreason = c->redirectingreason;
|
||||
pri->ev.ring.origredirectingreason = c->origredirectingreason;
|
||||
@@ -3290,7 +3283,7 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
pri->ev.ringing.call = c;
|
||||
pri->ev.ringing.progress = c->progress;
|
||||
pri->ev.ringing.progressmask = c->progressmask;
|
||||
libpri_copy_string(pri->ev.ringing.useruserinfo, c->useruserinfo, sizeof(pri->ev.ringing.useruserinfo));
|
||||
libpri_copy_string(pri->ev.ringing.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
|
||||
c->useruserinfo[0] = '\0';
|
||||
return Q931_RES_HAVEEVENT;
|
||||
case Q931_CONNECT:
|
||||
@@ -3310,7 +3303,7 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
pri->ev.answer.call = c;
|
||||
pri->ev.answer.progress = c->progress;
|
||||
pri->ev.answer.progressmask = c->progressmask;
|
||||
libpri_copy_string(pri->ev.answer.useruserinfo, c->useruserinfo, sizeof(pri->ev.answer.useruserinfo));
|
||||
libpri_copy_string(pri->ev.answer.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
|
||||
c->useruserinfo[0] = '\0';
|
||||
q931_connect_acknowledge(pri, c);
|
||||
if (c->justsignalling) { /* Make sure WE release when we initiatie a signalling only connection */
|
||||
@@ -3364,16 +3357,6 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
pri->ev.proceeding.progressmask = c->progressmask;
|
||||
pri->ev.proceeding.cref = c->cr;
|
||||
pri->ev.proceeding.call = c;
|
||||
|
||||
cur = c->apdus;
|
||||
while (cur) {
|
||||
if (!cur->sent && cur->message == Q931_FACILITY) {
|
||||
q931_facility(pri, c);
|
||||
break;
|
||||
}
|
||||
cur = cur->next;
|
||||
}
|
||||
|
||||
return Q931_RES_HAVEEVENT;
|
||||
case Q931_CONNECT_ACKNOWLEDGE:
|
||||
if (c->newcall) {
|
||||
@@ -3406,11 +3389,9 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
/* Workaround for S-12 ver 7.3 - it responds for invalid/non-implemented IEs at SETUP with null call state */
|
||||
if (!c->sugcallstate && (c->ourcallstate != Q931_CALL_STATE_CALL_INITIATED)) {
|
||||
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.call = c;
|
||||
pri->ev.hangup.aoc_units = c->aoc_units;
|
||||
libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo));
|
||||
pri->ev.hangup.cref = c->cr;
|
||||
pri->ev.hangup.cause = c->cause;
|
||||
pri->ev.hangup.call = c;
|
||||
/* Free resources */
|
||||
c->ourcallstate = Q931_CALL_STATE_NULL;
|
||||
c->peercallstate = Q931_CALL_STATE_NULL;
|
||||
@@ -3434,11 +3415,10 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
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.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));
|
||||
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));
|
||||
c->useruserinfo[0] = '\0';
|
||||
/* Free resources */
|
||||
if (c->alive) {
|
||||
@@ -3469,11 +3449,11 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
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.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));
|
||||
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 +3477,10 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
/* 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.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->alive)
|
||||
return Q931_RES_HAVEEVENT;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user