[libss7-commits] mattf: trunk r10 - in /trunk: README isup.c isup.h

libss7-commits at lists.digium.com libss7-commits at lists.digium.com
Fri Aug 11 17:55:01 MST 2006


Author: mattf
Date: Fri Aug 11 19:55:01 2006
New Revision: 10

URL: http://svn.digium.com/view/libss7?rev=10&view=rev
Log:
Add continuity and continuity check request messages

Modified:
    trunk/README
    trunk/isup.c
    trunk/isup.h

Modified: trunk/README
URL: http://svn.digium.com/view/libss7/trunk/README?rev=10&r1=9&r2=10&view=diff
==============================================================================
--- trunk/README (original)
+++ trunk/README Fri Aug 11 19:55:01 2006
@@ -7,6 +7,11 @@
 allow support for ANSI as well as the various national specific variants
 in the future.  For a working reference implementation, see the various
 link test programs, as well as the Asterisk Open Source PBX.
+
+License:
+========
+libss7 is covered under the GPL (Gnu Public License) version 2.  For more
+information, see http://www.gnu.org/
 
 TODO:
 =====

Modified: trunk/isup.c
URL: http://svn.digium.com/view/libss7/trunk/isup.c?rev=10&r1=9&r2=10&view=diff
==============================================================================
--- trunk/isup.c (original)
+++ trunk/isup.c Fri Aug 11 19:55:01 2006
@@ -43,7 +43,7 @@
 };
 
 static int iam_params[] = {ISUP_PARM_NATURE_OF_CONNECTION_IND, ISUP_PARM_FORWARD_CALL_IND, ISUP_PARM_CALLING_PARTY_CAT,
-	ISUP_PARM_TRANSMISSION_MEDIUM_REQS, ISUP_PARM_CALLED_PARTY_NUM, ISUP_PARM_CALLING_PARTY_NUM, -1}; /* Don't have optional IEs */
+	ISUP_PARM_TRANSMISSION_MEDIUM_REQS, ISUP_PARM_USER_SERVICE_INFO, ISUP_PARM_CALLED_PARTY_NUM, ISUP_PARM_CALLING_PARTY_NUM, -1}; /* Don't have optional IEs */
 
 static int acm_params[] = {ISUP_PARM_BACKWARD_CALL_IND, -1};
 
@@ -56,6 +56,10 @@
 static int rlc_params[] = { -1};
 
 static int grs_params[] = { ISUP_PARM_RANGE_AND_STATUS, -1};
+
+static int cot_params[] = { ISUP_PARM_CONTINUITY_IND, -1};
+
+static int ccr_params[] = { -1};
 
 static struct message_data {
 	int messagetype;
@@ -72,6 +76,8 @@
 	{ISUP_RLC, 0, 0, 1, rlc_params},
 	{ISUP_GRS, 0, 1, 0, grs_params},
 	{ISUP_GRA, 0, 1, 0, grs_params},
+	{ISUP_COT, 1, 0, 0, cot_params},
+	{ISUP_CCR, 0, 0, 0, ccr_params},
 };
 
 static int isup_send_message(struct ss7 *ss7, struct isup_call *c, int messagetype, int parms[]);
@@ -93,6 +99,10 @@
 			return "GRS";
 		case ISUP_GRA:
 			return "GRA";
+		case ISUP_COT:
+			return "COT";
+		case ISUP_CCR:
+			return "CCR";
 		default:
 			return "Unknown";
 	}
@@ -209,8 +219,6 @@
 
 static FUNC_RECV(nature_of_connection_ind_receive)
 {
-	c->echocan = (parm[0] & 0x10) >> 4;
-	c->satellites = parm[0] & 0x3;
 	return 1;
 }
 
@@ -249,34 +257,18 @@
 static FUNC_SEND(forward_call_ind_transmit)
 {
 	parm[0] = 0x60;
-
-#if 0
-	if (c->international)
-		parm[0] |= 0x01;
-#endif
-
 	parm[1] = 0x01;
-
-#if 0
-	if (c->originatedisdn)
-		parm[1] |= 0x01;
-#endif
 	
 	return 2;
 }
 
 static FUNC_RECV(forward_call_ind_receive)
 {
-#if 0
-	c->international = parm[0] & 0x01;
-	c->originatedisdn = parm[1] & 0x01;
-#endif
 	return 2;
 }
 
 static FUNC_RECV(calling_party_cat_receive)
 {
-	/* TODO */
 	return 1;
 }
 	
