mgcp: Add method to go back from endpoint to multiplex/timeslot

This commit is contained in:
Holger Hans Peter Freyther 2010-08-28 17:59:15 +08:00
parent cb8c35cd51
commit 82049d8141
1 changed files with 9 additions and 0 deletions

View File

@ -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