aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-08-28 17:59:15 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-08-29 16:35:23 +0800
commit82049d81413c23f08e7a5418f30676001e1a4588 (patch)
tree1e442fd0b113e393873691e94489561d7918af92 /openbsc
parentcb8c35cd518bba3caedd16a923464a956e3eb4f4 (diff)
mgcp: Add method to go back from endpoint to multiplex/timeslot
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/mgcp.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index 02abeea3..ed070cdb 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -150,5 +150,14 @@ static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot)
return timeslot + (32 * multiplex);
}
+static inline void mgcp_endpoint_to_timeslot(int endpoint, int *multiplex, int *timeslot)
+{
+ *multiplex = endpoint / 32;
+ *timeslot = endpoint % 32;
+
+ if (*timeslot == 1)
+ *timeslot = 0;
+}
+
#endif