[libss7-commits] mattf: branch mattf/libss7-ss7cluster r284 - /team/mattf/libss7-ss7cluster/

SVN commits to the libss7 project libss7-commits at lists.digium.com
Wed Feb 24 14:39:06 CST 2010


Author: mattf
Date: Wed Feb 24 14:39:03 2010
New Revision: 284

URL: http://svnview.digium.com/svn/libss7?view=rev&rev=284
Log:
Merge in suspend resume support, as well as ANSI SLTM/SLTA fix.

Modified:
    team/mattf/libss7-ss7cluster/isup.c
    team/mattf/libss7-ss7cluster/isup.h
    team/mattf/libss7-ss7cluster/libss7.h
    team/mattf/libss7-ss7cluster/mtp3.c

Modified: team/mattf/libss7-ss7cluster/isup.c
URL: http://svnview.digium.com/svn/libss7/team/mattf/libss7-ss7cluster/isup.c?view=diff&rev=284&r1=283&r2=284
==============================================================================
--- team/mattf/libss7-ss7cluster/isup.c (original)
+++ team/mattf/libss7-ss7cluster/isup.c Wed Feb 24 14:39:03 2010
@@ -88,6 +88,8 @@
 static int cicgroup_params[] = { ISUP_PARM_CIRCUIT_GROUP_SUPERVISION_IND, ISUP_PARM_RANGE_AND_STATUS, -1};
 
 static int cqr_params[] = { ISUP_PARM_RANGE_AND_STATUS, ISUP_PARM_CIRCUIT_STATE_IND, -1};
+
+static int sus_res_params[] = { ISUP_PARM_SUSPEND_RESUME_IND, -1};
 
 static int empty_params[] = { -1};
 
@@ -126,7 +128,9 @@
 	{ISUP_CQR, 0, 2, 0, cqr_params},
 	{ISUP_FAA, 1, 0, 1, faa_params},
 	{ISUP_FAR, 1, 0, 1, far_params},
-	{ISUP_CFN, 0, 1, 0, rel_params}
+	{ISUP_CFN, 0, 1, 0, rel_params},
+	{ISUP_SUS, 1, 0, 1, sus_res_params},
+	{ISUP_RES, 1, 0, 1, sus_res_params}
 };
 
 static int isup_send_message(struct ss7 *ss7, struct isup_call *c, int messagetype, int parms[]);
@@ -188,6 +192,10 @@
 			return "CVR";
 		case ISUP_CFN:
 			return "CFN";
+		case ISUP_SUS:
+			return "SUS";
+		case ISUP_RES:
+			return "RES";
 		default:
 			return "Unknown";
 	}
@@ -1972,6 +1980,18 @@
 	return len;	
 }	
 
+static FUNC_DUMP(suspend_resume_ind_dump)
+{
+	int indicator = parm[0] & 1;
+	ss7_message(ss7, "\t\t\t%s (%d)", indicator ? "Network initiated" : "ISDN Subscriber initiated", indicator);
+	return 1;	
+}	
+
+static FUNC_RECV(suspend_resume_ind_receive)
+{
+	c->network_isdn_indicator = parm[0] & 1;
+	return 1;	
+}	
 
 static struct parm_func parms[] = {
 	{ISUP_PARM_NATURE_OF_CONNECTION_IND, "Nature of Connection Indicator", nature_of_connection_ind_dump, nature_of_connection_ind_receive, nature_of_connection_ind_transmit },
@@ -2018,6 +2038,7 @@
 	{ISUP_PARM_FACILITY_IND, "Facility Indicator", facility_ind_dump, facility_ind_receive, facility_ind_transmit},
 	{ISUP_PARM_REDIRECTING_NUMBER, "Redirecting Number", redirecting_number_dump, redirecting_number_receive, redirecting_number_transmit},
 	{ISUP_PARM_ACCESS_DELIVERY_INFO, "Access Delivery Information", },
+	{ISUP_PARM_SUSPEND_RESUME_IND, "Suspend/Resume Indicators", suspend_resume_ind_dump, suspend_resume_ind_receive},
 };
 
 static char * param2str(int parm)
@@ -3070,6 +3091,32 @@
 			e->ucic.opc = opc; /* keep OPC information */
 			e->far.call = c;
 			return 0;
