Hi,
attached is a small patch to add sms delivery attempt 
counting using the db_sms_inc_deliver_attempts() that 
already existed. I was a bit unsure what exactly counts as a 
delivery attempt judging by GSM 04.11 but it made sense to 
me to count that with each CP-DATA.

Cheers
Nico
>From eb71c281393a935d333526d5e0d6bc9f0af0a429 Mon Sep 17 00:00:00 2001
From: Nico Golde <n...@ngolde.de>
Date: Wed, 15 Sep 2010 19:49:55 +0200
Subject: [PATCH] gsm_04_11: count SMS delivery attempts for each CP-DATA

---
 openbsc/src/gsm_04_11.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/openbsc/src/gsm_04_11.c b/openbsc/src/gsm_04_11.c
index 02bc442..4ec1071 100644
--- a/openbsc/src/gsm_04_11.c
+++ b/openbsc/src/gsm_04_11.c
@@ -37,6 +37,7 @@
 #include <osmocore/tlv.h>
 #include <openbsc/debug.h>
 #include <openbsc/gsm_data.h>
+#include <openbsc/db.h>
 #include <openbsc/gsm_subscriber.h>
 #include <openbsc/gsm_04_11.h>
 #include <openbsc/gsm_04_08.h>
@@ -175,6 +176,7 @@ static int gsm411_cp_sendmsg(struct msgb *msg, struct gsm_trans *trans,
 		trans->sms.cp_timer.cb = cp_timer_expired;
 		/* 5.3.2.1: Set Timer TC1A */
 		bsc_schedule_timer(&trans->sms.cp_timer, GSM411_TMR_TC1A);
+		db_sms_inc_deliver_attempts(trans->sms.sms);
 		DEBUGP(DSMS, "TX: CP-DATA ");
 		break;
 	case GSM411_MT_CP_ACK:
-- 
1.7.1

Reply via email to