RAB Assign for voice: heed the x213 nsap flag

Add use_x213_nsap arg to ranap_new_msg_rab_assign_voice() and
new_transp_info_rtp(). Pass this to new_transp_layer_addr() to compose 32bit
addresses when use_x213_nsap == false.

This is analogous to ranap_new_msg_rab_assign_data().

Particularly, the ip.access nano3G does not accept x213 NSAP 56bit addresses,
so we want to send 32bit addresses there.

Change-Id: I0c3c95d709c8a2b1c48d7a187faca34102226329
diff --git a/src/ranap_msg_factory.c b/src/ranap_msg_factory.c
index 401ef4e..695a6be 100644
--- a/src/ranap_msg_factory.c
+++ b/src/ranap_msg_factory.c
@@ -647,7 +647,8 @@
 	out->bits_unused = 0;
 }
 
-static RANAP_TransportLayerInformation_t *new_transp_info_rtp(uint32_t ip, uint16_t port)
+static RANAP_TransportLayerInformation_t *new_transp_info_rtp(uint32_t ip, uint16_t port,
+							      bool use_x213_nsap)
 {
 	RANAP_TransportLayerInformation_t *tli = CALLOC(1, sizeof(*tli));
 	uint8_t binding_id[4];
@@ -661,7 +662,7 @@
 	binding_id[3] = 1;
 #endif
 
-	new_transp_layer_addr(&tli->transportLayerAddress, ip, 1);
+	new_transp_layer_addr(&tli->transportLayerAddress, ip, use_x213_nsap);
 	tli->iuTransportAssociation.present = RANAP_IuTransportAssociation_PR_bindingID;
 	OCTET_STRING_fromBuf(&tli->iuTransportAssociation.choice.bindingID,
 				(const char *) binding_id, sizeof(binding_id));
@@ -710,7 +711,9 @@
 }
 
 /*! \brief generate RANAP RAB ASSIGNMENT REQUEST message for CS (voice) */
-struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, uint16_t rtp_port)
+struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip,
+					    uint16_t rtp_port,
+					    bool use_x213_nsap)
 {
 	RANAP_ProtocolIE_FieldPair_t *pair;
 	RANAP_RAB_AssignmentRequestIEs_t ies;
@@ -731,7 +734,8 @@
 	//first.nAS_SynchronisationIndicator = FIXME;
 	first.rAB_Parameters = new_rab_par_voice();
 	first.userPlaneInformation = new_upi(RANAP_UserPlaneMode_support_mode_for_predefined_SDU_sizes, 1); /* 2? */
-	first.transportLayerInformation = new_transp_info_rtp(rtp_ip, rtp_port);
+	first.transportLayerInformation = new_transp_info_rtp(rtp_ip, rtp_port,
+							      use_x213_nsap);
 
 	/* put together the 'Second' part */
 	RANAP_RAB_SetupOrModifyItemSecond_t second;