aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-03-31 09:27:04 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-05 22:02:16 +0200
commit616d2225182a3ba64d6059d52594255ee472af89 (patch)
treebf034730106b27761c16f28e643e8ea6e0f3f2a5 /openbsc/include/openbsc
parent64e4e775585db7b44c8d34f9811335316b940812 (diff)
[mgcp] Add a helper function to convert from GSM0808 ts/mux to MGCP endpoint
Move the conversion of GSM0808 timeslot and multiplex from the bssap.c into the mgcp.h so it can be reused by multiple users. The weird math comes from the mapping of the MSC...
Diffstat (limited to 'openbsc/include/openbsc')
-rw-r--r--openbsc/include/openbsc/mgcp.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index 37194bee8..c60a4550c 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -119,5 +119,13 @@ void mgcp_free_endp(struct mgcp_endpoint *endp);
struct msgb *mgcp_handle_message(struct mgcp_config *cfg, struct msgb *msg);
struct msgb *mgcp_create_response_with_data(int code, const char *msg, const char *trans, const char *data);
+/* adc helper */
+static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot)
+{
+ if (timeslot == 0)
+ timeslot = 1;
+ return timeslot + (31 * multiplex);
+}
+
#endif