[Asterisk-cvs] libpri-matt libpri.h, 1.3, 1.4 pri_facility.c, 1.4, 1.5 pri_internal.h, 1.5, 1.6 q931.c, 1.5, 1.6

mattf at lists.digium.com mattf at lists.digium.com
Wed Dec 15 16:12:23 CST 2004


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

Modified Files:
	libpri.h pri_facility.c pri_internal.h q931.c 
Log Message:
origredirectingreason converted to q.931 redirect reason


Index: libpri.h
===================================================================
RCS file: /usr/cvsroot/libpri-matt/libpri.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- libpri.h	7 Dec 2004 17:46:05 -0000	1.3
+++ libpri.h	15 Dec 2004 21:09:03 -0000	1.4
@@ -295,8 +295,8 @@
 	q931_call *call;			/* Opaque call pointer */
 	char callingsubaddr[256];		/* Calling parties subaddress */
 	/* New fields for additional data in facility IEs */
-	char origcallername[256];
-	char origcallernum[256];
+	char origcalledname[256];
+	char origcallednum[256];
 	int redirectingreason;
 	int origredirectingreason;
 	char redirectingname[256];

Index: pri_facility.c
===================================================================
RCS file: /usr/cvsroot/libpri-matt/pri_facility.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pri_facility.c	15 Dec 2004 16:23:01 -0000	1.4
+++ pri_facility.c	15 Dec 2004 21:09:03 -0000	1.5
@@ -120,26 +120,30 @@
 							break;
 						switch (comp->type&0x1f) {
 							case 0x00: /* Original diversion reason */
-								call->origredirectingreason = comp->data[0];
-								pri_message("Found original diversion reason\n");
+								call->origredirectingreason = redirectingreason_qsig2q931(comp->data[0]);
+								pri_message("Found original diversion reason %d\n", call->origredirectingreason);
+								i += (2+comp->len);
 								break;
 							case 0x01: /* diverting number */
 								pri_message("Found diverting number\n");
-								strncpy(call->redirectingnum, comp->data, strlen(comp->data));
+								strncpy(call->redirectingnum, comp->data + 4, strlen(comp->data));
+								i += (2+4+strlen(call->redirectingnum)+4);
 								break;
 							case 0x02: /* TODO: Originally called number */
 								pri_message("Found originally called number\n");
+								strncpy(call->origcallednum, comp->data + 4, strlen(comp->data));
+								i += (2+4+strlen(call->origcallednum)+4);
 								break;
 							case 0x03: /* redirecting name */
 								strncpy(call->redirectingname, comp->data+2, 50);
 								pri_message("Found redirecting name (%s)\n", call->redirectingname);
+								i += (2+2+strlen(call->redirectingname)+2);
 								break;
 							case 0x04: /* TODO: origianlly called name */
-								strncpy(call->origcallername, comp->data+2, 50);
-								pri_message("Found originally called name (%s)\n", call->origcallername);
+								strncpy(call->origcalledname, comp->data+2, 50);
+								pri_message("Found originally called name (%s)\n", call->origcalledname);
 								break;
 						}
-						i += (2+comp->len);
 					}
 				}
 				return 0;

Index: pri_internal.h
===================================================================
RCS file: /usr/cvsroot/libpri-matt/pri_internal.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- pri_internal.h	9 Dec 2004 16:45:08 -0000	1.5
+++ pri_internal.h	15 Dec 2004 21:09:03 -0000	1.6
@@ -197,8 +197,8 @@
 	int redirectingpres;
 	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 origcallernum[256];		/* Orignal number of person being called */
+	char origcalledname[256];	/* Original name of person being called */
+	char origcallednum[256];		/* Orignal number of person being called */
 	char redirectingnum[256];	/* Number of redirecting party */
 	char redirectingname[256];	/* Name of redirecting party */
 

Index: q931.c
===================================================================
RCS file: /usr/cvsroot/libpri-matt/q931.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- q931.c	10 Dec 2004 22:52:03 -0000	1.5
+++ q931.c	15 Dec 2004 21:09:03 -0000	1.6
@@ -2783,8 +2783,8 @@
 		c->origredirectingreason = -1;
 		strcpy(c->redirectingnum, "");
 		strcpy(c->redirectingname, "");
-		strcpy(c->origcallername, "");
-		strcpy(c->origcallernum, "");
+		strcpy(c->origcalledname, "");
+		strcpy(c->origcallednum, "");
                 c->useruserprotocoldisc = -1; 
 		strcpy(c->useruserinfo, "");
 		c->complete = 0;
@@ -2982,8 +2982,8 @@
 		pri->ev.ring.calledplan = c->calledplan;
 		strncpy(pri->ev.ring.callingsubaddr, c->callingsubaddr, sizeof(pri->ev.ring.callingsubaddr) - 1);
 		strncpy(pri->ev.ring.callednum, c->callednum, sizeof(pri->ev.ring.callednum) - 1);
-		strncpy(pri->ev.ring.origcallername, c->origcallername, sizeof(pri->ev.ring.origcallername) - 1);
-		strncpy(pri->ev.ring.origcallernum, c->origcallernum, sizeof(pri->ev.ring.origcallernum) - 1);
+		strncpy(pri->ev.ring.origcalledname, c->origcalledname, sizeof(pri->ev.ring.origcalledname) - 1);
+		strncpy(pri->ev.ring.origcallednum, c->origcallednum, sizeof(pri->ev.ring.origcallednum) - 1);
 		pri->ev.ring.origredirectingreason = c->origredirectingreason;
                 strncpy(pri->ev.ring.redirectingnum, c->redirectingnum, sizeof(pri->ev.ring.redirectingnum) - 1);
 		strncpy(pri->ev.ring.redirectingname, c->redirectingname, sizeof(pri->ev.ring.redirectingname) - 1);




More information about the svn-commits mailing list