use less magic numbers (04.08 CC cause values)

Introduce a gsm48_cc_cause enum and use it from gsm_04_08 and MNCC,
also make sure we use gsm48_cause_loc rather than plain numbers.
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index 3aaa0f5..367f7fa 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -1867,7 +1867,8 @@
 
 	memset(&rel, 0, sizeof(&rel));
 	rel.callref = callref;
-	mncc_set_cause(&rel, 1, 1); /* Unknown subscriber */
+	mncc_set_cause(&rel, GSM48_CAUSE_LOC_PRN_S_LU,
+		       GSM48_CC_CAUSE_UNASSIGNED_NR);
 	return mncc_recvmsg(net, trans, MNCC_REL_IND, &rel);
 }
 
@@ -2086,8 +2087,10 @@
 {
 	struct gsm_trans *trans = arg;
 	int disconnect = 0, release = 0;
-	int mo_cause = 102, mo_location = 0;
-	int l4_cause = 31, l4_location = 1;
+	int mo_cause = GSM48_CC_CAUSE_RECOVERY_TIMER;
+	int mo_location = GSM48_CAUSE_LOC_USER;
+	int l4_cause = GSM48_CC_CAUSE_NORMAL_UNSPEC;
+	int l4_location = GSM48_CAUSE_LOC_PRN_S_LU;
 	struct gsm_mncc mo_rel, l4_rel;
 
 	memset(&mo_rel, 0, sizeof(struct gsm_mncc));
@@ -2098,11 +2101,11 @@
 	switch(trans->Tcurrent) {
 	case 0x303:
 		release = 1;
-		l4_cause = 18;
+		l4_cause = GSM48_CC_CAUSE_USER_NOTRESPOND;
 		break;
 	case 0x310:
 		disconnect = 1;
-		l4_cause = 18;
+		l4_cause = GSM48_CC_CAUSE_USER_NOTRESPOND;
 		break;
 	case 0x313:
 		disconnect = 1;
@@ -2110,7 +2113,7 @@
 		break;
 	case 0x301:
 		disconnect = 1;
-		l4_cause = 19;
+		l4_cause = GSM48_CC_CAUSE_USER_NOTRESPOND;
 		break;
 	case 0x308:
 		if (!trans->T308_second) {
@@ -2628,7 +2631,15 @@
 
 }
 
-static struct gsm_mncc_cause default_cause = { 1, 0, 0, 0, 31, 0, { 0 } };
+static struct gsm_mncc_cause default_cause = {
+	.location	= GSM48_CAUSE_LOC_PRN_S_LU,
+	.coding		= 0,
+	.rec		= 0,
+	.rec_val	= 0,
+	.value		= GSM48_CC_CAUSE_NORMAL_UNSPEC,
+	.diag_len	= 0,
+	.diag		= { 0 },
+};
 
 static int gsm48_cc_tx_disconnect(struct gsm_trans *trans, void *arg)
 {
@@ -3463,7 +3474,8 @@
 			"Received '%s' from MNCC in paging state\n", 
 			(trans->subscr)?(trans->subscr->extension):"-",
 			get_mncc_name(msg_type));
-		mncc_set_cause(&rel, 1, 16); /* Normal call clearing */
+		mncc_set_cause(&rel, GSM48_CAUSE_LOC_PRN_S_LU,
+				GSM48_CC_CAUSE_NORM_CALL_CLEAR);
 		if (msg_type == MNCC_REL_REQ)
 			rc = mncc_recvmsg(net, trans, MNCC_REL_CNF, &rel);
 		else
diff --git a/openbsc/src/mncc.c b/openbsc/src/mncc.c
index 8f93b3f..4282aaf 100644
--- a/openbsc/src/mncc.c
+++ b/openbsc/src/mncc.c
@@ -140,7 +140,8 @@
 	if (!(remote = calloc(1, sizeof(struct gsm_call)))) {
 		memset(&mncc, 0, sizeof(struct gsm_mncc));
 		mncc.callref = call->callref;
-		mncc_set_cause(&mncc, 1, 47);
+		mncc_set_cause(&mncc, GSM48_CAUSE_LOC_PRN_S_LU,
+				GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
 		mncc_send(call->net, MNCC_REJ_REQ, &mncc);
 		free_call(call);
 		return 0;
@@ -304,7 +305,8 @@
 			
 			memset(&rel, 0, sizeof(struct gsm_mncc));
 			rel.callref = callref;
-			mncc_set_cause(&rel, 1, 47);
+			mncc_set_cause(&rel, GSM48_CAUSE_LOC_PRN_S_LU,
+				       GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
 			mncc_send(net, MNCC_REL_REQ, &rel);
 			return 0;
 		}
@@ -354,7 +356,8 @@
 	case MNCC_STOP_DTMF_IND:
 		break;
 	case MNCC_MODIFY_IND:
-		mncc_set_cause(data, 1, 79);
+		mncc_set_cause(data, GSM48_CAUSE_LOC_PRN_S_LU,
+				GSM48_CC_CAUSE_SERV_OPT_UNIMPL);
 		DEBUGP(DMNCC, "(call %x) Rejecting MODIFY with cause %d\n",
 			call->callref, data->cause.value);
 		rc = mncc_send(net, MNCC_MODIFY_REJ, data);
@@ -362,13 +365,15 @@
 	case MNCC_MODIFY_CNF:
 		break;
 	case MNCC_HOLD_IND:
-		mncc_set_cause(data, 1, 79);
+		mncc_set_cause(data, GSM48_CAUSE_LOC_PRN_S_LU,
+				GSM48_CC_CAUSE_SERV_OPT_UNIMPL);
 		DEBUGP(DMNCC, "(call %x) Rejecting HOLD with cause %d\n",
 			call->callref, data->cause.value);
 		rc = mncc_send(net, MNCC_HOLD_REJ, data);
 		break;
 	case MNCC_RETRIEVE_IND:
-		mncc_set_cause(data, 1, 79);
+		mncc_set_cause(data, GSM48_CAUSE_LOC_PRN_S_LU,
+				GSM48_CC_CAUSE_SERV_OPT_UNIMPL);
 		DEBUGP(DMNCC, "(call %x) Rejecting RETRIEVE with cause %d\n",
 			call->callref, data->cause.value);
 		rc = mncc_send(net, MNCC_RETRIEVE_REJ, data);