aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-07-26 03:41:11 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-07-26 03:55:57 +0800
commit6a4b362ceb7dd1742de2d1ffebadf1846634a3af (patch)
tree5842a7e0b18cf88f0d5b24bb1e48888ae65f844e
parent680833e2ba26b4e996046cee6de3cbb37d350083 (diff)
gsm0480: Implement a generic "invoke" wrapping for messages.
Implement a GSM 04.80 invoke wrapper for a component and an invoke id.
-rw-r--r--openbsc/include/openbsc/gsm_04_80.h1
-rw-r--r--openbsc/src/gsm_04_80.c21
2 files changed, 22 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_04_80.h b/openbsc/include/openbsc/gsm_04_80.h
index 85b6a4990..8a25554e9 100644
--- a/openbsc/include/openbsc/gsm_04_80.h
+++ b/openbsc/include/openbsc/gsm_04_80.h
@@ -24,5 +24,6 @@ int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn,
const struct ussd_request *request);
struct msgb * gsm0480_create_notifySS(const char *text);
+int gsm0480_wrap_invoke(struct msgb *msg, int op, int link_id);
#endif
diff --git a/openbsc/src/gsm_04_80.c b/openbsc/src/gsm_04_80.c
index f2a0728f2..71fb40577 100644
--- a/openbsc/src/gsm_04_80.c
+++ b/openbsc/src/gsm_04_80.c
@@ -360,6 +360,27 @@ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn,
return gsm0808_submit_dtap(conn, msg, 0);
}
+/* wrap an invoke around it... the other way around
+ *
+ * 1.) Invoke Component tag
+ * 2.) Invoke ID Tag
+ * 3.) Operation
+ * 4.) Data
+ */
+int gsm0480_wrap_invoke(struct msgb *msg, int op, int link_id)
+{
+ /* 3. operation */
+ msgb_push_TLV1(msg, GSM0480_OPERATION_CODE, op);
+
+ /* 2. invoke id tag */
+ msgb_push_TLV1(msg, GSM0480_COMPIDTAG_INVOKE_ID, link_id);
+
+ /* 1. component tag */
+ msgb_wrap_with_TL(msg, GSM0480_CTYPE_INVOKE);
+
+ return 0;
+}
+
int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn,
const struct msgb *in_msg,
const struct ussd_request *req)