hodec2 congestion: consider only congested pchan types

If no TCH/H need to be moved, then don't collect TCH/H candidates.
Same for TCH/F.

Examining a specific congestion scenario, I realized that ho decision 2
collects candidates of pchan types that are not actually considered congested:

- handover decision 2 wants to move 2 TCH/F only; TCH/H is fine.
- still it collects active TCH/H lchans as candidates.

  (BTS 0) Congestion check: (free/want-free) TCH/F=0/2 TCH/H=12/0
  (BTS 0) Attempting to resolve congestion...
  (BTS 0) congested: 2 TCH/F and 0 TCH/H should be moved
  [...]
  (BTS 0) Considering 8 candidates to solve congestion:
  (lchan 0.020 TCH_F SPEECH_V1)->(BTS 0) (subscr unknown) #0: req=0x0 avg-rxlev=42
  (lchan 0.030 TCH_F SPEECH_V1)->(BTS 0) (subscr unknown) #1: req=0x0 avg-rxlev=42
  (lchan 0.040 TCH_F SPEECH_V1)->(BTS 0) (subscr unknown) #2: req=0x0 avg-rxlev=42
  (lchan 0.050 TCH_F SPEECH_V1)->(BTS 0) (subscr unknown) #3: req=0x0 avg-rxlev=42
  (lchan 0.160 TCH_H SPEECH_V1)->(BTS 0) (subscr IMSI:9017000000xxxxx) #4: req=0x0 avg-rxlev=42
  (lchan 0.161 TCH_H SPEECH_V1)->(BTS 0) (subscr IMSI:9017000000xxxxx) #5: req=0x0 avg-rxlev=42
  (lchan 0.170 TCH_H SPEECH_V1)->(BTS 0) (subscr IMSI:9017000000xxxxx) #6: req=0x0 avg-rxlev=42
  (lchan 0.171 TCH_H SPEECH_V1)->(BTS 0) (subscr IMSI:9017000000xxxxx) #7: req=0x0 avg-rxlev=42

Change-Id: I5077a62c6d77838513eecf3f0e4810c3d3d3a247
diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c
index 4c32c38..26a8840 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -1445,6 +1445,10 @@
 			/* (Do not consider dynamic TS that are in PDCH mode) */
 			switch (ts->pchan_is) {
 			case GSM_PCHAN_TCH_F:
+				/* No need to collect TCH/F candidates if no TCH/F needs to be moved. */
+				if (tchf_congestion == 0)
+					continue;
+
 				lc = &ts->lchan[0];
 				/* omit if channel not active */
 				if (lc->type != GSM_LCHAN_TCH_F
@@ -1459,6 +1463,10 @@
 				collect_candidates_for_lchan(lc, clist, &candidates, NULL, true);
 				break;
 			case GSM_PCHAN_TCH_H:
+				/* No need to collect TCH/H candidates if no TCH/H needs to be moved. */
+				if (tchh_congestion == 0)
+					continue;
+
 				for (j = 0; j < 2; j++) {
 					lc = &ts->lchan[j];
 					/* omit if channel not active */