Compare commits
19 Commits
1.2.0-beta
...
1.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cbf719fa3a | ||
|
|
8fc524e6e7 | ||
|
|
50e2d23352 | ||
|
|
8c424cc4ff | ||
|
|
2f6aee20d9 | ||
|
|
1328ab60de | ||
|
|
f826a6e4ad | ||
|
|
4ec90f7435 | ||
|
|
014fd45a37 | ||
|
|
89384a8472 | ||
|
|
e0de929e20 | ||
|
|
160b8c91b8 | ||
|
|
326c5c66d6 | ||
|
|
9842934154 | ||
|
|
f64108e394 | ||
|
|
83c78f9e85 | ||
|
|
cfee7ff007 | ||
|
|
4bbe741b99 | ||
|
|
3269a4b034 |
60
Makefile
60
Makefile
@@ -30,7 +30,7 @@
|
||||
CC=gcc
|
||||
|
||||
OSARCH=$(shell uname -s)
|
||||
PROC=$(shell uname -m)
|
||||
PROC?=$(shell uname -m)
|
||||
|
||||
TOBJS=testpri.o
|
||||
T2OBJS=testprilib.o
|
||||
@@ -39,8 +39,10 @@ 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)
|
||||
INSTALL_PREFIX=
|
||||
INSTALL_PREFIX?=
|
||||
INSTALL_BASE=/usr
|
||||
SOFLAGS = -Wl,-hlibpri.so.1
|
||||
LDCONFIG = /sbin/ldconfig
|
||||
ifeq (${OSARCH},Linux)
|
||||
LDCONFIG_FLAGS=-n
|
||||
else
|
||||
@@ -50,13 +52,11 @@ CFLAGS += -I../zaptel -I../zapata
|
||||
endif
|
||||
endif
|
||||
ifeq (${OSARCH},SunOS)
|
||||
CFLAGS += -DSOLARIS -I../zaptel-solaris -lsocket -lnsl
|
||||
SOFLAGS =
|
||||
LDCONFIG = echo
|
||||
INSTALL_BASE = /usr/local
|
||||
else
|
||||
SOFLAGS = -Wl,-soname,libpri.so.1
|
||||
LDCONFIG = /sbin/ldconfig
|
||||
CFLAGS += -DSOLARIS -I../zaptel-solaris
|
||||
LDCONFIG =
|
||||
LDCONFIG_FLAGS = \# # Trick to comment out the period in the command below
|
||||
SOSLINK = ln -sf libpri.so.1.0 libpri.so.1
|
||||
#INSTALL_PREFIX = /opt/asterisk # Uncomment out to install in standard Solaris location for 3rd party code
|
||||
endif
|
||||
|
||||
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
|
||||
@@ -70,29 +70,40 @@ endif
|
||||
all: depend $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
|
||||
|
||||
update:
|
||||
@if [ -d CVS ]; then \
|
||||
@if [ -d .svn ]; then \
|
||||
echo "Updating from Subversion..." ; \
|
||||
svn update -q; \
|
||||
elif [ -d CVS ]; then \
|
||||
echo "Updating from CVS..." ; \
|
||||
cvs -q -z3 update -Pd; \
|
||||
else \
|
||||
echo "Not CVS"; \
|
||||
echo "Not under version control"; \
|
||||
fi
|
||||
|
||||
install: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
|
||||
mkdir -p $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib
|
||||
mkdir -p $(INSTALL_PREFIX)/$(INSTALL_BASE)/include
|
||||
install -m 644 libpri.h $(INSTALL_PREFIX)/$(INSTALL_BASE)/include
|
||||
install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib
|
||||
if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then restorecon -v $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/$(DYNAMIC_LIBRARY); fi
|
||||
( cd $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so )
|
||||
install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib
|
||||
$(LDCONFIG)
|
||||
mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
|
||||
mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/include
|
||||
ifneq (${OSARCH},SunOS)
|
||||
install -m 644 libpri.h $(INSTALL_PREFIX)$(INSTALL_BASE)/include
|
||||
install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
|
||||
if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then restorecon -v $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/$(DYNAMIC_LIBRARY); fi
|
||||
( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so )
|
||||
install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
|
||||
if test $$(id -u) = 0; then $(LDCONFIG); fi
|
||||
else
|
||||
install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include -m 644 libpri.h
|
||||
install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 755 $(DYNAMIC_LIBRARY)
|
||||
( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so ; $(SOSLINK) )
|
||||
install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 644 $(STATIC_LIBRARY)
|
||||
endif
|
||||
|
||||
uninstall:
|
||||
@echo "Removing Libpri"
|
||||
rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/libpri.so.1.0
|
||||
rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/libpri.so
|
||||
rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/libpri.a
|
||||
rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/include/libpri.h
|
||||
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so.1.0
|
||||
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so.1
|
||||
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so
|
||||
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.a
|
||||
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include/libpri.h
|
||||
|
||||
pritest: pritest.o
|
||||
$(CC) -o pritest pritest.o -L. -lpri -lzap $(CFLAGS)
|
||||
@@ -121,6 +132,7 @@ $(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
|
||||
$(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
|
||||
$(LDCONFIG) $(LDCONFIG_FLAGS) .
|
||||
ln -sf libpri.so.1 libpri.so
|
||||
$(SOSLINK)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.so *.lo *.so.1 *.so.1.0
|
||||
@@ -131,4 +143,4 @@ clean:
|
||||
depend: .depend
|
||||
|
||||
.depend:
|
||||
./mkdep ${CFLAGS} `ls *.c`
|
||||
CC=$(CC) ./mkdep ${CFLAGS} `ls *.c`
|
||||
|
||||
16
libpri.h
16
libpri.h
@@ -274,6 +274,7 @@ typedef struct pri_event_ringing {
|
||||
int progress;
|
||||
int progressmask;
|
||||
q931_call *call;
|
||||
char useruserinfo[260]; /* User->User info */
|
||||
} pri_event_ringing;
|
||||
|
||||
typedef struct pri_event_answer {
|
||||
@@ -283,6 +284,7 @@ typedef struct pri_event_answer {
|
||||
int progress;
|
||||
int progressmask;
|
||||
q931_call *call;
|
||||
char useruserinfo[260]; /* User->User info */
|
||||
} pri_event_answer;
|
||||
|
||||
typedef struct pri_event_facname {
|
||||
@@ -295,6 +297,7 @@ typedef struct pri_event_facname {
|
||||
} pri_event_facname;
|
||||
|
||||
#define PRI_CALLINGPLANANI
|
||||
#define PRI_CALLINGPLANRDNIS
|
||||
typedef struct pri_event_ring {
|
||||
int e;
|
||||
int channel; /* Channel requested */
|
||||
@@ -310,7 +313,8 @@ typedef struct pri_event_ring {
|
||||
char redirectingnum[256]; /* Redirecting number */
|
||||
char redirectingname[256]; /* Redirecting name */
|
||||
int redirectingreason; /* Reason for redirect */
|
||||
char useruserinfo[256]; /* User->User info */
|
||||
int callingplanrdnis; /* Dialing plan of Redirecting Number */
|
||||
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_* */
|
||||
@@ -322,6 +326,7 @@ typedef struct pri_event_ring {
|
||||
int progressmask;
|
||||
char origcalledname[256];
|
||||
char origcallednum[256];
|
||||
int callingplanorigcalled; /* Dialing plan of Originally Called Number */
|
||||
int origredirectingreason;
|
||||
} pri_event_ring;
|
||||
|
||||
@@ -332,6 +337,7 @@ typedef struct pri_event_hangup {
|
||||
int cref;
|
||||
q931_call *call; /* Opaque call pointer */
|
||||
long aoc_units; /* Advise of Charge number of charged units */
|
||||
char useruserinfo[260]; /* User->User info */
|
||||
} pri_event_hangup;
|
||||
|
||||
typedef struct pri_event_restart_ack {
|
||||
@@ -484,6 +490,9 @@ extern int pri_hangup(struct pri *pri, q931_call *call, int cause);
|
||||
#define PRI_DESTROYCALL
|
||||
extern void pri_destroycall(struct pri *pri, q931_call *call);
|
||||
|
||||
#define PRI_RESTART
|
||||
extern int pri_restart(struct pri *pri);
|
||||
|
||||
extern int pri_reset(struct pri *pri, int channel);
|
||||
|
||||
/* Create a new call */
|
||||
@@ -513,6 +522,11 @@ extern int pri_sr_set_bearer(struct pri_sr *sr, int transmode, int userl1);
|
||||
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);
|
||||
#define PRI_USER_USER_TX
|
||||
/* Set the user user field. Warning! don't send binary data accross this field */
|
||||
extern void pri_sr_set_useruser(struct pri_sr *sr, char *userchars);
|
||||
|
||||
extern void pri_call_set_useruser(q931_call *sr, char *userchars);
|
||||
|
||||
extern int pri_setup(struct pri *pri, q931_call *call, struct pri_sr *req);
|
||||
|
||||
|
||||
21
pri.c
21
pri.c
@@ -247,6 +247,27 @@ static struct pri *__pri_new(int fd, int node, int switchtype, struct pri *maste
|
||||
return p;
|
||||
}
|
||||
|
||||
void pri_call_set_useruser(q931_call *c, char *userchars)
|
||||
{
|
||||
if (userchars)
|
||||
libpri_copy_string(c->useruserinfo, userchars, sizeof(c->useruserinfo));
|
||||
}
|
||||
|
||||
void pri_sr_set_useruser(struct pri_sr *sr, char *userchars)
|
||||
{
|
||||
sr->useruserinfo = userchars;
|
||||
}
|
||||
|
||||
int pri_restart(struct pri *pri)
|
||||
{
|
||||
/* Restart Q.921 layer */
|
||||
if (pri) {
|
||||
q921_reset(pri);
|
||||
q921_start(pri, pri->localtype == PRI_CPE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct pri *pri_new(int fd, int nodetype, int switchtype)
|
||||
{
|
||||
return __pri_new(fd, nodetype, switchtype, NULL, __pri_read, __pri_write, NULL);
|
||||
|
||||
@@ -1299,9 +1299,10 @@ extern int pri_call_add_standard_apdus(struct pri *pri, q931_call *call)
|
||||
return 0;
|
||||
|
||||
if (pri->switchtype == PRI_SWITCH_QSIG) { /* For Q.SIG it does network and cpe operations */
|
||||
/* FIXME: Presumably, it should only send on a redirect */
|
||||
rose_diverting_leg_information2_encode(pri, call);
|
||||
if (call->redirectingnum[0])
|
||||
rose_diverting_leg_information2_encode(pri, call);
|
||||
add_callername_facility_ies(pri, call, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pri->localtype == PRI_NETWORK) {
|
||||
@@ -1312,6 +1313,7 @@ extern int pri_call_add_standard_apdus(struct pri *pri, q931_call *call)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
} else if (pri->localtype == PRI_CPE) {
|
||||
switch (pri->switchtype) {
|
||||
case PRI_SWITCH_NI2:
|
||||
@@ -1320,6 +1322,7 @@ extern int pri_call_add_standard_apdus(struct pri *pri, q931_call *call)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -129,6 +129,7 @@ struct pri_sr {
|
||||
int redirectingpres;
|
||||
int redirectingreason;
|
||||
int justsignalling;
|
||||
char *useruserinfo;
|
||||
};
|
||||
|
||||
/* Internal switch types */
|
||||
|
||||
2
q921.c
2
q921.c
@@ -338,7 +338,7 @@ static void t200_expire(void *vpri)
|
||||
if (pri->debug & PRI_DEBUG_Q921_STATE)
|
||||
pri_message(pri, "-- Retransmitting %d bytes\n", pri->txqueue->len);
|
||||
if (pri->busy)
|
||||
q921_rr(pri, 1, 0);
|
||||
q921_rr(pri, 1, 1);
|
||||
else {
|
||||
if (!pri->txqueue->transmitted)
|
||||
pri_error(pri, "!! Not good - head of queue has not been transmitted yet\n");
|
||||
|
||||
63
q931.c
63
q931.c
@@ -361,7 +361,7 @@ static FUNC_SEND(transmit_channel_id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((call->ds1no > 0) || call->ds1explicit) {
|
||||
if (((pri->switchtype != PRI_SWITCH_QSIG) && (call->ds1no > 0)) || call->ds1explicit) {
|
||||
/* Note that we are specifying the identifier */
|
||||
ie->data[pos++] |= 0x40;
|
||||
/* We need to use the Channel Identifier Present thingy. Just specify it and we're done */
|
||||
@@ -969,6 +969,27 @@ static FUNC_RECV(receive_user_user)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static FUNC_SEND(transmit_user_user)
|
||||
{
|
||||
int datalen = strlen(call->useruserinfo);
|
||||
if (datalen > 0) {
|
||||
/* Restricted to 35 characters */
|
||||
if (msgtype == Q931_USER_INFORMATION) {
|
||||
if (datalen > 260)
|
||||
datalen = 260;
|
||||
} else {
|
||||
if (datalen > 35)
|
||||
datalen = 35;
|
||||
}
|
||||
ie->data[0] = 4; /* IA5 characters */
|
||||
memcpy(&ie->data[1], call->useruserinfo, datalen);
|
||||
call->useruserinfo[0] = '\0';
|
||||
return datalen + 3;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char *prog2str(int prog)
|
||||
{
|
||||
static struct msgtype progs[] = {
|
||||
@@ -1036,7 +1057,8 @@ static FUNC_RECV(receive_display)
|
||||
static FUNC_SEND(transmit_display)
|
||||
{
|
||||
int i;
|
||||
if ((pri->switchtype != PRI_SWITCH_NI1) && *call->callername) {
|
||||
if ((pri->switchtype != PRI_SWITCH_NI1) && (pri->switchtype != PRI_SWITCH_QSIG)
|
||||
&& *call->callername) {
|
||||
i = 0;
|
||||
if(pri->switchtype != PRI_SWITCH_EUROISDN_E1) {
|
||||
ie->data[0] = 0xb1;
|
||||
@@ -1360,12 +1382,14 @@ static FUNC_RECV(receive_keypad_facility)
|
||||
if (ie->len == 0)
|
||||
return -1;
|
||||
|
||||
if (ie->len > sizeof(call->digitbuf))
|
||||
mylen = sizeof(call->digitbuf);
|
||||
if (ie->len > (sizeof(call->digitbuf) - 1))
|
||||
mylen = (sizeof(call->digitbuf) - 1);
|
||||
else
|
||||
mylen = ie->len;
|
||||
|
||||
libpri_copy_string(call->digitbuf, (char *) ie->data, mylen);
|
||||
memcpy(call->digitbuf, ie->data, mylen);
|
||||
|
||||
call->digitbuf[mylen] = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1926,7 +1950,7 @@ struct ie ies[] = {
|
||||
{ 1, Q931_IE_KEYPAD_FACILITY, "Keypad Facility", dump_keypad_facility, receive_keypad_facility },
|
||||
{ 0, Q931_IE_SIGNAL, "Signal", dump_signal },
|
||||
{ 1, Q931_IE_SWITCHHOOK, "Switch-hook" },
|
||||
{ 1, Q931_IE_USER_USER, "User-User", dump_user_user, receive_user_user },
|
||||
{ 1, Q931_IE_USER_USER, "User-User", dump_user_user, receive_user_user, transmit_user_user },
|
||||
{ 1, Q931_IE_ESCAPE_FOR_EXT, "Escape for Extension" },
|
||||
{ 1, Q931_IE_CALL_STATUS, "Call Status" },
|
||||
{ 1, Q931_IE_CHANGE_STATUS, "Change Status" },
|
||||
@@ -2503,7 +2527,7 @@ int q931_call_proceeding(struct pri *pri, q931_call *c, int channel, int info)
|
||||
return send_message(pri, c, Q931_CALL_PROCEEDING, call_proceeding_ies);
|
||||
}
|
||||
#ifndef ALERTING_NO_PROGRESS
|
||||
static int alerting_ies[] = { Q931_PROGRESS_INDICATOR, -1 };
|
||||
static int alerting_ies[] = { Q931_PROGRESS_INDICATOR, Q931_IE_USER_USER, -1 };
|
||||
#else
|
||||
static int alerting_ies[] = { -1 };
|
||||
#endif
|
||||
@@ -2626,7 +2650,7 @@ int q931_connect(struct pri *pri, q931_call *c, int channel, int nonisdn)
|
||||
return send_message(pri, c, Q931_CONNECT, connect_ies);
|
||||
}
|
||||
|
||||
static int release_ies[] = { Q931_CAUSE, -1 };
|
||||
static int release_ies[] = { Q931_CAUSE, Q931_IE_USER_USER, -1 };
|
||||
|
||||
int q931_release(struct pri *pri, q931_call *c, int cause)
|
||||
{
|
||||
@@ -2674,7 +2698,7 @@ int q931_restart(struct pri *pri, int channel)
|
||||
return send_message(pri, c, Q931_RESTART, restart_ies);
|
||||
}
|
||||
|
||||
static int disconnect_ies[] = { Q931_CAUSE, -1 };
|
||||
static int disconnect_ies[] = { Q931_CAUSE, Q931_IE_USER_USER, -1 };
|
||||
|
||||
int q931_disconnect(struct pri *pri, q931_call *c, int cause)
|
||||
{
|
||||
@@ -2694,7 +2718,7 @@ int q931_disconnect(struct pri *pri, q931_call *c, int cause)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int setup_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, Q931_IE_FACILITY, Q931_PROGRESS_INDICATOR, Q931_NETWORK_SPEC_FAC, Q931_DISPLAY,
|
||||
static int setup_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, Q931_IE_FACILITY, Q931_PROGRESS_INDICATOR, Q931_NETWORK_SPEC_FAC, Q931_DISPLAY, Q931_IE_USER_USER,
|
||||
Q931_CALLING_PARTY_NUMBER, Q931_CALLED_PARTY_NUMBER, Q931_REDIRECTING_NUMBER, Q931_SENDING_COMPLETE, Q931_IE_ORIGINATING_LINE_INFO, Q931_IE_GENERIC_DIGITS, -1 };
|
||||
|
||||
static int gr303_setup_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, -1 };
|
||||
@@ -2772,6 +2796,9 @@ int q931_setup(struct pri *pri, q931_call *c, struct pri_sr *req)
|
||||
} else
|
||||
return -1;
|
||||
|
||||
if (req->useruserinfo)
|
||||
libpri_copy_string(c->useruserinfo, req->useruserinfo, sizeof(c->useruserinfo));
|
||||
|
||||
if (req->nonisdn && (pri->switchtype == PRI_SWITCH_NI2))
|
||||
c->progressmask = PRI_PROG_CALLER_NOT_ISDN;
|
||||
else
|
||||
@@ -2796,7 +2823,7 @@ int q931_setup(struct pri *pri, q931_call *c, struct pri_sr *req)
|
||||
|
||||
}
|
||||
|
||||
static int release_complete_ies[] = { -1 };
|
||||
static int release_complete_ies[] = { Q931_IE_USER_USER, -1 };
|
||||
|
||||
static int q931_release_complete(struct pri *pri, q931_call *c, int cause)
|
||||
{
|
||||
@@ -3017,6 +3044,7 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
case Q931_CONNECT:
|
||||
case Q931_ALERTING:
|
||||
case Q931_PROGRESS:
|
||||
c->useruserinfo[0] = '\0';
|
||||
c->cause = -1;
|
||||
case Q931_CALL_PROCEEDING:
|
||||
c->progress = -1;
|
||||
@@ -3036,11 +3064,13 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
if (c->retranstimer)
|
||||
pri_schedule_del(pri, c->retranstimer);
|
||||
c->retranstimer = 0;
|
||||
c->useruserinfo[0] = '\0';
|
||||
break;
|
||||
case Q931_RELEASE_COMPLETE:
|
||||
if (c->retranstimer)
|
||||
pri_schedule_del(pri, c->retranstimer);
|
||||
c->retranstimer = 0;
|
||||
c->useruserinfo[0] = '\0';
|
||||
case Q931_STATUS:
|
||||
c->cause = -1;
|
||||
c->causecode = -1;
|
||||
@@ -3210,6 +3240,8 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
pri->ev.ring.callingpres = c->callerpres;
|
||||
pri->ev.ring.callingplan = c->callerplan;
|
||||
pri->ev.ring.callingplanani = c->callerplanani;
|
||||
pri->ev.ring.callingplanrdnis = c->redirectingplan;
|
||||
pri->ev.ring.callingplanorigcalled = c->origcalledplan;
|
||||
pri->ev.ring.ani2 = c->ani2;
|
||||
libpri_copy_string(pri->ev.ring.callingani, c->callerani, sizeof(pri->ev.ring.callingani));
|
||||
libpri_copy_string(pri->ev.ring.callingnum, c->callernum, sizeof(pri->ev.ring.callingnum));
|
||||
@@ -3222,6 +3254,7 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
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;
|
||||
pri->ev.ring.flexible = ! (c->chanflags & FLAG_EXCLUSIVE);
|
||||
@@ -3247,6 +3280,8 @@ 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.ring.useruserinfo));
|
||||
c->useruserinfo[0] = '\0';
|
||||
return Q931_RES_HAVEEVENT;
|
||||
case Q931_CONNECT:
|
||||
if (c->newcall) {
|
||||
@@ -3265,6 +3300,8 @@ 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.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 */
|
||||
q931_release(pri, c, PRI_CAUSE_NORMAL_CLEARING);
|
||||
@@ -3378,6 +3415,8 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
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) {
|
||||
pri->ev.e = PRI_EVENT_HANGUP;
|
||||
@@ -3411,6 +3450,8 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
||||
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.ring.useruserinfo));
|
||||
c->useruserinfo[0] = '\0';
|
||||
/* Don't send release complete if they send us release
|
||||
while we sent it, assume a NULL state */
|
||||
if (c->newcall)
|
||||
|
||||
Reference in New Issue
Block a user