aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/mgcp.h
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/include/openbsc/mgcp.h')
-rw-r--r--openbsc/include/openbsc/mgcp.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index 38fe50482..ed070cdbc 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -147,7 +147,16 @@ static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot)
{
if (timeslot == 0)
timeslot = 1;
- return timeslot + (31 * multiplex);
+ 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;
}