From cb8c35cd518bba3caedd16a923464a956e3eb4f4 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 10 Aug 2010 20:24:24 +0800 Subject: mgcp: Speculative mgcp fix... We really have 32 channels per multiplex... so use the right number... or at least it seems we do have 32. --- openbsc/include/openbsc/mgcp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbsc/include/openbsc/mgcp.h') diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h index 38fe50482..02abeea39 100644 --- a/openbsc/include/openbsc/mgcp.h +++ b/openbsc/include/openbsc/mgcp.h @@ -147,7 +147,7 @@ static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot) { if (timeslot == 0) timeslot = 1; - return timeslot + (31 * multiplex); + return timeslot + (32 * multiplex); } -- cgit v1.2.3 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(+) (limited to 'openbsc/include/openbsc/mgcp.h') 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