diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2023-06-21 11:17:26 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2023-07-09 07:41:33 +0000 |
commit | 712b28e69588e55f83258c2f185796c2f9b8969d (patch) | |
tree | cca73d7c435432495fe3fe8ca23a98df6258b266 /src | |
parent | 0452cf94675f5a614653a43a0a1480d6d33df8ad (diff) |
ASCI: Use a unique call-id for RTP streams
The MGCP protocol features the 'C' (call-id) to identify which
connections belong to the same call. They may be used by MGW for
accounting or management procedures.
So far we sent the MNCC callref as call-id. Instead, add a separate
unique call_id number space. Assign a unique call_id to each
transaction.
Change-Id: I36c5f159fa0b54fb576ff8bd279928b895554793
Related: OS#4854
Diffstat (limited to 'src')
-rw-r--r-- | src/libmsc/gsm_04_08_cc.c | 2 | ||||
-rw-r--r-- | src/libmsc/msc_a.c | 8 | ||||
-rw-r--r-- | src/libmsc/msc_ho.c | 2 | ||||
-rw-r--r-- | src/libmsc/msc_t.c | 6 | ||||
-rw-r--r-- | src/libmsc/transaction.c | 3 |
5 files changed, 12 insertions, 9 deletions
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c index 8773db768..0195b0b2d 100644 --- a/src/libmsc/gsm_04_08_cc.c +++ b/src/libmsc/gsm_04_08_cc.c @@ -440,7 +440,7 @@ static int tch_bridge(struct gsm_network *net, const struct gsm_mncc_bridge *bri cl1 = trans1->msc_a->cc.call_leg; cl2 = trans2->msc_a->cc.call_leg; - return call_leg_local_bridge(cl1, trans1->callref, trans1, cl2, trans2->callref, trans2); + return call_leg_local_bridge(cl1, trans1->call_id, trans1, cl2, trans2->call_id, trans2); } static int gsm48_cc_rx_status_enq(struct gsm_trans *trans, struct msgb *msg) diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c index 11b242e8b..b9aaeaa38 100644 --- a/src/libmsc/msc_a.c +++ b/src/libmsc/msc_a.c @@ -620,7 +620,7 @@ int msc_a_ensure_cn_local_rtp(struct msc_a *msc_a, struct gsm_trans *cc_trans) * If no RAN side RTP is established, try to guess a preliminary codec from SDP -- before Assignment, picking a * codec from the SDP is more politeness/avoiding confusion than necessity. The actual codec to be used would be * determined later. If no codec could be determined, pass none for the time being. */ - return call_leg_ensure_ci(cl, RTP_TO_CN, cc_trans->callref, cc_trans, + return call_leg_ensure_ci(cl, RTP_TO_CN, cc_trans->call_id, cc_trans, rtp_to_ran->codecs_known ? &rtp_to_ran->codecs : NULL, NULL); } @@ -690,7 +690,7 @@ static void msc_a_call_leg_ran_local_addr_available(struct msc_a *msc_a) .osmux_present = msc_a->cc.call_leg->rtp[RTP_TO_RAN]->use_osmux, .osmux_cid = msc_a->cc.call_leg->rtp[RTP_TO_RAN]->local_osmux_cid, .call_id_present = true, - .call_id = cc_trans->callref, + .call_id = cc_trans->call_id, .lcls = cc_trans->cc.lcls, }, }; @@ -1898,7 +1898,7 @@ static int msc_a_start_assignment(struct msc_a *msc_a, struct gsm_trans *cc_tran * osmo_mgcpc_ep_fsm automagically waits for the first CRCX to complete before firing the second CRCX. The one * issued first here will also be the first CRCX sent to the MGW. Usually both still need to be set up. */ if (!cn_rtp_available) - call_leg_ensure_ci(cl, RTP_TO_CN, cc_trans->callref, cc_trans, + call_leg_ensure_ci(cl, RTP_TO_CN, cc_trans->call_id, cc_trans, &cc_trans->cc.local.audio_codecs, NULL); if (!ran_rtp_available) { struct sdp_audio_codecs *codecs; @@ -1906,7 +1906,7 @@ static int msc_a_start_assignment(struct msc_a *msc_a, struct gsm_trans *cc_tran codecs = &msc_a->c.ran->force_mgw_codecs_to_ran; else codecs = &cc_trans->cc.local.audio_codecs; - return call_leg_ensure_ci(cl, RTP_TO_RAN, cc_trans->callref, cc_trans, codecs, NULL); + return call_leg_ensure_ci(cl, RTP_TO_RAN, cc_trans->call_id, cc_trans, codecs, NULL); } /* Should these already be set up, immediately continue by retriggering the events signalling that the RTP diff --git a/src/libmsc/msc_ho.c b/src/libmsc/msc_ho.c index ce3f1006e..9e4417fa4 100644 --- a/src/libmsc/msc_ho.c +++ b/src/libmsc/msc_ho.c @@ -421,7 +421,7 @@ static void msc_ho_send_handover_request(struct msc_a *msc_a) } ran_enc_msg.handover_request.geran.channel_type = &channel_type; ran_enc_msg.handover_request.call_id_present = true; - ran_enc_msg.handover_request.call_id = cc_trans->callref; + ran_enc_msg.handover_request.call_id = cc_trans->call_id; sdp_audio_codecs_to_speech_codec_list(&scl, &cc_trans->cc.local.audio_codecs); if (!scl.len) { diff --git a/src/libmsc/msc_t.c b/src/libmsc/msc_t.c index b3429ed1d..eb6c79784 100644 --- a/src/libmsc/msc_t.c +++ b/src/libmsc/msc_t.c @@ -160,7 +160,7 @@ static int msc_t_ho_request_decode_and_store_cb(struct osmo_fsm_inst *msc_t_fi, } msc_t->inter_msc.cell_id_target = ran_dec->handover_request.cell_id_target; - msc_t->inter_msc.callref = ran_dec->handover_request.call_id; + msc_t->inter_msc.call_id = ran_dec->handover_request.call_id; /* TODO other parameters...? * Global Call Reference @@ -358,8 +358,8 @@ void msc_t_fsm_wait_local_rtp_onenter(struct osmo_fsm_inst *fi, uint32_t prev_st MSC_EV_CALL_LEG_RTP_LOCAL_ADDR_AVAILABLE, MSC_EV_CALL_LEG_RTP_COMPLETE); if (!msc_t->inter_msc.call_leg - || call_leg_ensure_ci(msc_t->inter_msc.call_leg, RTP_TO_RAN, msc_t->inter_msc.callref, NULL, NULL, NULL) - || call_leg_ensure_ci(msc_t->inter_msc.call_leg, RTP_TO_CN, msc_t->inter_msc.callref, NULL, NULL, NULL)) { + || call_leg_ensure_ci(msc_t->inter_msc.call_leg, RTP_TO_RAN, msc_t->inter_msc.call_id, NULL, NULL, NULL) + || call_leg_ensure_ci(msc_t->inter_msc.call_leg, RTP_TO_CN, msc_t->inter_msc.call_id, NULL, NULL, NULL)) { msc_t_error("Failed to set up call leg\n"); return; } diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c index 6c12409dd..190da2943 100644 --- a/src/libmsc/transaction.c +++ b/src/libmsc/transaction.c @@ -181,6 +181,8 @@ static const char *trans_vsub_use(enum trans_type type) return get_value_string_or_null(trans_type_names, type) ? : "trans-type-unknown"; } +static uint32_t new_call_id = 1; + /*! Allocate a new transaction and add it to network list * \param[in] net Netwokr in which we allocate transaction * \param[in] subscr Subscriber for which we allocate transaction @@ -212,6 +214,7 @@ struct gsm_trans *trans_alloc(struct gsm_network *net, .log_subsys = subsys, .transaction_id = trans_id, .callref = callref, + .call_id = new_call_id++, .net = net, /* empty bearer_cap: make sure the speech_ver array is empty */ .bearer_cap = { |