From 82049d81413c23f08e7a5418f30676001e1a4588 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 28 Aug 2010 17:59:15 +0800 Subject: mgcp: Add method to go back from endpoint to multiplex/timeslot --- openbsc/include/openbsc/mgcp.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h index 02abeea39..ed070cdbc 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 -- cgit v1.2.3