summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/gsm_04_11.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/gsm_04_11.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/gsm_04_11.c')
-rw-r--r--openbsc/src/libmsc/gsm_04_11.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index 46bb074..f22a7e1 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -84,7 +84,9 @@ void sms_free(struct gsm_sms *sms)
talloc_free(sms);
}
-struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver, int dcs, const char *text)
+struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver,
+ struct gsm_subscriber *sender,
+ int dcs, const char *text)
{
struct gsm_sms *sms = sms_alloc();
@@ -94,8 +96,7 @@ struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver, int dcs, const ch
sms->receiver = subscr_get(receiver);
strncpy(sms->text, text, sizeof(sms->text)-1);
- /* FIXME: don't use ID 1 static */
- sms->sender = subscr_get_by_id(receiver->net, 1);
+ sms->sender = subscr_get(sender);
strncpy(sms->src.addr, sms->sender->extension, sizeof(sms->src.addr)-1);
sms->reply_path_req = 0;
sms->status_rep_req = 0;