Compare commits
4 Commits
1.2.0-beta
...
1.2.0-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7dcf8a8906 | ||
|
|
a468a4ea77 | ||
|
|
ef415db74a | ||
|
|
44f6938952 |
53
Makefile
53
Makefile
@@ -30,7 +30,7 @@
|
|||||||
CC=gcc
|
CC=gcc
|
||||||
|
|
||||||
OSARCH=$(shell uname -s)
|
OSARCH=$(shell uname -s)
|
||||||
PROC?=$(shell uname -m)
|
PROC=$(shell uname -m)
|
||||||
|
|
||||||
TOBJS=testpri.o
|
TOBJS=testpri.o
|
||||||
T2OBJS=testprilib.o
|
T2OBJS=testprilib.o
|
||||||
@@ -39,10 +39,8 @@ DYNAMIC_LIBRARY=libpri.so.1.0
|
|||||||
STATIC_OBJS=copy_string.o pri.o q921.o prisched.o q931.o pri_facility.o
|
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
|
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)
|
CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS)
|
||||||
INSTALL_PREFIX?=
|
INSTALL_PREFIX=
|
||||||
INSTALL_BASE=/usr
|
INSTALL_BASE=/usr
|
||||||
SOFLAGS = -Wl,-hlibpri.so.1
|
|
||||||
LDCONFIG = /sbin/ldconfig
|
|
||||||
ifeq (${OSARCH},Linux)
|
ifeq (${OSARCH},Linux)
|
||||||
LDCONFIG_FLAGS=-n
|
LDCONFIG_FLAGS=-n
|
||||||
else
|
else
|
||||||
@@ -52,11 +50,13 @@ CFLAGS += -I../zaptel -I../zapata
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq (${OSARCH},SunOS)
|
ifeq (${OSARCH},SunOS)
|
||||||
CFLAGS += -DSOLARIS -I../zaptel-solaris
|
CFLAGS += -DSOLARIS -I../zaptel-solaris -lsocket -lnsl
|
||||||
LDCONFIG =
|
SOFLAGS =
|
||||||
LDCONFIG_FLAGS = \# # Trick to comment out the period in the command below
|
LDCONFIG = echo
|
||||||
SOSLINK = ln -sf libpri.so.1.0 libpri.so.1
|
INSTALL_BASE = /usr/local
|
||||||
#INSTALL_PREFIX = /opt/asterisk # Uncomment out to install in standard Solaris location for 3rd party code
|
else
|
||||||
|
SOFLAGS = -Wl,-soname,libpri.so.1
|
||||||
|
LDCONFIG = /sbin/ldconfig
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
|
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
|
||||||
@@ -78,29 +78,21 @@ update:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
install: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
|
install: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
|
||||||
mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
|
mkdir -p $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib
|
||||||
mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/include
|
mkdir -p $(INSTALL_PREFIX)/$(INSTALL_BASE)/include
|
||||||
ifneq (${OSARCH},SunOS)
|
install -m 644 libpri.h $(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
|
||||||
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
|
||||||
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 )
|
||||||
( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so )
|
install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib
|
||||||
install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
|
$(LDCONFIG)
|
||||||
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:
|
uninstall:
|
||||||
@echo "Removing Libpri"
|
@echo "Removing Libpri"
|
||||||
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.so.1.0
|
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.so
|
rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/libpri.a
|
||||||
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/libpri.a
|
rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/include/libpri.h
|
||||||
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include/libpri.h
|
|
||||||
|
|
||||||
pritest: pritest.o
|
pritest: pritest.o
|
||||||
$(CC) -o pritest pritest.o -L. -lpri -lzap $(CFLAGS)
|
$(CC) -o pritest pritest.o -L. -lpri -lzap $(CFLAGS)
|
||||||
@@ -129,7 +121,6 @@ $(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
|
|||||||
$(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
|
$(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
|
||||||
$(LDCONFIG) $(LDCONFIG_FLAGS) .
|
$(LDCONFIG) $(LDCONFIG_FLAGS) .
|
||||||
ln -sf libpri.so.1 libpri.so
|
ln -sf libpri.so.1 libpri.so
|
||||||
$(SOSLINK)
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o *.so *.lo *.so.1 *.so.1.0
|
rm -f *.o *.so *.lo *.so.1 *.so.1.0
|
||||||
@@ -140,4 +131,4 @@ clean:
|
|||||||
depend: .depend
|
depend: .depend
|
||||||
|
|
||||||
.depend:
|
.depend:
|
||||||
CC=$(CC) ./mkdep ${CFLAGS} `ls *.c`
|
./mkdep ${CFLAGS} `ls *.c`
|
||||||
|
|||||||
16
libpri.h
16
libpri.h
@@ -274,7 +274,6 @@ typedef struct pri_event_ringing {
|
|||||||
int progress;
|
int progress;
|
||||||
int progressmask;
|
int progressmask;
|
||||||
q931_call *call;
|
q931_call *call;
|
||||||
char useruserinfo[260]; /* User->User info */
|
|
||||||
} pri_event_ringing;
|
} pri_event_ringing;
|
||||||
|
|
||||||
typedef struct pri_event_answer {
|
typedef struct pri_event_answer {
|
||||||
@@ -284,7 +283,6 @@ typedef struct pri_event_answer {
|
|||||||
int progress;
|
int progress;
|
||||||
int progressmask;
|
int progressmask;
|
||||||
q931_call *call;
|
q931_call *call;
|
||||||
char useruserinfo[260]; /* User->User info */
|
|
||||||
} pri_event_answer;
|
} pri_event_answer;
|
||||||
|
|
||||||
typedef struct pri_event_facname {
|
typedef struct pri_event_facname {
|
||||||
@@ -297,7 +295,6 @@ typedef struct pri_event_facname {
|
|||||||
} pri_event_facname;
|
} pri_event_facname;
|
||||||
|
|
||||||
#define PRI_CALLINGPLANANI
|
#define PRI_CALLINGPLANANI
|
||||||
#define PRI_CALLINGPLANRDNIS
|
|
||||||
typedef struct pri_event_ring {
|
typedef struct pri_event_ring {
|
||||||
int e;
|
int e;
|
||||||
int channel; /* Channel requested */
|
int channel; /* Channel requested */
|
||||||
@@ -313,8 +310,7 @@ typedef struct pri_event_ring {
|
|||||||
char redirectingnum[256]; /* Redirecting number */
|
char redirectingnum[256]; /* Redirecting number */
|
||||||
char redirectingname[256]; /* Redirecting name */
|
char redirectingname[256]; /* Redirecting name */
|
||||||
int redirectingreason; /* Reason for redirect */
|
int redirectingreason; /* Reason for redirect */
|
||||||
int callingplanrdnis; /* Dialing plan of Redirecting Number */
|
char useruserinfo[256]; /* User->User info */
|
||||||
char useruserinfo[260]; /* User->User info */
|
|
||||||
int flexible; /* Are we flexible with our channel selection? */
|
int flexible; /* Are we flexible with our channel selection? */
|
||||||
int cref; /* Call Reference Number */
|
int cref; /* Call Reference Number */
|
||||||
int ctype; /* Call type (see PRI_TRANS_CAP_* */
|
int ctype; /* Call type (see PRI_TRANS_CAP_* */
|
||||||
@@ -326,7 +322,6 @@ typedef struct pri_event_ring {
|
|||||||
int progressmask;
|
int progressmask;
|
||||||
char origcalledname[256];
|
char origcalledname[256];
|
||||||
char origcallednum[256];
|
char origcallednum[256];
|
||||||
int callingplanorigcalled; /* Dialing plan of Originally Called Number */
|
|
||||||
int origredirectingreason;
|
int origredirectingreason;
|
||||||
} pri_event_ring;
|
} pri_event_ring;
|
||||||
|
|
||||||
@@ -337,7 +332,6 @@ typedef struct pri_event_hangup {
|
|||||||
int cref;
|
int cref;
|
||||||
q931_call *call; /* Opaque call pointer */
|
q931_call *call; /* Opaque call pointer */
|
||||||
long aoc_units; /* Advise of Charge number of charged units */
|
long aoc_units; /* Advise of Charge number of charged units */
|
||||||
char useruserinfo[260]; /* User->User info */
|
|
||||||
} pri_event_hangup;
|
} pri_event_hangup;
|
||||||
|
|
||||||
typedef struct pri_event_restart_ack {
|
typedef struct pri_event_restart_ack {
|
||||||
@@ -490,9 +484,6 @@ extern int pri_hangup(struct pri *pri, q931_call *call, int cause);
|
|||||||
#define PRI_DESTROYCALL
|
#define PRI_DESTROYCALL
|
||||||
extern void pri_destroycall(struct pri *pri, q931_call *call);
|
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);
|
extern int pri_reset(struct pri *pri, int channel);
|
||||||
|
|
||||||
/* Create a new call */
|
/* Create a new call */
|
||||||
@@ -522,11 +513,6 @@ 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_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_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);
|
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);
|
extern int pri_setup(struct pri *pri, q931_call *call, struct pri_sr *req);
|
||||||
|
|
||||||
|
|||||||
21
pri.c
21
pri.c
@@ -247,27 +247,6 @@ static struct pri *__pri_new(int fd, int node, int switchtype, struct pri *maste
|
|||||||
return p;
|
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)
|
struct pri *pri_new(int fd, int nodetype, int switchtype)
|
||||||
{
|
{
|
||||||
return __pri_new(fd, nodetype, switchtype, NULL, __pri_read, __pri_write, NULL);
|
return __pri_new(fd, nodetype, switchtype, NULL, __pri_read, __pri_write, NULL);
|
||||||
|
|||||||
@@ -1299,10 +1299,9 @@ extern int pri_call_add_standard_apdus(struct pri *pri, q931_call *call)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (pri->switchtype == PRI_SWITCH_QSIG) { /* For Q.SIG it does network and cpe operations */
|
if (pri->switchtype == PRI_SWITCH_QSIG) { /* For Q.SIG it does network and cpe operations */
|
||||||
if (call->redirectingnum[0])
|
/* FIXME: Presumably, it should only send on a redirect */
|
||||||
rose_diverting_leg_information2_encode(pri, call);
|
rose_diverting_leg_information2_encode(pri, call);
|
||||||
add_callername_facility_ies(pri, call, 1);
|
add_callername_facility_ies(pri, call, 1);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pri->localtype == PRI_NETWORK) {
|
if (pri->localtype == PRI_NETWORK) {
|
||||||
@@ -1313,7 +1312,6 @@ extern int pri_call_add_standard_apdus(struct pri *pri, q931_call *call)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
} else if (pri->localtype == PRI_CPE) {
|
} else if (pri->localtype == PRI_CPE) {
|
||||||
switch (pri->switchtype) {
|
switch (pri->switchtype) {
|
||||||
case PRI_SWITCH_NI2:
|
case PRI_SWITCH_NI2:
|
||||||
@@ -1322,7 +1320,6 @@ extern int pri_call_add_standard_apdus(struct pri *pri, q931_call *call)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -129,7 +129,6 @@ struct pri_sr {
|
|||||||
int redirectingpres;
|
int redirectingpres;
|
||||||
int redirectingreason;
|
int redirectingreason;
|
||||||
int justsignalling;
|
int justsignalling;
|
||||||
char *useruserinfo;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Internal switch types */
|
/* Internal switch types */
|
||||||
|
|||||||
55
q931.c
55
q931.c
@@ -361,7 +361,7 @@ static FUNC_SEND(transmit_channel_id)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((pri->switchtype != PRI_SWITCH_QSIG) && (call->ds1no > 0)) || call->ds1explicit) {
|
if ((call->ds1no > 0) || call->ds1explicit) {
|
||||||
/* Note that we are specifying the identifier */
|
/* Note that we are specifying the identifier */
|
||||||
ie->data[pos++] |= 0x40;
|
ie->data[pos++] |= 0x40;
|
||||||
/* We need to use the Channel Identifier Present thingy. Just specify it and we're done */
|
/* We need to use the Channel Identifier Present thingy. Just specify it and we're done */
|
||||||
@@ -969,27 +969,6 @@ static FUNC_RECV(receive_user_user)
|
|||||||
return 0;
|
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 char *prog2str(int prog)
|
||||||
{
|
{
|
||||||
static struct msgtype progs[] = {
|
static struct msgtype progs[] = {
|
||||||
@@ -1057,8 +1036,7 @@ static FUNC_RECV(receive_display)
|
|||||||
static FUNC_SEND(transmit_display)
|
static FUNC_SEND(transmit_display)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
if ((pri->switchtype != PRI_SWITCH_NI1) && (pri->switchtype != PRI_SWITCH_QSIG)
|
if ((pri->switchtype != PRI_SWITCH_NI1) && *call->callername) {
|
||||||
&& *call->callername) {
|
|
||||||
i = 0;
|
i = 0;
|
||||||
if(pri->switchtype != PRI_SWITCH_EUROISDN_E1) {
|
if(pri->switchtype != PRI_SWITCH_EUROISDN_E1) {
|
||||||
ie->data[0] = 0xb1;
|
ie->data[0] = 0xb1;
|
||||||
@@ -1948,7 +1926,7 @@ struct ie ies[] = {
|
|||||||
{ 1, Q931_IE_KEYPAD_FACILITY, "Keypad Facility", dump_keypad_facility, receive_keypad_facility },
|
{ 1, Q931_IE_KEYPAD_FACILITY, "Keypad Facility", dump_keypad_facility, receive_keypad_facility },
|
||||||
{ 0, Q931_IE_SIGNAL, "Signal", dump_signal },
|
{ 0, Q931_IE_SIGNAL, "Signal", dump_signal },
|
||||||
{ 1, Q931_IE_SWITCHHOOK, "Switch-hook" },
|
{ 1, Q931_IE_SWITCHHOOK, "Switch-hook" },
|
||||||
{ 1, Q931_IE_USER_USER, "User-User", dump_user_user, receive_user_user, transmit_user_user },
|
{ 1, Q931_IE_USER_USER, "User-User", dump_user_user, receive_user_user },
|
||||||
{ 1, Q931_IE_ESCAPE_FOR_EXT, "Escape for Extension" },
|
{ 1, Q931_IE_ESCAPE_FOR_EXT, "Escape for Extension" },
|
||||||
{ 1, Q931_IE_CALL_STATUS, "Call Status" },
|
{ 1, Q931_IE_CALL_STATUS, "Call Status" },
|
||||||
{ 1, Q931_IE_CHANGE_STATUS, "Change Status" },
|
{ 1, Q931_IE_CHANGE_STATUS, "Change Status" },
|
||||||
@@ -2525,7 +2503,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);
|
return send_message(pri, c, Q931_CALL_PROCEEDING, call_proceeding_ies);
|
||||||
}
|
}
|
||||||
#ifndef ALERTING_NO_PROGRESS
|
#ifndef ALERTING_NO_PROGRESS
|
||||||
static int alerting_ies[] = { Q931_PROGRESS_INDICATOR, Q931_IE_USER_USER, -1 };
|
static int alerting_ies[] = { Q931_PROGRESS_INDICATOR, -1 };
|
||||||
#else
|
#else
|
||||||
static int alerting_ies[] = { -1 };
|
static int alerting_ies[] = { -1 };
|
||||||
#endif
|
#endif
|
||||||
@@ -2648,7 +2626,7 @@ int q931_connect(struct pri *pri, q931_call *c, int channel, int nonisdn)
|
|||||||
return send_message(pri, c, Q931_CONNECT, connect_ies);
|
return send_message(pri, c, Q931_CONNECT, connect_ies);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int release_ies[] = { Q931_CAUSE, Q931_IE_USER_USER, -1 };
|
static int release_ies[] = { Q931_CAUSE, -1 };
|
||||||
|
|
||||||
int q931_release(struct pri *pri, q931_call *c, int cause)
|
int q931_release(struct pri *pri, q931_call *c, int cause)
|
||||||
{
|
{
|
||||||
@@ -2696,7 +2674,7 @@ int q931_restart(struct pri *pri, int channel)
|
|||||||
return send_message(pri, c, Q931_RESTART, restart_ies);
|
return send_message(pri, c, Q931_RESTART, restart_ies);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int disconnect_ies[] = { Q931_CAUSE, Q931_IE_USER_USER, -1 };
|
static int disconnect_ies[] = { Q931_CAUSE, -1 };
|
||||||
|
|
||||||
int q931_disconnect(struct pri *pri, q931_call *c, int cause)
|
int q931_disconnect(struct pri *pri, q931_call *c, int cause)
|
||||||
{
|
{
|
||||||
@@ -2716,7 +2694,7 @@ int q931_disconnect(struct pri *pri, q931_call *c, int cause)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
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,
|
static int setup_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, Q931_IE_FACILITY, Q931_PROGRESS_INDICATOR, Q931_NETWORK_SPEC_FAC, Q931_DISPLAY,
|
||||||
Q931_CALLING_PARTY_NUMBER, Q931_CALLED_PARTY_NUMBER, Q931_REDIRECTING_NUMBER, Q931_SENDING_COMPLETE, Q931_IE_ORIGINATING_LINE_INFO, Q931_IE_GENERIC_DIGITS, -1 };
|
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 };
|
static int gr303_setup_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, -1 };
|
||||||
@@ -2794,9 +2772,6 @@ int q931_setup(struct pri *pri, q931_call *c, struct pri_sr *req)
|
|||||||
} else
|
} else
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (req->useruserinfo)
|
|
||||||
libpri_copy_string(c->useruserinfo, req->useruserinfo, sizeof(c->useruserinfo));
|
|
||||||
|
|
||||||
if (req->nonisdn && (pri->switchtype == PRI_SWITCH_NI2))
|
if (req->nonisdn && (pri->switchtype == PRI_SWITCH_NI2))
|
||||||
c->progressmask = PRI_PROG_CALLER_NOT_ISDN;
|
c->progressmask = PRI_PROG_CALLER_NOT_ISDN;
|
||||||
else
|
else
|
||||||
@@ -2821,7 +2796,7 @@ int q931_setup(struct pri *pri, q931_call *c, struct pri_sr *req)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int release_complete_ies[] = { Q931_IE_USER_USER, -1 };
|
static int release_complete_ies[] = { -1 };
|
||||||
|
|
||||||
static int q931_release_complete(struct pri *pri, q931_call *c, int cause)
|
static int q931_release_complete(struct pri *pri, q931_call *c, int cause)
|
||||||
{
|
{
|
||||||
@@ -3042,7 +3017,6 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
|||||||
case Q931_CONNECT:
|
case Q931_CONNECT:
|
||||||
case Q931_ALERTING:
|
case Q931_ALERTING:
|
||||||
case Q931_PROGRESS:
|
case Q931_PROGRESS:
|
||||||
c->useruserinfo[0] = '\0';
|
|
||||||
c->cause = -1;
|
c->cause = -1;
|
||||||
case Q931_CALL_PROCEEDING:
|
case Q931_CALL_PROCEEDING:
|
||||||
c->progress = -1;
|
c->progress = -1;
|
||||||
@@ -3062,13 +3036,11 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
|||||||
if (c->retranstimer)
|
if (c->retranstimer)
|
||||||
pri_schedule_del(pri, c->retranstimer);
|
pri_schedule_del(pri, c->retranstimer);
|
||||||
c->retranstimer = 0;
|
c->retranstimer = 0;
|
||||||
c->useruserinfo[0] = '\0';
|
|
||||||
break;
|
break;
|
||||||
case Q931_RELEASE_COMPLETE:
|
case Q931_RELEASE_COMPLETE:
|
||||||
if (c->retranstimer)
|
if (c->retranstimer)
|
||||||
pri_schedule_del(pri, c->retranstimer);
|
pri_schedule_del(pri, c->retranstimer);
|
||||||
c->retranstimer = 0;
|
c->retranstimer = 0;
|
||||||
c->useruserinfo[0] = '\0';
|
|
||||||
case Q931_STATUS:
|
case Q931_STATUS:
|
||||||
c->cause = -1;
|
c->cause = -1;
|
||||||
c->causecode = -1;
|
c->causecode = -1;
|
||||||
@@ -3238,8 +3210,6 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
|||||||
pri->ev.ring.callingpres = c->callerpres;
|
pri->ev.ring.callingpres = c->callerpres;
|
||||||
pri->ev.ring.callingplan = c->callerplan;
|
pri->ev.ring.callingplan = c->callerplan;
|
||||||
pri->ev.ring.callingplanani = c->callerplanani;
|
pri->ev.ring.callingplanani = c->callerplanani;
|
||||||
pri->ev.ring.callingplanrdnis = c->redirectingplan;
|
|
||||||
pri->ev.ring.callingplanorigcalled = c->origcalledplan;
|
|
||||||
pri->ev.ring.ani2 = c->ani2;
|
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.callingani, c->callerani, sizeof(pri->ev.ring.callingani));
|
||||||
libpri_copy_string(pri->ev.ring.callingnum, c->callernum, sizeof(pri->ev.ring.callingnum));
|
libpri_copy_string(pri->ev.ring.callingnum, c->callernum, sizeof(pri->ev.ring.callingnum));
|
||||||
@@ -3252,7 +3222,6 @@ 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.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.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.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
|
||||||
c->useruserinfo[0] = '\0';
|
|
||||||
pri->ev.ring.redirectingreason = c->redirectingreason;
|
pri->ev.ring.redirectingreason = c->redirectingreason;
|
||||||
pri->ev.ring.origredirectingreason = c->origredirectingreason;
|
pri->ev.ring.origredirectingreason = c->origredirectingreason;
|
||||||
pri->ev.ring.flexible = ! (c->chanflags & FLAG_EXCLUSIVE);
|
pri->ev.ring.flexible = ! (c->chanflags & FLAG_EXCLUSIVE);
|
||||||
@@ -3278,8 +3247,6 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
|||||||
pri->ev.ringing.call = c;
|
pri->ev.ringing.call = c;
|
||||||
pri->ev.ringing.progress = c->progress;
|
pri->ev.ringing.progress = c->progress;
|
||||||
pri->ev.ringing.progressmask = c->progressmask;
|
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;
|
return Q931_RES_HAVEEVENT;
|
||||||
case Q931_CONNECT:
|
case Q931_CONNECT:
|
||||||
if (c->newcall) {
|
if (c->newcall) {
|
||||||
@@ -3298,8 +3265,6 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
|||||||
pri->ev.answer.call = c;
|
pri->ev.answer.call = c;
|
||||||
pri->ev.answer.progress = c->progress;
|
pri->ev.answer.progress = c->progress;
|
||||||
pri->ev.answer.progressmask = c->progressmask;
|
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);
|
q931_connect_acknowledge(pri, c);
|
||||||
if (c->justsignalling) { /* Make sure WE release when we initiatie a signalling only connection */
|
if (c->justsignalling) { /* Make sure WE release when we initiatie a signalling only connection */
|
||||||
q931_release(pri, c, PRI_CAUSE_NORMAL_CLEARING);
|
q931_release(pri, c, PRI_CAUSE_NORMAL_CLEARING);
|
||||||
@@ -3413,8 +3378,6 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
|||||||
pri->ev.hangup.cref = c->cr;
|
pri->ev.hangup.cref = c->cr;
|
||||||
pri->ev.hangup.cause = c->cause;
|
pri->ev.hangup.cause = c->cause;
|
||||||
pri->ev.hangup.call = c;
|
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 */
|
/* Free resources */
|
||||||
if (c->alive) {
|
if (c->alive) {
|
||||||
pri->ev.e = PRI_EVENT_HANGUP;
|
pri->ev.e = PRI_EVENT_HANGUP;
|
||||||
@@ -3448,8 +3411,6 @@ int q931_receive(struct pri *pri, q931_h *h, int len)
|
|||||||
pri->ev.hangup.cause = c->cause;
|
pri->ev.hangup.cause = c->cause;
|
||||||
pri->ev.hangup.call = c;
|
pri->ev.hangup.call = c;
|
||||||
pri->ev.hangup.aoc_units = c->aoc_units;
|
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
|
/* Don't send release complete if they send us release
|
||||||
while we sent it, assume a NULL state */
|
while we sent it, assume a NULL state */
|
||||||
if (c->newcall)
|
if (c->newcall)
|
||||||
|
|||||||
Reference in New Issue
Block a user