aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/mgcp.h
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-09-01 19:10:17 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-09-01 19:10:17 +0800
commitafdb522ced650109822d6ab4226f1c566036f1ac (patch)
tree02328ef1478b966eae19a5b07866e9aae148b000 /openbsc/include/openbsc/mgcp.h
parent9ae28a128af27a755aa889d2edd8340815f9a3df (diff)
parent85902a4d4a53094e8ab4cb242e8de1f6ce431f9e (diff)
Merge branch 'on-waves/nat-alloc-bsc-endpoints'openbsc/0.9.5
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;
}