[Asterisk-cvs] libpri-matt pritest.c,1.2,1.3 q931.c,1.4,1.5

mattf at lists.digium.com mattf at lists.digium.com
Fri Dec 10 17:54:40 CST 2004


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

Modified Files:
	pritest.c q931.c 
Log Message:
Receive function needs to be prepared for a signalling only connection


Index: pritest.c
===================================================================
RCS file: /usr/cvsroot/libpri-matt/pritest.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- pritest.c	9 Dec 2004 16:45:08 -0000	1.2
+++ pritest.c	10 Dec 2004 22:52:03 -0000	1.3
@@ -250,9 +250,20 @@
 
 static void handle_pri_event(struct pri *pri, pri_event *e)
 {
+	static q931_call *call = NULL;
+
 	switch(e->e) {
 	case PRI_EVENT_DCHAN_UP:
 		printf("-- D-Channel is now up!  :-)\n");
+		call = pri_new_call(pri);
+		if (!call) {
+			perror("pri_new_call");
+		} else if (pri_mwi_send(pri, call, "1111", PRI_UNKNOWN,
+					"Joe Schmoe",
+					PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN,
+					"5737", /* Don's number */
+					PRI_UNKNOWN, 1))
+			perror("pri_mwi_send");
 		break;
 	case PRI_EVENT_DCHAN_DOWN:
 		printf("-- D-Channel is now down! :-(\n");
@@ -287,6 +298,9 @@
 		}
 		
 		break;
+	case PRI_EVENT_PROCEEDING:
+		printf("-- Got proceeding on channel %d\n", e->ring.channel);
+		break;
 	default:
 		fprintf(stderr, "--!! Unknown PRI event %d\n", e->e);
 	}

Index: q931.c
===================================================================
RCS file: /usr/cvsroot/libpri-matt/q931.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- q931.c	9 Dec 2004 18:15:24 -0000	1.4
+++ q931.c	10 Dec 2004 22:52:03 -0000	1.5
@@ -268,9 +268,15 @@
  	}
 #endif
 #ifndef NOAUTO_CHANNEL_SELECTION_SUPPORT
-	if ((ie->data[0] & 3) != 1) {
-		pri_error("!! Unexpected Channel selection %d\n", ie->data[0] & 3);
-		return -1;
+	switch (ie->data[0] & 3) {
+		case 0:
+			call->justsignalling = 1;
+			break;
+		case 1:
+			break;
+		default:
+			pri_error("!! Unexpected Channel selection %d\n", ie->data[0] & 3);
+			return -1;
 	}
 #endif
 	if (ie->data[0] & 0x08)




More information about the svn-commits mailing list