[Asterisk-cvs] libpri-matt pri.c, 1.3, 1.4 pri_facility.c, 1.10, 1.11 pri_facility.h, 1.8, 1.9 pritest.c, 1.4, 1.5 q931.c, 1.12, 1.13

mattf at lists.digium.com mattf at lists.digium.com
Wed Jan 12 19:54:05 CST 2005


Update of /usr/cvsroot/libpri-matt
In directory mongoose.digium.com:/tmp/cvs-serv16214

Modified Files:
	pri.c pri_facility.c pri_facility.h pritest.c q931.c 
Log Message:
More changes for MWI


Index: pri.c
===================================================================
RCS file: /usr/cvsroot/libpri-matt/pri.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- pri.c	27 Dec 2004 21:43:08 -0000	1.3
+++ pri.c	13 Jan 2005 01:58:05 -0000	1.4
@@ -24,6 +24,7 @@
 #include "pri_q921.h"
 #include "pri_q931.h"
 #include "pri_timers.h"
+#include "pri_facility.h"
 
 char *pri_node2str(int node)
 {
@@ -489,6 +490,8 @@
 	req.calledplan = calledplan;
 
 	c->mwi_state = MWI_STATE_ACT_SEND;
+
+	mwi_activate_encode_and_queue(c, &req);
 	
 	/* Do more stuff when we figure out that the CISC stuff works */
 	return q931_setup(pri, c, &req);

Index: pri_facility.c
===================================================================
RCS file: /usr/cvsroot/libpri-matt/pri_facility.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- pri_facility.c	13 Jan 2005 00:32:26 -0000	1.10
+++ pri_facility.c	13 Jan 2005 01:58:05 -0000	1.11
@@ -48,11 +48,11 @@
 	return;
 }
 
-int mwi_activate_encode_and_queue(q931_call *call)
+int mwi_activate_encode_and_queue(q931_call *call, struct pri_sr *req)
 {
 	int res = 0, i = 0;
 	unsigned char * buffer = NULL;
-	int destlen = strlen(call->callednum);
+	int destlen = strlen(req->called);
 	/* TODO:1 */
 
 	buffer = malloc(255);
@@ -70,12 +70,13 @@
 		+ destlen;
 	buffer[i++] = 0x80; /* PartyNumber */
 	buffer[i++] = destlen;
-	strncpy(&buffer[i], call->callednum, destlen);
+	strncpy(&buffer[i], req->called, destlen);
 	i += destlen;
 	buffer[i++] = 0xa; /* Enumeration: basicService */
 	buffer[i++] = 0x1; /* Length */
 	buffer[i++] = 0x1; /* contents: Voice */
 	
+	pri_message("!!!!!!!!!!!!!!!! length of buffer is %d\n", i);
 	
 	res = pri_call_adpu_queue(call, Q931_SETUP, buffer, i, mwi_activate_encode_cb, buffer);
 

Index: pri_facility.h
===================================================================
RCS file: /usr/cvsroot/libpri-matt/pri_facility.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- pri_facility.h	13 Jan 2005 00:32:26 -0000	1.8
+++ pri_facility.h	13 Jan 2005 01:58:05 -0000	1.9
@@ -113,7 +113,7 @@
 #define FUNC_SEND(name) int ((name))(int full_ie, struct pri *pri, q931_call *call, int msgtype, q931_ie *ie, int len)
 extern FUNC_SEND(transmit_facility);
 extern FUNC_RECV(receive_facility);
-int mwi_activate_encode_and_queue(q931_call *call);
+int mwi_activate_encode_and_queue(q931_call *call, struct pri_sr *req);
 void mwi_activate_encode_cb(void *data);
 
 #endif /* _PRI_FACILITY_H */

Index: pritest.c
===================================================================
RCS file: /usr/cvsroot/libpri-matt/pritest.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pritest.c	28 Dec 2004 17:35:11 -0000	1.4
+++ pritest.c	13 Jan 2005 01:58:05 -0000	1.5
@@ -260,11 +260,11 @@
 		call = pri_new_call(pri);
 		if (!call) {
 			perror("pri_new_call");
-		} else if (pri_mwi_send(pri, call, "1111", PRI_UNKNOWN,
+		} else if (pri_mwi_activate(pri, call, "1111", PRI_UNKNOWN,
 					"Joe Schmoe",
 					PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN,
 					"5737", /* Don's number */
-					PRI_UNKNOWN, 1))
+					PRI_UNKNOWN))
 			perror("pri_mwi_send");
 		break;
 	case PRI_EVENT_DCHAN_DOWN:

Index: q931.c
===================================================================
RCS file: /usr/cvsroot/libpri-matt/q931.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- q931.c	13 Jan 2005 01:57:08 -0000	1.12
+++ q931.c	13 Jan 2005 01:58:05 -0000	1.13
@@ -1430,6 +1430,8 @@
 	struct rose_component *comp = NULL;
 	int i = 0;
 
+	pri_message("transmit_facility\n");
+
 	while (tmp) {
 		if (tmp->message == msgtype)
 			break;
@@ -1455,6 +1457,8 @@
 	memcpy(comp->data, tmp->adpu, tmp->adpu_len);
 	i += tmp->adpu_len;
 
+	pri_message("Length of ADPU is %d.  IE is %d\n", tmp->adpu_len, i - tmp->adpu_len);
+
 	return i + 2;
 }
 
@@ -2115,9 +2119,11 @@
 	codeset = 0;
 	while(ies[x] > -1) {
 		if (x == Q931_IE_FACILITY) {
+			pri_message("!!!!!!!!!!!!!!!!!!!!!!!!! send_message:Found facilityIE\n");
 			res = 0;
 			while (facevent) {
 				if (!facevent->sent && (facevent->message == msgtype)) { 
+					pri_message("!!!!!!!!!!!!!!!!!!!!!!! Going to send\n");
 					int tmpres;
 					tmpres = add_ie(pri, c, mh->msg, ies[x], (q931_ie *)(mh->data + offset), len, &codeset);
 					if (tmpres < 0) {
@@ -2450,7 +2456,7 @@
 
 static int gr303_setup_ies[] =  { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, -1 };
 
-static int cis_setup_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, Q931_CALLED_PARTY_NUMBER, -1 };
+static int cis_setup_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, Q931_CALLED_PARTY_NUMBER, Q931_IE_FACILITY, -1 };
 
 int q931_setup(struct pri *pri, q931_call *c, struct pri_sr *req)
 {




More information about the svn-commits mailing list