mgcp: Add method to go back from endpoint to multiplex/timeslot
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index 02abeea..ed070cd 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -150,5 +150,14 @@
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