@@ -294,6 +286,10 @@
 
 static FUNC_SEND(user_service_info_transmit)
 {
+	/* Don't include if it's an ITU style network */
+	if (ss7->switchtype != SS7_ANSI)
+		return 0;
+
 	parm[0] = 0x80; /* Default to ITU standardized coding */
 	parm[0] |= c->transcap;
 
@@ -306,6 +302,9 @@
 
 static FUNC_SEND(transmission_medium_reqs_transmit)
 {
+	/* Don't include transmission medium requirements in an ANSI environment */
+	if (ss7->switchtype != SS7_ITU)
+		return 0;
 	/* Speech */
 	parm[0] = 0;
 	return 1;
@@ -348,11 +347,6 @@
 
 static FUNC_RECV(backward_call_ind_receive)
 {
-	if (parm[1] & 0x20)
-		c->echocan = 1;
-	else 
-		c->echocan = 0;
-
 	return 2;
 }
 
@@ -360,8 +354,6 @@
 {
 	parm[0] = 0x40;
 	parm[1] = 0x14;
-	if (c->echocan)
-		parm[1] |= 0x20;
 	return 2;
 }
 
@@ -457,6 +449,33 @@
 	parm[1] = 0x11;
 
 	return datalen + 2;
+}
+
+static FUNC_SEND(continuity_ind_transmit)
+{
+	if (c->cot_check_passed)
+		parm[0] = 0x01;
+	else
+		parm[0] = 0x00;
+
+	return 1;
+}
+
+static FUNC_RECV(continuity_ind_receive)
+{
+	if (0x1 & parm[0])
+		c->cot_check_passed = 1;
+	else
+		c->cot_check_passed = 0;
+	return 1;
+}
+
+static FUNC_DUMP(continuity_ind_dump)
+{
+	ss7_message(ss7, "PARM: Continuity Indicator\n");
+	ss7_message(ss7, "Continuity Check: %s\n", (0x01 & parm[0]) ? "successful" : "failed");
+
+	return 1;
 }
 
 static struct parm_func parms[] = {
@@ -467,6 +486,7 @@
 	{ISUP_PARM_USER_SERVICE_INFO, "User Service Information", NULL, user_service_info_receive, user_service_info_transmit},
 	{ISUP_PARM_CALLED_PARTY_NUM, "Called Party Number", NULL, called_party_num_receive, called_party_num_transmit},
 	{ISUP_PARM_CAUSE, "Cause Indicator", NULL, cause_receive, cause_transmit},
+	{ISUP_PARM_CONTINUITY_IND, "Continuity Indicator", continuity_ind_dump, continuity_ind_receive, continuity_ind_transmit},
 	{ISUP_PARM_ACCESS_TRANS, "Access Transport"},
 	{ISUP_PARM_BUSINESS_GRP, "Business Group"},
 	{ISUP_PARM_CALL_REF, "Call Reference"},

Modified: trunk/isup.h
URL: http://svn.digium.com/view/libss7/trunk/isup.h?rev=10&r1=9&r2=10&view=diff
==============================================================================
--- trunk/isup.h (original)
+++ trunk/isup.h Fri Aug 11 19:55:01 2006
@@ -85,6 +85,7 @@
 #define ISUP_PARM_CHARGE_NUMBER 0xeb
 #define ISUP_PARM_CIRCUIT_ASSIGNMENT_MAP 0x25
 #define ISUP_PARM_CONNECTION_REQ 0x0d
+#define ISUP_PARM_CONTINUITY_IND 0x10
 #define ISUP_PARM_CUG_INTERLOCK_CODE 0x1c
 #define ISUP_PARM_EGRESS_SERV 0xc3
 #define ISUP_PARM_GENERIC_ADDR 0xc0
@@ -117,15 +118,13 @@
 	char called_party_num[ISUP_MAX_NUM];
 	char calling_party_num[ISUP_MAX_NUM];
 	int range;
-	int echocan;
-	int satellites;
 	int international;
-	int originatedisdn;
 	int transcap;
 	int l1prot;
 	int cause;
 	int causecode;
 	int causeloc;
+	int cot_check_passed;
 	unsigned short cic;
 	unsigned short slc;
 	struct isup_call *next;



More information about the libss7-commits mailing list