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

SVN commits to the libss7 project libss7-commits at lists.digium.com
Thu Oct 11 16:36:16 CDT 2007


Author: mattf
Date: Thu Oct 11 16:36:15 2007
New Revision: 118

URL: http://svn.digium.com/view/libss7?view=rev&rev=118
Log:
Remove oli preset field in favor of implicitly being present or not (-1 for not there)

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

Modified: trunk/isup.c
URL: http://svn.digium.com/view/libss7/trunk/isup.c?view=diff&rev=118&r1=117&r2=118
==============================================================================
--- trunk/isup.c (original)
+++ trunk/isup.c Thu Oct 11 16:36:15 2007
@@ -949,14 +949,13 @@
 static FUNC_RECV(originating_line_information_receive) 
 {
 	c->oli_ani2 = parm[0];
-	c->oli_present = -1; 	/* Setting this to -1 . To keep track and put back if OLI is left untouched in dialplan */
 
 	return 1;
 }
 
 static FUNC_SEND(originating_line_information_transmit) 
 {
-	if (c->oli_present == 0 || c->oli_ani2 < 0) {  /* Allow dialplan to strip OLI parm if you don't want to resend what was received */
+	if (c->oli_ani2 < 0) {  /* Allow dialplan to strip OLI parm if you don't want to resend what was received */
 		return 0;
 	} else if (c->oli_ani2 < 99) {
 		parm[0] = c->oli_ani2;  
@@ -1202,12 +1201,19 @@
 	return "Unknown";
 }
 
+static void init_isup_call(struct isup_call *c)
+{
+	c->oli_ani2 = -1;
+}
+
 static struct isup_call * __isup_new_call(struct ss7 *ss7, int nolink)
 {
 	struct isup_call *c, *cur;
 	c = calloc(1, sizeof(struct isup_call));
 	if (!c)
 		return NULL;
+
+	init_isup_call(c);
 
 	if (nolink)
 		return c;
@@ -1246,10 +1252,9 @@
 
 }
 
-void isup_set_oli(struct isup_call *c, unsigned int oli_ani2, unsigned int oli_present)
+void isup_set_oli(struct isup_call *c, int oli_ani2)
 {
 	c->oli_ani2 = oli_ani2;
-	c->oli_present = oli_present;
 }
 
 void isup_set_calling(struct isup_call *c, const char *calling, unsigned char calling_nai, unsigned char presentation_ind, unsigned char screening_ind)
@@ -1836,7 +1841,6 @@
 			e->iam.charge_nai = c->charge_nai;
 			e->iam.charge_num_plan = c->charge_num_plan;
 			e->iam.oli_ani2 = c->oli_ani2;
-			e->iam.oli_present = c->oli_present;
 			e->iam.call = c;
 			return 0;
 		case ISUP_GRS:

Modified: trunk/isup.h
URL: http://svn.digium.com/view/libss7/trunk/isup.h?view=diff&rev=118&r1=117&r2=118
==============================================================================
--- trunk/isup.h (original)
+++ trunk/isup.h Thu Oct 11 16:36:15 2007
@@ -133,7 +133,6 @@
 	unsigned char charge_nai;
 	unsigned char charge_num_plan;
 	int oli_ani2;
-	int oli_present;
 	int range;
 	unsigned char status[255];
 	int transcap;

Modified: trunk/libss7.h
URL: http://svn.digium.com/view/libss7/trunk/libss7.h?view=diff&rev=118&r1=117&r2=118
==============================================================================
--- trunk/libss7.h (original)
+++ trunk/libss7.h Thu Oct 11 16:36:15 2007
@@ -109,7 +109,6 @@
 	unsigned char charge_nai;
 	unsigned char charge_num_plan;
 	int oli_ani2;
-	int oli_present;
 	struct isup_call *call;
 } ss7_event_iam;
 
@@ -297,6 +296,6 @@
 
 void isup_set_charge(struct isup_call *c, const char *charge, unsigned char charge_nai, unsigned char charge_num_plan);
 
-void isup_set_oli(struct isup_call *c, unsigned int oli_ani2, unsigned int oli_present);
+void isup_set_oli(struct isup_call *c, int oli_ani2);
 
 #endif /* _LIBSS7_H */




More information about the libss7-commits mailing list