codec_pref: handle S0-S15 in ASSIGNMENT REQUEST

Opposed to all other codecs that are common in GSM, AMR requires a codec
configuration that is expressed by a bitmask (S0 to S15) in the speech
codec list in the ASSIGNMENT REQUEST. Also the BSC acknowledges those
configuration in the ASSIGNMENT COMPLETE message.

At the moment osmo-bsc ignores all incoming configuration bits. The bits
in the ASSIGNMENT COMPLETE speech codec (choosen) field are hardcoded.

- Store the configuration bits while parsing the ASSIGNMENT COMPLETE
- Create an intersection with the configuration that is actually
  supported by the BSS
- Return the resulting (chosen) configuration bits with the assignment
  complete message.
- Use the (highest of the) agreed codec rates in RSL channel activation.

Change-Id: I2d8ded51b3eb4c003fe2da6f2d6f48d001b73737
Related: OS#3529
diff --git a/include/osmocom/bsc/lchan_fsm.h b/include/osmocom/bsc/lchan_fsm.h
index 9fbf9b3..d2e8724 100644
--- a/include/osmocom/bsc/lchan_fsm.h
+++ b/include/osmocom/bsc/lchan_fsm.h
@@ -58,6 +58,7 @@
 	/* This always is for a specific lchan, so its lchan->type indicates full or half rate.
 	 * When a dyn TS was selected, the lchan->type has been set to the desired rate. */
 	enum gsm48_chan_mode chan_mode;
+	uint16_t s15_s0;
 	bool requires_voice_stream;
 	bool wait_before_switching_rtp;
 	uint16_t msc_assigned_cic;