[Asterisk-cvs] libpri libpri.h,1.29,1.30 q931.c,1.78,1.79

markster at lists.digium.com markster at lists.digium.com
Fri Jun 25 15:47:19 CDT 2004


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

Modified Files:
	libpri.h q931.c 
Log Message:
Add subaddress support


Index: libpri.h
===================================================================
RCS file: /usr/cvsroot/libpri/libpri.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- libpri.h	16 Jun 2004 15:33:58 -0000	1.29
+++ libpri.h	25 Jun 2004 19:33:12 -0000	1.30
@@ -269,6 +269,7 @@
 	int layer1;				/* User layer 1 */
 	int complete;				/* Have we seen "Complete" i.e. no more number? */
 	q931_call *call;			/* Opaque call pointer */
+	char callingsubaddr[256];		/* Calling parties subaddress */
 } pri_event_ring;
 
 typedef struct pri_event_hangup {
@@ -456,6 +457,7 @@
 #define PRI_GR303_SUPPORT
 #define PRI_ENSLAVE_SUPPORT
 #define PRI_SETUP_CALL
+#define PRI_RECEIVE_SUBADDR
 #endif
 
 /* Send notification */

Index: q931.c
===================================================================
RCS file: /usr/cvsroot/libpri/q931.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- q931.c	24 Jun 2004 13:43:36 -0000	1.78
+++ q931.c	25 Jun 2004 19:33:12 -0000	1.79
@@ -252,6 +252,7 @@
 
         int useruserprotocoldisc;
 	char useruserinfo[256];
+	char callingsubaddr[256];	/* Calling parties sub address */
 };
 
 #define FUNC_DUMP(name) void ((name))(int full_ie, q931_ie *ie, int len, char prefix)
@@ -865,6 +866,13 @@
 		(ie->data[0] & 0x08) >> 3, cnum);
 }
 
+static FUNC_RECV(receive_calling_party_subaddr)
+{
+	/* copy digits to call->callingsubaddr */
+ 	q931_get_number(call->callingsubaddr, sizeof(call->callingsubaddr), ie->data + 2, len - 4);
+	return 0;
+}
+
 static FUNC_RECV(receive_called_party_number)
 {
 	/* copy digits to call->callednum */
@@ -1378,7 +1386,7 @@
 	{ Q931_CLOSED_USER_GROUP, "Closed User Group" },
 	{ Q931_REVERSE_CHARGE_INDIC, "Reverse Charging Indication" },
 	{ Q931_CALLING_PARTY_NUMBER, "Calling Party Number", dump_calling_party_number, receive_calling_party_number, transmit_calling_party_number },
-	{ Q931_CALLING_PARTY_SUBADDR, "Calling Party Subaddress", dump_calling_party_subaddr },
+	{ Q931_CALLING_PARTY_SUBADDR, "Calling Party Subaddress", dump_calling_party_subaddr, receive_calling_party_subaddr },
 	{ Q931_CALLED_PARTY_NUMBER, "Called Party Number", dump_called_party_number, receive_called_party_number, transmit_called_party_number },
 	{ Q931_CALLED_PARTY_SUBADDR, "Called Party Subaddress", dump_called_party_subaddr },
 	{ Q931_REDIRECTING_NUMBER, "Redirecting Number", dump_redirecting_number, receive_redirecting_number },
@@ -2575,6 +2583,7 @@
 		strncpy(pri->ev.ring.callingnum, c->callernum, sizeof(pri->ev.ring.callingnum) - 1);
 		strncpy(pri->ev.ring.callingname, c->callername, sizeof(pri->ev.ring.callingname) - 1);
 		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.redirectingnum, c->redirectingnum, sizeof(pri->ev.ring.redirectingnum) - 1);
                 strncpy(pri->ev.ring.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo) - 1);
@@ -2802,6 +2811,7 @@
 		pri->ev.ring.call = c;
 		pri->ev.ring.channel = c->channelno | (c->ds1no << 8);
 		strncpy(pri->ev.ring.callednum, c->callednum, sizeof(pri->ev.ring.callednum) - 1);
+		strncpy(pri->ev.ring.callingsubaddr, c->callingsubaddr, sizeof(pri->ev.ring.callingsubaddr) - 1);
 		pri->ev.ring.complete = c->complete; 	/* this covers IE 33 (Sending Complete) */
 		return Q931_RES_HAVEEVENT;
 		break;




More information about the svn-commits mailing list