[Asterisk-cvs] libpri pri_facility.c,1.9,1.10

mattf at lists.digium.com mattf at lists.digium.com
Thu Apr 21 15:07:40 CDT 2005


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

Modified Files:
	pri_facility.c 
Log Message:
Round two with CPE callername sending


Index: pri_facility.c
===================================================================
RCS file: /usr/cvsroot/libpri/pri_facility.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- pri_facility.c	6 Apr 2005 19:42:41 -0000	1.9
+++ pri_facility.c	21 Apr 2005 19:58:14 -0000	1.10
@@ -633,7 +633,7 @@
 }
 
 /* Sending callername information functions */
-static int add_callername_facility_ies(struct pri *pri, q931_call *c)
+static int add_callername_facility_ies(struct pri *pri, q931_call *c, int cpe)
 {
 	int res = 0;
 	int i = 0;
@@ -680,8 +680,10 @@
 	ASN1_ADD_BYTECOMP(comp, ASN1_ENUMERATED, buffer, i, 0);
 	ASN1_FIXUP(compstk, compsp, buffer, i);
 
-	if (pri_call_apdu_queue(c, Q931_SETUP, buffer, i, NULL, NULL))
-		return -1;
+	if (!cpe) {
+		if (pri_call_apdu_queue(c, Q931_SETUP, buffer, i, NULL, NULL))
+			return -1;
+	}
 
 
 	/* Now the ADPu that contains the information that needs sent.
@@ -716,7 +718,7 @@
 
 	res = asn1_string_encode((ASN1_CONTEXT_SPECIFIC | ASN1_TAG_0), &buffer[i], sizeof(buffer)-i,  50, c->callername, namelen);
 	if (res < 0)
-	  return -1;
+		return -1;
 	i += res;
 	ASN1_FIXUP(compstk, compsp, buffer, i);
 
@@ -1236,12 +1238,21 @@
 	if (pri->localtype == PRI_NETWORK) {
 		switch (pri->switchtype) {
 			case PRI_SWITCH_NI2:
-				add_callername_facility_ies(pri, call);
+				add_callername_facility_ies(pri, call, 0);
+				break;
+			default:
+				break;
+		}
+	} else if (pri->localtype == PRI_CPE) {
+		switch (pri->switchtype) {
+			case PRI_SWITCH_NI2:
+				add_callername_facility_ies(pri, call, 1);
 				break;
 			default:
 				break;
 		}
 	}
+
 	return 0;
 }
 




More information about the svn-commits mailing list