summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/smpp_openbsc.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2013-07-30 23:39:18 +0800
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-08-03 19:20:36 +0200
commit99e273db00a09d68adce36709f84cf43e0efb5a7 (patch)
tree247dd635802821b4d45ea75cd10eec6e98d68d75 /openbsc/src/libmsc/smpp_openbsc.c
parent1aeb2af75d27fdb4ab31d145ec49e84e29ecd501 (diff)
SMPP: convert a SMMA to a SMPP ALERT NOTIFICATION
Diffstat (limited to 'openbsc/src/libmsc/smpp_openbsc.c')
-rw-r--r--openbsc/src/libmsc/smpp_openbsc.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c
index eb1ac11b7..0bc85e5ec 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -42,6 +42,8 @@
#include <openbsc/gsm_04_11.h>
#include <openbsc/gsm_data.h>
#include <openbsc/signal.h>
+#include <openbsc/transaction.h>
+#include <openbsc/gsm_subscriber.h>
#include "smpp_smsc.h"
@@ -250,6 +252,9 @@ static int smpp_sms_cb(unsigned int subsys, unsigned int signal,
{
struct sms_signal_data *sig_sms = signal_data;
struct gsm_sms *sms = sig_sms->sms;
+ struct smsc *smsc = handler_data;
+ struct osmo_esme *esme;
+ struct gsm_subscriber *subscr;
int rc = 0;
if (!sms)
@@ -283,6 +288,29 @@ static int smpp_sms_cb(unsigned int subsys, unsigned int signal,
ESME_ROK, sms->smpp.msg_id);
}
break;
+ case S_SMS_SMMA:
+ if (!sig_sms->trans || !sig_sms->trans->subscr) {
+ /* SMMA without a subscriber? strange... */
+ LOGP(DLSMS, LOGL_NOTICE, "SMMA without subscriber?\n");
+ break;
+ }
+
+ subscr = sig_sms->trans->subscr;
+ /* There's no real 1:1 match for SMMA in SMPP. However,
+ * an ALERT NOTIFICATION seems to be the most logical
+ * choice */
+ llist_for_each_entry(esme, &smsc->esme_list, list) {
+ if (esme->acl && esme->acl->deliver_src_imsi) {
+ smpp_tx_alert(esme, TON_Subscriber_Number,
+ NPI_Land_Mobile_E212,
+ subscr->imsi, 0);
+ } else {
+ smpp_tx_alert(esme, TON_Network_Specific,
+ NPI_ISDN_E163_E164,
+ subscr->extension, 0);
+ }
+ }
+ break;
}
return rc;