add LOG_TRANS, proper context for all transactions

Change-Id: I2e60964d7a3c06d051debd1c707051a0eb3101ba
diff --git a/src/libmsc/gsm_04_11_gsup.c b/src/libmsc/gsm_04_11_gsup.c
index eb092ae..cd83b41 100644
--- a/src/libmsc/gsm_04_11_gsup.c
+++ b/src/libmsc/gsm_04_11_gsup.c
@@ -58,7 +58,7 @@
 	/* Associate logging messages with this subscriber */
 	log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub);
 
-	LOGP(DLSMS, LOGL_DEBUG, "TX GSUP MO-forwardSM-Req\n");
+	LOG_TRANS(trans, LOGL_DEBUG, "TX GSUP MO-forwardSM-Req\n");
 
 	/* Assign SM-RP-MR to transaction state */
 	trans->sms.sm_rp_mr = sm_rp_mr;
@@ -67,7 +67,7 @@
 	bcd_len = gsm48_encode_bcd_number(bcd_buf, sizeof(bcd_buf),
 		0, trans->vsub->msisdn);
 	if (bcd_len <= 0 || bcd_len > sizeof(bcd_buf)) {
-		LOGP(DLSMS, LOGL_ERROR, "Failed to encode subscriber's MSISDN\n");
+		LOG_TRANS(trans, LOGL_ERROR, "Failed to encode subscriber's MSISDN\n");
 		return -EINVAL;
 	}
 
@@ -99,7 +99,7 @@
 	/* Associate logging messages with this subscriber */
 	log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub);
 
-	LOGP(DLSMS, LOGL_DEBUG, "TX GSUP READY-FOR-SM Req\n");
+	LOG_TRANS(trans, LOGL_DEBUG, "TX GSUP READY-FOR-SM Req\n");
 
 	/* Assign SM-RP-MR to transaction state */
 	trans->sms.sm_rp_mr = sm_rp_mr;
@@ -147,9 +147,6 @@
 		OSMO_ASSERT(0);
 	}
 
-	LOGP(DLSMS, LOGL_DEBUG, "RX %s-%s\n", msg_name,
-		msg_is_err ? "Err" : "Res");
-
 	/* Make sure that 'SMS over GSUP' is expected */
 	if (!net->sms_over_gsup) {
 		/* TODO: notify sender about that? */
@@ -173,6 +170,8 @@
 		return -EIO; /* TODO: notify sender about that? */
 	}
 
+	LOG_TRANS(trans, LOGL_DEBUG, "RX %s-%s\n", msg_name, msg_is_err ? "Err" : "Res");
+
 	/* Send either RP-ERROR, or RP-ACK */
 	if (msg_is_err) {
 		/* TODO: handle optional SM-RP-UI payload (requires API change) */
@@ -198,7 +197,7 @@
 	/* Associate logging messages with this subscriber */
 	log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub);
 
-	LOGP(DLSMS, LOGL_DEBUG, "TX MT-forwardSM-Res\n");
+	LOG_TRANS(trans, LOGL_DEBUG, "TX MT-forwardSM-Res\n");
 
 	/* Initialize a new GSUP message */
 	gsup_sm_msg_init(&gsup_msg, OSMO_GSUP_MSGT_MT_FORWARD_SM_RESULT,
@@ -215,7 +214,7 @@
 	/* Associate logging messages with this subscriber */
 	log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub);
 
-	LOGP(DLSMS, LOGL_DEBUG, "TX MT-forwardSM-Err\n");
+	LOG_TRANS(trans, LOGL_DEBUG, "TX MT-forwardSM-Err\n");
 
 	/* Initialize a new GSUP message */
 	gsup_sm_msg_init(&gsup_msg, OSMO_GSUP_MSGT_MT_FORWARD_SM_ERROR,