[Asterisk-cvs] libpri-matt pri_facility.c, 1.1.1.1, 1.2 pri_facility.h, 1.1.1.1, 1.2 pri_internal.h, 1.1.1.1, 1.2

mattf at lists.digium.com mattf at lists.digium.com
Wed Nov 10 11:56:14 CST 2004


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

Modified Files:
	pri_facility.c pri_facility.h pri_internal.h 
Log Message:
Changes to get the rest of the fields in the PRI Divertingleginformation2 message


Index: pri_facility.c
===================================================================
RCS file: /usr/cvsroot/libpri-matt/pri_facility.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- pri_facility.c	5 Nov 2004 19:23:15 -0000	1.1.1.1
+++ pri_facility.c	10 Nov 2004 16:57:39 -0000	1.2
@@ -20,7 +20,7 @@
 	int i = 0;
 	unsigned char *vdata = data;
 	struct rose_component *comp = NULL, *invokeid = NULL, *operationid = NULL;
-	unsigned char divcounter = 0, divreason = 0;
+	unsigned char divcounter = 0;
 
 	pri_message("Executing rose_invoke_decode\n");
 	do {
@@ -86,8 +86,8 @@
 					if (i+1 >= seq_end) return -1;
 					comp = (struct rose_component*)&vdata[i];
 					if (((comp->type&0x1f) == ASN1_ENUMERATED) && comp->len == 1) {
-						divreason = comp->data[0];
-						pri_message("Diversion Reason: %d\n", divreason);
+						call->redirectingreason = comp->data[0];
+						pri_message("Diversion Reason: %d\n", call->redirectingreason);
 					} else {
 						pri_message("Missing mandatory diversionReason in operation 0x%X\n", operationid->type);
 						return -1;
@@ -101,21 +101,29 @@
 						if (lookforendofseq && (vdata[i] == 0x00) && (vdata[i+1] == 0x00))
 							break;
 						switch (comp->type&0x1f) {
-							case 0x00:
+							case 0x00: /* Original diversion reason */
+								call->origredirectingreason = comp->data[0];
+								pri_message("Found original diversion reason\n");
 								break;
-							case 0x01:
+							case 0x01: /* diverting number */
+								pri_message("Found diverting number\n");
 								break;
-							case 0x02:
+							case 0x02: /* TODO: Originally called number */
+								pri_message("Found originally called number\n");
 								break;
-							case 0x03:
+							case 0x03: /* redirecting name */
+								strncpy(call->redirectingname, comp->data+2, 50);
+								pri_message("Found redirecting name (%s)\n", call->redirectingname);
 								break;
-							case 0x04:
+							case 0x04: /* TODO: origianlly called name */
+								strncpy(call->origcallername, comp->data+2, 50);
+								pri_message("Found originally called name (%s)\n", call->origcallername);
 								break;
 						}
 						i += (2+comp->len);
 					}
 				}
-				break;
+				return 0;
 			default:
 				pri_message("Found unrecognzied operation of type 0x%X\n", operationid->data[0]);
 				break;

Index: pri_facility.h
===================================================================
RCS file: /usr/cvsroot/libpri-matt/pri_facility.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- pri_facility.h	5 Nov 2004 19:23:20 -0000	1.1.1.1
+++ pri_facility.h	10 Nov 2004 16:57:39 -0000	1.2
@@ -83,7 +83,7 @@
 	if (&((data)[(idx)])) \
 		(component) = (struct rose_component*)&((data)[idx]); \
 	else pri_message("Data not there for GET_COMPONENT\n"); \
-	if (((idx)+1 >= (length)) || ((idx)+(component)->len+2 > (length))) pri_message("Length (%d) of 0x%X component is too long\n", (component)->len, (component)->type);
+	if (((idx)+1 >= (length)) || ((idx)+(component)->len+2 > (length))) if ((component)->len != 128) pri_message("Length (%d) of 0x%X component is too long\n", (component)->len, (component)->type);
 
 #define NEXT_COMPONENT(component, idx) \
 	(idx) += (component)->len + 2

Index: pri_internal.h
===================================================================
RCS file: /usr/cvsroot/libpri-matt/pri_internal.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- pri_internal.h	5 Nov 2004 19:23:14 -0000	1.1.1.1
+++ pri_internal.h	10 Nov 2004 16:57:39 -0000	1.2
@@ -193,8 +193,12 @@
 	int t308_timedout;		/* Whether t308 timed out once */
 	int redirectingplan;
 	int redirectingpres;
-	int redirectingreason;	      
-	char redirectingnum[256];
+	int redirectingreason;	      	/* Reason for redirect */
+	int origredirectingreason;      /* Original reason for redirect (in cases of multiple redirects) */
+	char origcallername[256];	/* Original name of person being called */
+	char origcallnum[256];		/* Orignal number of person being called */
+	char redirectingnum[256];	/* Number of redirecting party */
+	char redirectingname[256];	/* Name of redirecting party */
 
         int useruserprotocoldisc;
 	char useruserinfo[256];




More information about the svn-commits mailing list