From 45fd07dc33b5dd845e2b266adda5d24a4d500f96 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 28 Aug 2010 18:22:14 +0800 Subject: nat: Attempt to assign the BSC Timeslot based on a free list Do attempt to not reassign an endpoint immediately but go to the next free one. --- openbsc/tests/bsc-nat/bsc_nat_test.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'openbsc/tests/bsc-nat/bsc_nat_test.c') diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c index b7a89c5b7..acc5de343 100644 --- a/openbsc/tests/bsc-nat/bsc_nat_test.c +++ b/openbsc/tests/bsc-nat/bsc_nat_test.c @@ -444,7 +444,7 @@ static void test_mgcp_ass_tracking(void) msg = msgb_alloc(4096, "foo"); copy_to_msg(msg, ass_cmd, sizeof(ass_cmd)); parsed = bsc_nat_parse(msg); - if (bsc_mgcp_assign(&con, msg) != 0) { + if (bsc_mgcp_assign_patch(&con, msg) != 0) { fprintf(stderr, "Failed to handle assignment.\n"); abort(); } @@ -454,14 +454,19 @@ static void test_mgcp_ass_tracking(void) abort(); } - if (con.bsc_endp != 21) { - fprintf(stderr, "Assigned timeslot should have been 21.\n"); + if (con.bsc_endp != 1) { + fprintf(stderr, "Assigned timeslot should have been 1.\n"); abort(); } + if (con.bsc->endpoint_status[1] != 1) { + fprintf(stderr, "The status on the BSC is wrong.\n"); + abort(); + } + talloc_free(parsed); bsc_mgcp_dlcx(&con); - if (con.bsc_endp != -1 || con.msc_endp != -1) { + if (con.bsc_endp != -1 || con.msc_endp != -1 || con.bsc->endpoint_status[1] != 0) { fprintf(stderr, "Clearing should remove the mapping.\n"); abort(); } -- cgit v1.2.3