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
This commit is contained in:
parent
e75a6297da
commit
f6673b7257
|
@ -32,7 +32,9 @@ struct msgb *ranap_new_msg_iu_rel_compl(void);
|
|||
struct msgb *ranap_new_msg_paging_cmd(const char *imsi, const uint32_t *tmsi, int is_ps, uint32_t cause);
|
||||
|
||||
/*! \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);
|
||||
|
||||
/*! \brief generate RANAP RAB ASSIGNMENT REQUEST message for PS (data) */
|
||||
struct msgb *ranap_new_msg_rab_assign_data(uint8_t rab_id, uint32_t gtp_ip,
|
||||
|
|
|
@ -647,7 +647,8 @@ static void new_transp_layer_addr(BIT_STRING_t *out, uint32_t ip, bool use_x213_
|
|||
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 @@ static RANAP_TransportLayerInformation_t *new_transp_info_rtp(uint32_t ip, uint1
|
|||
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 @@ static void assign_new_ra_id(RANAP_RAB_ID_t *id, uint8_t rab_id)
|
|||
}
|
||||
|
||||
/*! \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 @@ struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, uin
|
|||
//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;
|
||||
|
|
|
@ -148,7 +148,7 @@ int main(int argc, char **argv)
|
|||
msgb_free(msg);
|
||||
|
||||
printf("\n==> RAB ASSIGNMENT COMMAND (VOICE)\n");
|
||||
msg = ranap_new_msg_rab_assign_voice(1, rtp_ip, rtp_port);
|
||||
msg = ranap_new_msg_rab_assign_voice(1, rtp_ip, rtp_port, 1);
|
||||
if (msg)
|
||||
printf("%s\n", msgb_hexdump(msg));
|
||||
msgb_free(msg);
|
||||
|
|
Loading…
Reference in New Issue