Compare commits

...

10 Commits
1.0.4 ... 1.0.0

Author SHA1 Message Date
Kevin P. Fleming
1f98766ae2 remove CVS ignore lists
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.0.0@267 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-11-29 18:40:06 +00:00
Kevin P. Fleming
b45e8995c7 remove extraneous svn:executable properties
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.0.0@266 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-11-29 18:39:18 +00:00
Kevin P. Fleming
316cf41fc7 automatic tag renames
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/1.0.0@263 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2005-11-27 04:17:23 +00:00
Admin Commit
c747aadbea This commit was manufactured by cvs2svn to create tag 'v1-0-0'.
git-svn-id: https://origsvn.digium.com/svn/libpri/tags/v1-0-0@136 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-09-20 13:29:37 +00:00
Mark Spencer
2b7b7e2e68 Make sure retranstimer is set to 0
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@135 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-09-20 13:29:37 +00:00
Mark Spencer
9682be31fb Merge BKW's ANI2 patch (bug #2450)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@134 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-09-17 04:02:16 +00:00
Mark Spencer
ea146a8f6f Check for existance of *caller* number when sending caller, not called number (bug #2453)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@133 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-09-16 20:38:13 +00:00
Mark Spencer
12155fa6c3 Minor Makefile fixes for libpri (bug #2330)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@132 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-08-31 17:40:59 +00:00
Mark Spencer
96535a0c17 Fix redirecting number (bug #2146)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@131 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-08-25 06:20:50 +00:00
Mark Spencer
cac414333f Matt's requested fix
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@130 2fbb986a-6c06-0410-b554-c9c1f0a7f128
2004-07-23 16:20:06 +00:00
16 changed files with 39 additions and 15 deletions

View File

@@ -1,5 +0,0 @@
.depend
*.lo
libpri.so.1.0
pritest

0
ChangeLog Executable file → Normal file
View File

15
Makefile Executable file → Normal file
View File

@@ -28,6 +28,7 @@
#LIBPRI_COUNTERS=-DLIBPRI_COUNTERS
OSARCH=$(shell uname -s)
PROC=$(shell uname -m)
TOBJS=testpri.o
T2OBJS=testprilib.o
@@ -46,6 +47,14 @@ CFLAGS += -I../zaptel -I../zapata
endif
endif
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
#This works for even old (2.96) versions of gcc and provides a small boost either way.
#A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesnt support it.
ifeq ($(PROC),sparc64)
PROC=ultrasparc
CFLAGS += -mtune=$(PROC) -O3 -pipe -fomit-frame-pointer -mcpu=v8
endif
all: depend $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
update:
@@ -69,16 +78,16 @@ uninstall:
rm -f $(INSTALL_PREFIX)/usr/include/libpri.h
pritest: pritest.o
$(CC) -o pritest pritest.o -L. -lpri -lzap
$(CC) -o pritest pritest.o -L. -lpri -lzap $(CFLAGS)
testprilib.o: testprilib.c
$(CC) $(CFLAGS) -D_REENTRANT -D_GNU_SOURCE -o $@ -c $<
testprilib: testprilib.o
$(CC) -o testprilib testprilib.o -L. -lpri -lpthread
$(CC) -o testprilib testprilib.o -L. -lpri -lpthread $(CFLAGS)
pridump: pridump.o
$(CC) -o pridump pridump.o -L. -lpri -lzap
$(CC) -o pridump pridump.o -L. -lpri -lzap $(CFLAGS)
include .depend

0
README Executable file → Normal file
View File

0
TODO Executable file → Normal file
View File

1
libpri.h Executable file → Normal file
View File

@@ -279,6 +279,7 @@ typedef struct pri_event_ring {
char callingnum[256]; /* Calling number */
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 useruserinfo[256]; /* User->User info */

0
pri.c Executable file → Normal file
View File

0
pri_internal.h Executable file → Normal file
View File

0
pri_q921.h Executable file → Normal file
View File

0
pri_q931.h Executable file → Normal file
View File

0
pridump.c Executable file → Normal file
View File

0
prisched.c Executable file → Normal file
View File

0
pritest.c Executable file → Normal file
View File

0
q921.c Executable file → Normal file
View File

33
q931.c Executable file → Normal file
View File

@@ -255,6 +255,8 @@ struct q931_call {
int callerpres; /* Caller presentation */
char callernum[256]; /* Caller */
char callername[256];
int ani2; /* ANI II */
int calledplan;
int nonisdn;
@@ -865,12 +867,26 @@ static FUNC_DUMP(dump_connected_number)
static FUNC_RECV(receive_redirecting_number)
{
call->redirectingplan = ie->data[0] & 0x7f;
call->redirectingpres = ie->data[1] & 0x7f;
call->redirectingreason = ie->data[2] & 0x0f;
{
int i = 0;
q931_get_number(call->redirectingnum, sizeof(call->redirectingnum), ie->data + 3, len - 5);
/* To follow Q.931 (4.5.1), we must search for start of octet 4 by
walking through all bytes until one with ext bit (8) set to 1 */
do {
switch(i) {
case 0:
call->redirectingplan = ie->data[i] & 0x7f;
break;
case 1:
call->redirectingpres = ie->data[i] & 0x7f;
break;
case 2:
call->redirectingreason = ie->data[i] & 0x0f;
break;
}
}
while(!(ie->data[i++] & 0x80));
q931_get_number(call->redirectingnum, sizeof(call->redirectingnum), ie->data + i, ie->len - i);
return 0;
}
@@ -930,7 +946,7 @@ static FUNC_SEND(transmit_calling_party_number)
{
ie->data[0] = call->callerplan;
ie->data[1] = 0x80 | call->callerpres;
if (strlen(call->callednum))
if (strlen(call->callernum))
memcpy(ie->data + 2, call->callernum, strlen(call->callernum));
return strlen(call->callernum) + 4;
}
@@ -1401,6 +1417,7 @@ static FUNC_DUMP(dump_line_information)
static FUNC_RECV(receive_line_information)
{
call->ani2 = ie->data[0];
return 0;
}
@@ -1526,7 +1543,7 @@ static char *ie2str(int ie)
}
}
static inline int ielen(q931_ie *ie)
static inline unsigned int ielen(q931_ie *ie)
{
if ((ie->ie & 0x80) != 0)
return 1;
@@ -2095,6 +2112,7 @@ int q931_connect(struct pri *pri, q931_call *c, int channel, int nonisdn)
/* Setup timer */
if (c->retranstimer)
pri_schedule_del(pri, c->retranstimer);
c->retranstimer = 0;
if ((pri->localtype == PRI_CPE) && (!pri->subchannel))
c->retranstimer = pri_schedule_event(pri, T_313, pri_connect_timeout, c);
return send_message(pri, c, Q931_CONNECT, connect_ies);
@@ -2632,6 +2650,7 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
pri->ev.ring.channel = c->channelno | (c->ds1no << 8);
pri->ev.ring.callingpres = c->callerpres;
pri->ev.ring.callingplan = c->callerplan;
pri->ev.ring.ani2 = c->ani2;
strncpy(pri->ev.ring.callingnum, c->callernum, sizeof(pri->ev.ring.callingnum) - 1);
strncpy(pri->ev.ring.callingname, c->callername, sizeof(pri->ev.ring.callingname) - 1);
pri->ev.ring.calledplan = c->calledplan;

0
testprilib.c Executable file → Normal file
View File