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

libss7-commits at lists.digium.com libss7-commits at lists.digium.com
Thu Sep 7 15:42:33 MST 2006


Author: mattf
Date: Thu Sep  7 17:42:32 2006
New Revision: 38

URL: http://svn.digium.com/view/libss7?rev=38&view=rev
Log:
Add CPG message support

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

Modified: trunk/README
URL: http://svn.digium.com/view/libss7/trunk/README?rev=38&r1=37&r2=38&view=diff
==============================================================================
--- trunk/README (original)
+++ trunk/README Thu Sep  7 17:42:32 2006
@@ -33,6 +33,7 @@
 Connect message (CON)
 CIC Blocking/Unblocking (CGB, CGBA, CGU, CGUA, BLO, BLA)
 Continuity Check (COT, CCR)
+Call Progress message (CPG)
 
 TODO:
 =====

Modified: trunk/isup.c
URL: http://svn.digium.com/view/libss7/trunk/isup.c?rev=38&r1=37&r2=38&view=diff
==============================================================================
--- trunk/isup.c (original)
+++ trunk/isup.c Thu Sep  7 17:42:32 2006
@@ -55,9 +55,11 @@
 
 static int greset_params[] = { ISUP_PARM_RANGE_AND_STATUS, -1};
 
+static int cot_params[] = { ISUP_PARM_CONTINUITY_IND, -1};
+
+static int cpg_params[] = { ISUP_PARM_EVENT_INFO, -1};
+
 static int cicgroup_params[] = { ISUP_PARM_CIRCUIT_GROUP_SUPERVISION_IND, ISUP_PARM_RANGE_AND_STATUS, -1};
-
-static int cot_params[] = { ISUP_PARM_CONTINUITY_IND, -1};
 
 static int empty_params[] = { -1};
 
@@ -87,6 +89,7 @@
 	{ISUP_BLA, 0, 0, 0, empty_params},
 	{ISUP_UBA, 0, 0, 0, empty_params},
 	{ISUP_RSC, 0, 0, 0, empty_params},
+	{ISUP_CPG, 1, 0, 1, cpg_params},
 };
 
 static int isup_send_message(struct ss7 *ss7, struct isup_call *c, int messagetype, int parms[]);
@@ -570,6 +573,53 @@
 	return 1;
 }
 
+static FUNC_DUMP(event_info_dump)
+{
+	char *name;
+
+	switch (parm[0]) {
+		case 0:
+			name = "spare";
+			break;
+		case 1:
+			name = "ALERTING";
+			break;
+		case 2:
+			name = "PROGRESS";
+			break;
+		case 3:
+			name = "In-band information or an appropriate pattern is now available";
+			break;
+		case 4:
+			name = "Call forward on busy";
+			break;
+		case 5:
+			name = "Call forward on no reply";
+			break;
+		case 6:
+			name = "Call forward unconditional";
+			break;
+		default:
+			name = "Spare";
+			break;
+	}
+	ss7_message(ss7, "PARM: Event Information:\n");
+	ss7_message(ss7, "%s\n", name);
+	return 1;
+}
+
+static FUNC_RECV(event_info_receive)
+{
+	c->event_info = parm[0];
+	return 1;
+}
+
+static FUNC_SEND(event_info_transmit)
+{
+	parm[0] = c->event_info;
+	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 },
 	{ISUP_PARM_FORWARD_CALL_IND, "Forward Call Indicator", NULL, forward_call_ind_receive, forward_call_ind_transmit },
@@ -598,6 +648,7 @@
 	{ISUP_PARM_BACKWARD_CALL_IND, "Backward Call Indicator", NULL, backward_call_ind_receive, backward_call_ind_transmit},
 	{ISUP_PARM_CIRCUIT_GROUP_SUPERVISION_IND, "Circuit Group Supervision Indicator", circuit_group_supervision_dump, circuit_group_supervision_receive, circuit_group_supervision_transmit},
 	{ISUP_PARM_RANGE_AND_STATUS, "Range and status", range_and_status_dump, range_and_status_receive, range_and_status_transmit},
