aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/token_auth.c
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2012-12-28 00:49:01 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-01-01 17:04:38 +0100
commit01c13a3a455c1bf04c372b657caa0e2a82048994 (patch)
tree9aa5257bee1087b86d4b7b9a6863248a150f6fbb /openbsc/src/libmsc/token_auth.c
parent11c1b6e0147efbe78febd45271a0eb1887b031b0 (diff)
libmsc: Allow to set sender id when sending SMS from the VTY
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'openbsc/src/libmsc/token_auth.c')
-rw-r--r--openbsc/src/libmsc/token_auth.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/openbsc/src/libmsc/token_auth.c b/openbsc/src/libmsc/token_auth.c
index cf26ba8d8..45b5a8eab 100644
--- a/openbsc/src/libmsc/token_auth.c
+++ b/openbsc/src/libmsc/token_auth.c
@@ -63,6 +63,7 @@ static int token_subscr_cb(unsigned int subsys, unsigned int signal,
return 0;
if (subscr->flags & GSM_SUBSCRIBER_FIRST_CONTACT) {
+ struct gsm_subscriber *sender;
uint32_t token;
char *sms_str;
@@ -79,7 +80,13 @@ static int token_subscr_cb(unsigned int subsys, unsigned int signal,
goto unauth;
}
- sms = sms_from_text(subscr, 0, sms_str);
+
+ /* FIXME: don't use ID 1 static */
+ sender = subscr_get_by_id(subscr->net, 1);
+
+ sms = sms_from_text(subscr, sender, 0, sms_str);
+
+ subscr_put(sender);
talloc_free(sms_str);
if (!sms) {
rc = -ENOMEM;