diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-08-28 17:59:15 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-08-29 16:35:23 +0800 |
commit | 82049d81413c23f08e7a5418f30676001e1a4588 (patch) | |
tree | 1e442fd0b113e393873691e94489561d7918af92 /openbsc/include/openbsc/mgcp.h | |
parent | cb8c35cd518bba3caedd16a923464a956e3eb4f4 (diff) |
mgcp: Add method to go back from endpoint to multiplex/timeslot
Diffstat (limited to 'openbsc/include/openbsc/mgcp.h')
-rw-r--r-- | openbsc/include/openbsc/mgcp.h | 9 |
1 files changed, 9 insertions, 0 deletions
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 |