+	{ISUP_PARM_EVENT_INFO, "Event Information", event_info_dump, event_info_receive, event_info_transmit},
 };
 
 static char * param2str(int parm)
@@ -1088,6 +1139,11 @@
 
 			isup_free_call(ss7, c);
 			return 0;
+		case ISUP_CPG:
+			e->e = ISUP_EVENT_CPG;
+			e->cpg.cic = c->cic;
+			e->cpg.event = c->event_info;
+			return 0;
 		default:
 			ss7_error(ss7, "!! Unable to handle message type %s\n", message2str(mh->type));
 			return -1;
@@ -1191,6 +1247,12 @@
 	return res;
 }
 
+int isup_cpg(struct ss7 *ss7, struct isup_call *c, int event)
+{
+	c->event_info = event;
+	return isup_send_message(ss7, c, ISUP_CPG, cpg_params);
+}
+
 int isup_rsc(struct ss7 *ss7, int cic)
 {
 	return isup_send_message_ciconly(ss7, ISUP_RSC, cic);

Modified: trunk/isup.h
URL: http://svn.digium.com/view/libss7/trunk/isup.h?rev=38&r1=37&r2=38&view=diff
==============================================================================
--- trunk/isup.h (original)
+++ trunk/isup.h Thu Sep  7 17:42:32 2006
@@ -97,6 +97,7 @@
 #define ISUP_PARM_CIRCUIT_GROUP_SUPERVISION_IND 0x15
 #define ISUP_PARM_RANGE_AND_STATUS 0x16
 #define ISUP_PARM_PROPAGATION_DELAY 0x31
+#define ISUP_PARM_EVENT_INFO 0x24
 
 /* ISUP Parameter Pseudo-type */
 struct isup_parm_opt {
@@ -129,6 +130,7 @@
 	int causeloc;
 	int cot_check_passed;
 	int cot_check_required;
+	unsigned char event_info;
 	unsigned short cic;
 	unsigned short slc;
 	struct isup_call *next;

Modified: trunk/libss7.h
URL: http://svn.digium.com/view/libss7/trunk/libss7.h?rev=38&r1=37&r2=38&view=diff
==============================================================================
--- trunk/libss7.h (original)
+++ trunk/libss7.h Thu Sep  7 17:42:32 2006
@@ -26,6 +26,7 @@
 #define ISUP_EVENT_CGBA		19
 #define ISUP_EVENT_CGUA		20
 #define ISUP_EVENT_RSC		21
+#define ISUP_EVENT_CPG		22
 
 /* Different SS7 types */
 #define SS7_ITU		(1 << 0)
@@ -42,6 +43,14 @@
 #define SS7_NI_NAT			0x02
 #define SS7_NI_NAT_SPARE		0x03
 
+/* CPG parameter types */
+#define CPG_EVENT_ALERTING	0x01
+#define CPG_EVENT_PROGRESS	0x02
+#define CPG_EVENT_INBANDINFO	0x03
+#define CPG_EVENT_CFB		0x04
+#define CPG_EVENT_CFNR		0x05
+#define CPG_EVENT_CFU		0x06
+
 struct ss7;
 struct isup_call;
 
@@ -108,6 +117,12 @@
 	int e;
 	unsigned int data;
 } ss7_event_generic;
+
+typedef struct {
+	int e;
+	int cic;
+	unsigned char event;
+} ss7_event_cpg;
 
 typedef union {
 	int e;
@@ -131,6 +146,7 @@
 	ss7_event_ciconly bla;
 	ss7_event_ciconly uba;
 	ss7_event_rsc rsc;
+	ss7_event_cpg cpg;
 } ss7_event;
 
 void ss7_set_message(void (*func)(struct ss7 *ss7, char *message));
@@ -187,6 +203,8 @@
 
 int isup_rlc(struct ss7 *ss7, struct isup_call *c);
 
+int isup_cpg(struct ss7 *ss7, struct isup_call *c, int event);
+
 int isup_gra(struct ss7 *ss7, int begincic, int endcic);
 
 int isup_grs(struct ss7 *ss7, int begincic, int endcic);



More information about the libss7-commits mailing list