+		case ISUP_RES:
+			e = ss7_next_empty_event(ss7);
+			if (!e) {
+				isup_free_call(ss7, c);
+				return -1;
+			}
+
+			e->e = ISUP_EVENT_RES;
+			e->res.cic = c->cic;
+			e->res.opc = opc; /* keep OPC information */
+			e->res.call = c;
+			e->res.network_isdn_indicator = c->network_isdn_indicator;
+			return 0;
+		case ISUP_SUS:
+			e = ss7_next_empty_event(ss7);
+			if (!e) {
+				isup_free_call(ss7, c);
+				return -1;
+			}
+
+			e->e = ISUP_EVENT_SUS;
+			e->sus.cic = c->cic;
+			e->sus.opc = opc; /* keep OPC information */
+			e->sus.call = c;
+			e->sus.network_isdn_indicator = c->network_isdn_indicator;
+			return 0;
 		default:
 			isup_free_call(ss7, c);
 			return 0;

Modified: team/mattf/libss7-ss7cluster/isup.h
URL: http://svnview.digium.com/svn/libss7/team/mattf/libss7-ss7cluster/isup.h?view=diff&rev=284&r1=283&r2=284
==============================================================================
--- team/mattf/libss7-ss7cluster/isup.h (original)
+++ team/mattf/libss7-ss7cluster/isup.h Wed Feb 24 14:39:03 2010
@@ -89,6 +89,7 @@
 #define ISUP_EXM	0xed
 
 /* ISUP Parameters */
+#define ISUP_PARM_SUSPEND_RESUME_IND 0x22
 #define ISUP_PARM_NATURE_OF_CONNECTION_IND 0x06
 #define ISUP_PARM_FORWARD_CALL_IND 0x07
 #define ISUP_PARM_CALLING_PARTY_CAT 0x09
@@ -212,6 +213,8 @@
 	unsigned int dpc;
 	/* Backward Call Indicator variables */
 	unsigned char called_party_status_ind;
+	/* Suspend/Resume Indicator */
+	int network_isdn_indicator;
 };
 
 int isup_receive(struct ss7 *ss7, struct mtp2 *sl, unsigned char ni, struct routing_label *rl, unsigned char *sif, int len);

Modified: team/mattf/libss7-ss7cluster/libss7.h
URL: http://svnview.digium.com/svn/libss7/team/mattf/libss7-ss7cluster/libss7.h?view=diff&rev=284&r1=283&r2=284
==============================================================================
--- team/mattf/libss7-ss7cluster/libss7.h (original)
+++ team/mattf/libss7-ss7cluster/libss7.h Wed Feb 24 14:39:03 2010
@@ -246,11 +246,10 @@
 typedef struct {
 	int e;
 	int cic;
-	unsigned int opc;
-	unsigned long got_sent_msg;
-	unsigned char susres_ind;
-	struct isup_call *call;
-} ss7_event_susres;
+	int network_isdn_indicator;
+	unsigned int opc;
+	struct isup_call *call;
+} ss7_event_sus_res;
 
 typedef struct {
 	int e;
@@ -425,8 +424,9 @@
 	ss7_event_rsc rsc;
 	ss7_event_cpg cpg;
 	ss7_event_cic lpa;
-	ss7_event_susres susres;
 	ss7_event_sam sam;
+	ss7_event_sus_res sus;
+	ss7_event_sus_res res;
 	ss7_event_call_null call_null;
 	ss7_event_hangup hangup;
 	ss7_event_notinservice notinservice;

Modified: team/mattf/libss7-ss7cluster/mtp3.c
URL: http://svnview.digium.com/svn/libss7/team/mattf/libss7-ss7cluster/mtp3.c?view=diff&rev=284&r1=283&r2=284
==============================================================================
--- team/mattf/libss7-ss7cluster/mtp3.c (original)
+++ team/mattf/libss7-ss7cluster/mtp3.c Wed Feb 24 14:39:03 2010
@@ -359,7 +359,10 @@
 
 	set_h0(layer4, 1);
 	set_h1(layer4, 1);
-	layer4[1] = (testlen << 4);
+	if (ss7->switchtype == SS7_ANSI)
+		layer4[1] = (testlen << 4) | (link->slc & 0xf);
+	else
+		layer4[1] = (testlen << 4);
 	memcpy(&layer4[2], testmessage, testlen);
 
 	ss7_msg_userpart_len(m, rllen + testlen + 2);
@@ -1657,7 +1660,10 @@
 		/* Success! */
 		set_h0(layer4, 1);
 		set_h1(layer4, 2);
-		layer4[1] = (testpatsize << 4);
+		if (ss7->switchtype == SS7_ANSI)
+			layer4[1] = (testpatsize << 4) | (mtp2->slc & 0xf);
+		else
+			layer4[1] = (testpatsize << 4);
 		memcpy(&layer4[2], &headerptr[2], testpatsize);
 		
 		ss7_msg_userpart_len(m, rllen + testpatsize + 2);




More information about the libss7-commits mailing list