lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

April 2023

  • 1 participants
  • 2252 discussions
[M] Change in osmo-bts[master]: nm: Drop NM_EV_SETATTR_{ACK/NACK}
by pespin 05 Apr '23

05 Apr '23
Attention is currently required from: fixeria. Hello Jenkins Builder, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bts/+/32196 to look at the new patch set (#4). Change subject: nm: Drop NM_EV_SETATTR_{ACK/NACK} ...................................................................... nm: Drop NM_EV_SETATTR_{ACK/NACK} Simply return error codes from lower layer implementations, and do the OML handling in the common NM TS 12.21 FSMs. As a result, we simplify the logic in the lower layers. Change-Id: I281c07bb5ad88ee03542f092141cebe036d10aee --- M include/osmo-bts/bts_model.h M include/osmo-bts/nm_common_fsm.h M src/common/nm_bb_transc_fsm.c M src/common/nm_bts_fsm.c M src/common/nm_bts_sm_fsm.c M src/common/nm_channel_fsm.c M src/common/nm_common_fsm.c M src/common/nm_radio_carrier_fsm.c M src/osmo-bts-lc15/oml.c M src/osmo-bts-oc2g/oml.c M src/osmo-bts-octphy/l1_oml.c M src/osmo-bts-omldummy/bts_model.c M src/osmo-bts-sysmo/oml.c M src/osmo-bts-trx/l1_if.c M src/osmo-bts-virtual/bts_model.c M tests/stubs.c 16 files changed, 80 insertions(+), 130 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/96/32196/4 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32196 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I281c07bb5ad88ee03542f092141cebe036d10aee Gerrit-Change-Number: 32196 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[L] Change in osmo-bts[master]: WIP: Introduce NM FSM for GPRS NSE object
by pespin 05 Apr '23

05 Apr '23
Attention is currently required from: fixeria. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bts/+/32213 to look at the new patch set (#2). Change subject: WIP: Introduce NM FSM for GPRS NSE object ...................................................................... WIP: Introduce NM FSM for GPRS NSE object TODO: we are not copying the content of IPA Set ATTR in the IP Set ATTR ACK we are sending back. Furthermore, osmo-bsc doesn't seem to expect that ACK but something else... Change-Id: I01eadc63214a2eb5e1bce455c7e5b62bd41905ea --- M include/osmo-bts/bts.h M include/osmo-bts/nm_common_fsm.h M src/common/Makefile.am M src/common/bts.c M src/common/nm_bts_sm_fsm.c A src/common/nm_gprs_nse_fsm.c M src/common/oml.c M src/osmo-bts-lc15/oml.c M src/osmo-bts-oc2g/oml.c M src/osmo-bts-octphy/l1_oml.c M src/osmo-bts-omldummy/bts_model.c M src/osmo-bts-sysmo/oml.c M src/osmo-bts-trx/l1_if.c M src/osmo-bts-virtual/bts_model.c 14 files changed, 378 insertions(+), 56 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/13/32213/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32213 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I01eadc63214a2eb5e1bce455c7e5b62bd41905ea Gerrit-Change-Number: 32213 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in osmo-bts[master]: NM: NACK received OML OPSTART if no attributes were set beforehand
by pespin 05 Apr '23

05 Apr '23
Attention is currently required from: fixeria. Hello Jenkins Builder, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bts/+/32212 to look at the new patch set (#3). Change subject: NM: NACK received OML OPSTART if no attributes were set beforehand ...................................................................... NM: NACK received OML OPSTART if no attributes were set beforehand Related: OS#5992 Change-Id: I771ecc2f60873a3549e8a07a2e57c7948dfc993e --- M src/common/nm_bb_transc_fsm.c M src/common/nm_bts_fsm.c M src/common/nm_bts_sm_fsm.c M src/common/nm_channel_fsm.c M src/common/nm_radio_carrier_fsm.c 5 files changed, 40 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/12/32212/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32212 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I771ecc2f60873a3549e8a07a2e57c7948dfc993e Gerrit-Change-Number: 32212 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[M] Change in osmo-msc[master]: msc_main: close SMS db on startup error
by fixeria 05 Apr '23

05 Apr '23
Attention is currently required from: osmith. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/32085 ) Change subject: msc_main: close SMS db on startup error ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/32085 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I9bb799048db5fcdb2a2520107bd75d5f7a865459 Gerrit-Change-Number: 32085 Gerrit-PatchSet: 3 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Wed, 05 Apr 2023 11:14:46 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-bts[master]: oml.c: Remove dot character at the end of log lines
by pespin 05 Apr '23

05 Apr '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/32219 ) Change subject: oml.c: Remove dot character at the end of log lines ...................................................................... oml.c: Remove dot character at the end of log lines Change-Id: Iaf061bb752f9808a6ab31049b9e87920a6b07f3d --- M src/common/oml.c 1 file changed, 18 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/19/32219/1 diff --git a/src/common/oml.c b/src/common/oml.c index 5ffb6ff..5474fb1 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -217,7 +217,7 @@ add_trx_attr(out_msg, trx); break; default: - LOGP(DOML, LOGL_ERROR, "%s: O&M Get Attributes [%u], %s is unsupported by TRX.\n", + LOGP(DOML, LOGL_ERROR, "%s: O&M Get Attributes [%u], %s is unsupported by TRX\n", gsm_trx_name(trx), i, get_value_string(abis_nm_att_names, attr[i])); /* Push this tag to the list of unsupported attributes */ buf = msgb_push(out_msg, 1); @@ -256,7 +256,7 @@ add_bts_feat(out_msg, bts); break; default: - LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported by BTS.\n", i, + LOGP(DOML, LOGL_ERROR, "O&M Get Attributes [%u], %s is unsupported by BTS\n", i, get_value_string(abis_nm_att_names, attr[i])); /* Push this tag to the list of unsupported attributes */ buf = msgb_push(out_msg, 1); @@ -450,13 +450,13 @@ /* alter message type */ if (cause) { - LOGPFOH(DOML, LOGL_NOTICE, foh, "Sending FOM NACK with cause %s.\n", + LOGPFOH(DOML, LOGL_NOTICE, foh, "Sending FOM NACK with cause %s\n", abis_nm_nack_cause_name(cause)); foh->msg_type += 2; /* nack */ /* add cause */ msgb_tv_put(msg, NM_ATT_NACK_CAUSES, cause); } else { - LOGPFOH(DOML, LOGL_DEBUG, foh, "Sending FOM ACK.\n"); + LOGPFOH(DOML, LOGL_DEBUG, foh, "Sending FOM ACK\n"); foh->msg_type++; /* ack */ } @@ -566,7 +566,7 @@ oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MAJOR, OSMO_EVT_WARN_SW_WARN, "Given ARFCN %u is not supported", arfcn); - LOGPFOH(DOML, LOGL_ERROR, foh, "Given ARFCN %u is not supported.\n", arfcn); + LOGPFOH(DOML, LOGL_ERROR, foh, "Given ARFCN %u is not supported\n", arfcn); return oml_fom_ack_nack(msg, NM_NACK_FREQ_NOTAVAIL); } } @@ -697,7 +697,7 @@ if (TLVP_PRES_LEN(&tp, NM_ATT_BTS_AIR_TIMER, 1)) { uint8_t t3105 = *TLVP_VAL(&tp, NM_ATT_BTS_AIR_TIMER); if (t3105 == 0) { - LOGPFOH(DOML, LOGL_NOTICE, foh, "T3105 must have a value != 0.\n"); + LOGPFOH(DOML, LOGL_NOTICE, foh, "T3105 must have a value != 0\n"); return oml_fom_ack_nack(msg, NM_NACK_PARAM_RANGE); } bts->t3105_ms = t3105 * 10; @@ -824,7 +824,7 @@ if (arfcn >= 1024) { /* 0 .. 1023 (1024 channels total) */ oml_tx_failure_event_rep(&trx->bts->mo, NM_SEVER_MAJOR, OSMO_EVT_WARN_SW_WARN, "Given ARFCN %u is unsupported", arfcn); - LOGPFOH(DOML, LOGL_NOTICE, foh, "Given ARFCN %u is unsupported.\n", arfcn); + LOGPFOH(DOML, LOGL_NOTICE, foh, "Given ARFCN %u is unsupported\n", arfcn); return oml_fom_ack_nack(msg, NM_NACK_FREQ_NOTAVAIL); } trx->arfcn = arfcn; @@ -940,7 +940,7 @@ /* Check frequency hopping parameters (HSN, MAIO, ARFCN list) */ if (TLVP_PRESENT(&tp, NM_ATT_HSN) || TLVP_PRESENT(&tp, NM_ATT_MAIO)) { if (!osmo_bts_has_feature(bts->features, BTS_FEAT_HOPPING)) { - LOGPFOH(DOML, LOGL_ERROR, foh, "SET CHAN ATTR: Frequency hopping not supported.\n"); + LOGPFOH(DOML, LOGL_ERROR, foh, "SET CHAN ATTR: Frequency hopping not supported\n"); return oml_fom_ack_nack(msg, NM_NACK_SPEC_IMPL_NOTSUPP); } @@ -974,7 +974,7 @@ /* 9.4.52 Starting Time */ if (TLVP_PRESENT(&tp, NM_ATT_START_TIME)) { - LOGPFOH(DOML, LOGL_NOTICE, foh, "SET CHAN ATTR: Starting time not supported.\n"); + LOGPFOH(DOML, LOGL_NOTICE, foh, "SET CHAN ATTR: Starting time not supported\n"); return oml_fom_ack_nack(msg, NM_NACK_SPEC_IMPL_NOTSUPP); } -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32219 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Iaf061bb752f9808a6ab31049b9e87920a6b07f3d Gerrit-Change-Number: 32219 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: logging: print talloc report on exit from vty test
by msuraev 05 Apr '23

05 Apr '23
msuraev has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/31868 ) ( 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: logging: print talloc report on exit from vty test ...................................................................... logging: print talloc report on exit from vty test There's not much point in deallocating memory in a test fixture which is about to terminate anyway. Having talloc report though is handy to make sure we're not leaking smth. Change-Id: I5739bceb90d36164fd4cbf21242bbe26bd1e7075 --- M tests/logging/logging_vty_test.c 1 file changed, 16 insertions(+), 3 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/logging/logging_vty_test.c b/tests/logging/logging_vty_test.c index 15f7fc2..c1a2853 100644 --- a/tests/logging/logging_vty_test.c +++ b/tests/logging/logging_vty_test.c @@ -285,10 +285,10 @@ osmo_select_main(0); } - log_fini(); + talloc_report(tall_vty_ctx, stderr); + talloc_report_full(root_ctx, stderr); - talloc_free(root_ctx); - talloc_free(tall_vty_ctx); + log_fini(); return 0; } -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31868 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I5739bceb90d36164fd4cbf21242bbe26bd1e7075 Gerrit-Change-Number: 31868 Gerrit-PatchSet: 4 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[L] Change in osmo-mgw[master]: mgcp_codec: fix codec decision
by Jenkins Builder 05 Apr '23

05 Apr '23
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32218 ) Change subject: mgcp_codec: fix codec decision ...................................................................... Patch Set 1: (1 comment) File src/libosmo-mgcp/mgcp_codec.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5740): https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/57fc3d20_4c744b6f PS1, Line 387: OSMO_ASSERT(codecs_assigned <= MGCP_MAX_CODECS) trailing whitespace -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32218 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I6c3291f825488e5d8ce136aeb18450156794aeb5 Gerrit-Change-Number: 32218 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Wed, 05 Apr 2023 11:02:27 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[L] Change in osmo-mgw[master]: mgcp_codec: fix codec decision
by dexter 05 Apr '23

05 Apr '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32218 ) Change subject: mgcp_codec: fix codec decision ...................................................................... mgcp_codec: fix codec decision Unfortunately OsmoMGW was never really tested with multiple different codecs on either side of the connection. While OsmoMSC and OsmoBSC only assign exactly one codec on each side this has never been a problem, however it might become a problem when a call againt assigns multiple codecs on one side. This has been observed in a setup where OsmoMGW had one leg towards an external call agent. Also due to recent upgrades to the TTCN3 tests we are now able to simulate different codecs on both sides to pinpoint issues. Testing has shown that OsmoMGW has difficulties with multiple codecs. The reason for this is that the function that makes the codec decision was not fully finished. So let's finish the codec decision function and let's also use that decision when patching the payload type of outgoing RTP packets. Related: OS#5461 Change-Id: I6c3291f825488e5d8ce136aeb18450156794aeb5 --- M include/osmocom/mgcp/mgcp_codec.h M include/osmocom/mgcp/mgcp_trunk.h M src/libosmo-mgcp/mgcp_codec.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok 8 files changed, 277 insertions(+), 237 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/18/32218/1 diff --git a/include/osmocom/mgcp/mgcp_codec.h b/include/osmocom/mgcp/mgcp_codec.h index 1f29b08..eae2918 100644 --- a/include/osmocom/mgcp/mgcp_codec.h +++ b/include/osmocom/mgcp/mgcp_codec.h @@ -13,8 +13,7 @@ void mgcp_codec_summary(struct mgcp_conn_rtp *conn); void mgcp_codec_reset_all(struct mgcp_conn_rtp *conn); int mgcp_codec_add(struct mgcp_conn_rtp *conn, int payload_type, const char *audio_name, const struct mgcp_codec_param *param); -int mgcp_codec_decide(struct mgcp_conn_rtp *conn); -struct mgcp_rtp_codec *mgcp_codec_find_convertible(struct mgcp_conn_rtp *conn, struct mgcp_rtp_codec *codec); +int mgcp_codec_decide(struct mgcp_conn_rtp *conn, struct mgcp_conn_rtp *conn_opposite); const struct mgcp_rtp_codec *mgcp_codec_pt_find_by_subtype_name(struct mgcp_conn_rtp *conn, const char *subtype_name, unsigned int match_nr); bool mgcp_codec_amr_align_mode_is_indicated(const struct mgcp_rtp_codec *codec); diff --git a/include/osmocom/mgcp/mgcp_trunk.h b/include/osmocom/mgcp/mgcp_trunk.h index 33c3d5b..e608161 100644 --- a/include/osmocom/mgcp/mgcp_trunk.h +++ b/include/osmocom/mgcp/mgcp_trunk.h @@ -31,8 +31,6 @@ int audio_send_ptime; int audio_send_name; - int no_audio_transcoding; - int omit_rtcp; int keepalive_interval; diff --git a/src/libosmo-mgcp/mgcp_codec.c b/src/libosmo-mgcp/mgcp_codec.c index 003c4c4..e83bb0d 100644 --- a/src/libosmo-mgcp/mgcp_codec.c +++ b/src/libosmo-mgcp/mgcp_codec.c @@ -276,87 +276,6 @@ return -EINVAL; } -/* Check if the given codec is applicable on the specified endpoint - * Helper function for mgcp_codec_decide() */ -static bool is_codec_compatible(const struct mgcp_endpoint *endp, const struct mgcp_rtp_codec *codec) -{ - /* A codec name must be set, if not, this might mean that the codec - * (payload type) that was assigned is unknown to us so we must stop - * here. */ - if (!strlen(codec->subtype_name)) - return false; - - /* FIXME: implement meaningful checks to make sure that the given codec - * is compatible with the given endpoint */ - - return true; -} - -/*! Decide for one suitable codec - * \param[in] conn related rtp-connection. - * \returns 0 on success, -EINVAL on failure. */ -int mgcp_codec_decide(struct mgcp_conn_rtp *conn) -{ - struct mgcp_rtp_end *rtp; - unsigned int i; - struct mgcp_endpoint *endp; - bool codec_assigned = false; - - endp = conn->conn->endp; - rtp = &conn->end; - - /* This function works on the results the SDP/LCO parser has extracted - * from the MGCP message. The goal is to select a suitable codec for - * the given connection. When transcoding is available, the first codec - * from the codec list is taken without further checking. When - * transcoding is not available, then the choice must be made more - * carefully. Each codec in the list is checked until one is found that - * is rated compatible. The rating is done by the helper function - * is_codec_compatible(), which does the actual checking. */ - for (i = 0; i < rtp->codecs_assigned; i++) { - /* When no transcoding is available, avoid codecs that would - * require transcoding. */ - if (endp->trunk->no_audio_transcoding && !is_codec_compatible(endp, &rtp->codecs[i])) { - LOGP(DLMGCP, LOGL_NOTICE, "transcoding not available, skipping codec: %d/%s\n", - rtp->codecs[i].payload_type, rtp->codecs[i].subtype_name); - continue; - } - - rtp->codec = &rtp->codecs[i]; - codec_assigned = true; - break; - } - - /* FIXME: To the reviewes: This is problematic. I do not get why we - * need to reset the packet_duration_ms depending on the codec - * selection. I thought it were all 20ms? Is this to address some - * cornercase. (This piece of code was in the code path before, - * together with the note: "TODO/XXX: Store this per codec and derive - * it on use" */ - if (codec_assigned) { - if (rtp->maximum_packet_time >= 0 - && rtp->maximum_packet_time * rtp->codec->frame_duration_den > - rtp->codec->frame_duration_num * 1500) - rtp->packet_duration_ms = 0; - - return 0; - } - - return -EINVAL; -} - -/* Check if the codec has a specific AMR mode (octet-aligned or bandwith-efficient) set. */ -bool mgcp_codec_amr_align_mode_is_indicated(const struct mgcp_rtp_codec *codec) -{ - if (codec->param_present == false) - return false; - if (!codec->param.amr_octet_aligned_present) - return false; - if (strcmp(codec->subtype_name, "AMR") != 0) - return false; - return true; -} - /* Return true if octet-aligned is set in the given codec. Default to octet-aligned=0, i.e. bandwidth-efficient mode. * See RFC4867 "RTP Payload Format for AMR and AMR-WB" sections "8.1. AMR Media Type Registration" and "8.2. AMR-WB * Media Type Registration": @@ -425,11 +344,31 @@ return true; } -/*! For a given codec, find a convertible codec in the given connection. - * \param[in] conn connection to search for a convertible codec - * \param[in] codec for which a convertible codec shall be found. - * \returns codec on success, -NULL on failure. */ -struct mgcp_rtp_codec *mgcp_codec_find_convertible(struct mgcp_conn_rtp *conn, struct mgcp_rtp_codec *codec) +struct mgcp_rtp_codec *mgcp_codec_find_same(struct mgcp_conn_rtp *conn, struct mgcp_rtp_codec *codec) +{ + struct mgcp_rtp_end *rtp_end; + unsigned int i; + unsigned int codecs_assigned; + struct mgcp_rtp_codec *found_same_codec = NULL; + + rtp_end = &conn->end; + + /* Use the codec information from the source and try to find the equivalent of it on the destination side. In + * the first run we will look for an exact match. */ + codecs_assigned = rtp_end->codecs_assigned; + OSMO_ASSERT(codecs_assigned <= MGCP_MAX_CODECS); + for (i = 0; i < codecs_assigned; i++) { + if (codecs_same(codec, &rtp_end->codecs[i])) { + found_same_codec = &rtp_end->codecs[i]; + break; + } + } + + return found_same_codec; +} + +/* For a given codec, find a convertible codec in the given connection. */ +static struct mgcp_rtp_codec *codec_find_convertible(struct mgcp_conn_rtp *conn, struct mgcp_rtp_codec *codec) { struct mgcp_rtp_end *rtp_end; unsigned int i; @@ -440,17 +379,12 @@ /* Use the codec information from the source and try to find the equivalent of it on the destination side. In * the first run we will look for an exact match. */ - codecs_assigned = rtp_end->codecs_assigned; - OSMO_ASSERT(codecs_assigned <= MGCP_MAX_CODECS); - for (i = 0; i < codecs_assigned; i++) { - if (codecs_same(codec, &rtp_end->codecs[i])) { - codec_convertible = &rtp_end->codecs[i]; - break; - } - } + codec_convertible = mgcp_codec_find_same(conn, codec); /* In case we weren't able to find an exact match, we will try to find a match that is the same codec, but the * payload format may be different. This alternative will require a frame format conversion (i.e. AMR bwe->oe) */ + codecs_assigned = rtp_end->codecs_assigned; + OSMO_ASSERT(codecs_assigned <= MGCP_MAX_CODECS) if (!codec_convertible) { for (i = 0; i < codecs_assigned; i++) { if (codecs_convertible(codec, &rtp_end->codecs[i])) { @@ -463,6 +397,81 @@ return codec_convertible; } +/*! Decide for one suitable codec on both of the given connections. In case an opposite connection is not available + * a tentative decision is made. + * \param[inout] conn related rtp-connection. + * \param[inout] conn related opposite rtp-connection (NULL if not present). + * \returns 0 on success, -EINVAL on failure. */ +int mgcp_codec_decide(struct mgcp_conn_rtp *conn, struct mgcp_conn_rtp *conn_opposite) +{ + unsigned int i; + struct mgcp_rtp_codec *found_same_codec_opposite = NULL; + + /* In case no opposite connection is available (yet), we are forced to make a simple tentative decision: + * We just use the first codec of the connection (conn) */ + OSMO_ASSERT(conn->end.codecs_assigned <= MGCP_MAX_CODECS); + if (!conn_opposite) { + if (conn->end.codecs_assigned >= 1) { + conn->end.codec = &conn->end.codecs[0]; + return 0; + } else + return -EINVAL; + } + + /* In case the opposite connection is available but has no codecs assigned we are forced to make the same + * tentative decision as above */ + if (conn_opposite->end.codecs_assigned == 0) { + if (conn->end.codecs_assigned >= 1) { + conn->end.codec = &conn->end.codecs[0]; + return 0; + } else + return -EINVAL; + } + + /* Compare all codecs of the connection (conn) to the codecs of the opposite connection. In case of a match set + * this codec on both connections. This would be an ideal selection since no codec conversion would be + * required. */ + for (i = 0; i < conn->end.codecs_assigned; i++) { + found_same_codec_opposite = mgcp_codec_find_same(conn_opposite, &conn->end.codecs[i]); + if (found_same_codec_opposite) { + /* We found the a codec that is exactly the same (same codec, same payload format etc.) on both + * sides. We now set the codec on both connections */ + conn_opposite->end.codec = found_same_codec_opposite; + conn->end.codec = mgcp_codec_find_same(conn, found_same_codec_opposite); + OSMO_ASSERT(conn->end.codec); + return 0; + } + } + + /* In case we could not find a codec that is exactly the same, lets at least try to find one that we are able + * to convert. */ + for (i = 0; i < conn->end.codecs_assigned; i++) { + found_same_codec_opposite = codec_find_convertible(conn_opposite, &conn->end.codecs[i]); + if (found_same_codec_opposite) { + /* We found the a codec that is exactly the same (same codec, same payload format etc.) on both + * sides. We now set the codec on both connections */ + conn_opposite->end.codec = found_same_codec_opposite; + conn->end.codec = codec_find_convertible(conn, found_same_codec_opposite); + OSMO_ASSERT(conn->end.codec); + return 0; + } + } + + return -EINVAL; +} + +/* Check if the codec has a specific AMR mode (octet-aligned or bandwith-efficient) set. */ +bool mgcp_codec_amr_align_mode_is_indicated(const struct mgcp_rtp_codec *codec) +{ + if (codec->param_present == false) + return false; + if (!codec->param.amr_octet_aligned_present) + return false; + if (strcmp(codec->subtype_name, "AMR") != 0) + return false; + return true; +} + /* Find the payload type number configured for a specific codec by SDP. * For example, IuUP gets assigned a payload type number, and the endpoint needs to translate that to the number * assigned to "AMR" on the other conn (by a=rtpmap:N). diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index ce08dd4..51561d2 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -511,9 +511,8 @@ if (!codec_src) return -EINVAL; - /* Lookup a suitable codec in the destination connection. (The codec must be of the same type or at least - * convertible) */ - codec_dst = mgcp_codec_find_convertible(conn_dst, codec_src); + /* Lookup a suitable codec in the destination connection. */ + codec_dst = conn_dst->end.codec; if (!codec_dst) return -EINVAL; diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index b697a94..c57c9dc 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -761,6 +761,9 @@ struct mgcp_request_data *rq, int have_sdp, bool crcx) { struct mgcp_endpoint *endp = rq->endp; + struct mgcp_conn *conn_opposite; + struct mgcp_conn_rtp *conn_rtp_opposite; + int rc; char *cmd; @@ -802,8 +805,15 @@ goto error; } + /* Try to find an opposite RTP connection that we can include in the codec decision. */ + conn_opposite = mgcp_find_dst_conn(conn->conn); + if (conn_opposite && conn_opposite->type == MGCP_CONN_TYPE_RTP) + conn_rtp_opposite = &conn_opposite->u.rtp; + else + conn_rtp_opposite = NULL; + /* Make codec decision */ - if (mgcp_codec_decide(conn) != 0) + if (mgcp_codec_decide(conn, conn_rtp_opposite) != 0) goto error; return 0; diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index e404fb5..9405007 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -120,8 +120,6 @@ trunk->audio_send_name ? "" : "no ", VTY_NEWLINE); vty_out(vty, " number endpoints %u%s", trunk->v.vty_number_endpoints, VTY_NEWLINE); - vty_out(vty, " %sallow-transcoding%s", - trunk->no_audio_transcoding ? "no " : "", VTY_NEWLINE); if (strlen(g_cfg->call_agent_addr)) vty_out(vty, " call-agent ip %s%s", g_cfg->call_agent_addr, VTY_NEWLINE); @@ -700,25 +698,17 @@ return CMD_SUCCESS; } -DEFUN_USRATTR(cfg_mgcp_allow_transcoding, - cfg_mgcp_allow_transcoding_cmd, - X(MGW_CMD_ATTR_NEWCONN), - "allow-transcoding", "Allow transcoding\n") +DEFUN_DEPRECATED(cfg_mgcp_allow_transcoding, + cfg_mgcp_allow_transcoding_cmd, + "allow-transcoding", "Allow transcoding\n") { - struct mgcp_trunk *trunk = mgcp_trunk_by_num(g_cfg, MGCP_TRUNK_VIRTUAL, MGCP_VIRT_TRUNK_ID); - OSMO_ASSERT(trunk); - trunk->no_audio_transcoding = 0; return CMD_SUCCESS; } -DEFUN_USRATTR(cfg_mgcp_no_allow_transcoding, - cfg_mgcp_no_allow_transcoding_cmd, - X(MGW_CMD_ATTR_NEWCONN), - "no allow-transcoding", NO_STR "Allow transcoding\n") +DEFUN_DEPRECATED(cfg_mgcp_no_allow_transcoding, + cfg_mgcp_no_allow_transcoding_cmd, + "no allow-transcoding", NO_STR "Allow transcoding\n") { - struct mgcp_trunk *trunk = mgcp_trunk_by_num(g_cfg, MGCP_TRUNK_VIRTUAL, MGCP_VIRT_TRUNK_ID); - OSMO_ASSERT(trunk); - trunk->no_audio_transcoding = 1; return CMD_SUCCESS; } @@ -1069,8 +1059,6 @@ if (trunk->audio_fmtp_extra) vty_out(vty, " sdp audio fmtp-extra %s%s", trunk->audio_fmtp_extra, VTY_NEWLINE); - vty_out(vty, " %sallow-transcoding%s", - trunk->no_audio_transcoding ? "no " : "", VTY_NEWLINE); } return CMD_SUCCESS; @@ -1319,23 +1307,17 @@ return CMD_SUCCESS; } -DEFUN_USRATTR(cfg_trunk_allow_transcoding, - cfg_trunk_allow_transcoding_cmd, - X(MGW_CMD_ATTR_NEWCONN), - "allow-transcoding", "Allow transcoding\n") +DEFUN_DEPRECATED(cfg_trunk_allow_transcoding, + cfg_trunk_allow_transcoding_cmd, + "allow-transcoding", "Allow transcoding\n") { - struct mgcp_trunk *trunk = vty->index; - trunk->no_audio_transcoding = 0; return CMD_SUCCESS; } -DEFUN_USRATTR(cfg_trunk_no_allow_transcoding, - cfg_trunk_no_allow_transcoding_cmd, - X(MGW_CMD_ATTR_NEWCONN), - "no allow-transcoding", NO_STR "Allow transcoding\n") +DEFUN_DEPRECATED(cfg_trunk_no_allow_transcoding, + cfg_trunk_no_allow_transcoding_cmd, + "no allow-transcoding", NO_STR "Allow transcoding\n") { - struct mgcp_trunk *trunk = vty->index; - trunk->no_audio_transcoding = 1; return CMD_SUCCESS; } diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index bc2dae0..ea6e2e5 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -1467,7 +1467,6 @@ /* Allocate 5@mgw and let osmo-mgw pick a codec from the list */ last_endpoint[0] = '\0'; inp = create_msg(CRCX_MULT_GSM_EXACT, NULL); - trunk->no_audio_transcoding = 1; resp = mgcp_handle_message(cfg, inp); OSMO_ASSERT(get_conn_id_from_response(resp->data, conn_id, sizeof(conn_id)) == 0); @@ -1511,7 +1510,6 @@ last_endpoint[0] = '\0'; inp = create_msg(CRCX_MULT_GSM_EXACT, NULL); - trunk->no_audio_transcoding = 0; resp = mgcp_handle_message(cfg, inp); OSMO_ASSERT(get_conn_id_from_response(resp->data, conn_id, sizeof(conn_id)) == 0); @@ -1769,26 +1767,25 @@ .amr_octet_aligned_present = false, }; -struct testcase_mgcp_codec_find_convertible_codec { +struct testcase_mgcp_codec_decide_codec { int payload_type; const char *audio_name; const struct mgcp_codec_param *param; int expect_rc; }; -struct testcase_mgcp_codec_find_convertible_expect { - bool end; +struct testcase_mgcp_codec_decide_expect { int payload_type_map[2]; }; -struct testcase_mgcp_codec_find_convertible { +struct testcase_mgcp_codec_decide { const char *descr; /* two conns on an endpoint, each with N configured codecs */ - struct testcase_mgcp_codec_find_convertible_codec codecs[2][10]; - struct testcase_mgcp_codec_find_convertible_expect expect[32]; + struct testcase_mgcp_codec_decide_codec codecs[2][10]; + struct testcase_mgcp_codec_decide_expect expect[2]; }; -static const struct testcase_mgcp_codec_find_convertible test_mgcp_codec_find_convertible_cases[] = { +static const struct testcase_mgcp_codec_decide test_mgcp_codec_find_convertible_cases[] = { { .descr = "same order, but differing payload type numbers", .codecs = { @@ -1805,12 +1802,10 @@ }, .expect = { { .payload_type_map = {112, 96}, }, - { .payload_type_map = {0, 0}, }, - { .payload_type_map = {111, 97} }, - { .payload_type_map = {123, -EINVAL} }, - { .end = true }, + { .payload_type_map = {112, 96}, }, }, }, + { .descr = "different order and different payload type numbers", .codecs = { @@ -1826,11 +1821,8 @@ }, }, .expect = { - { .payload_type_map = {112, 96}, }, { .payload_type_map = {0, 0}, }, - { .payload_type_map = {111, 97} }, - { .payload_type_map = {123, -EINVAL} }, - { .end = true }, + { .payload_type_map = {111, 97}, }, }, }, { @@ -1848,11 +1840,8 @@ }, }, .expect = { - { .payload_type_map = {96, 97}, }, - { .payload_type_map = {97, 96}, }, { .payload_type_map = {0, 0}, }, - { .payload_type_map = {123, -EINVAL} }, - { .end = true }, + { .payload_type_map = {96, 97}, }, }, }, { @@ -1868,10 +1857,8 @@ }, }, .expect = { - { .payload_type_map = {112, -EINVAL}, }, - { .payload_type_map = {0, -EINVAL}, }, - { .payload_type_map = {111, -EINVAL} }, - { .end = true }, + { .payload_type_map = {-EINVAL, -EINVAL}, }, + { .payload_type_map = {-EINVAL, 96}, }, }, }, { @@ -1888,13 +1875,11 @@ }, .expect = { { .payload_type_map = {112, -EINVAL}, }, - { .payload_type_map = {0, -EINVAL}, }, - { .payload_type_map = {111, -EINVAL} }, - { .end = true }, + { .payload_type_map = {-EINVAL, -EINVAL}, }, }, }, { - .descr = "test AMR with differing octet-aligned settings", + .descr = "test AMR with differing octet-aligned settings (both <-> both)", .codecs = { { { 111, "AMR/8000", &amr_param_octet_aligned_true, }, @@ -1908,8 +1893,38 @@ .expect = { { .payload_type_map = {111, 121}, }, { .payload_type_map = {112, 122} }, - { .payload_type_map = {123, -EINVAL} }, - { .end = true }, + }, + }, + { + .descr = "test AMR with differing octet-aligned settings (oa <-> both)", + .codecs = { + { + { 111, "AMR/8000", &amr_param_octet_aligned_true, }, + }, + { + { 122, "AMR/8000", &amr_param_octet_aligned_false, }, + { 121, "AMR/8000", &amr_param_octet_aligned_true, }, + }, + }, + .expect = { + { .payload_type_map = {111, 121}, }, + { .payload_type_map = {111, 121}, }, + }, + }, + { + .descr = "test AMR with differing octet-aligned settings (bwe <-> both)", + .codecs = { + { + { 112, "AMR/8000", &amr_param_octet_aligned_false, }, + }, + { + { 122, "AMR/8000", &amr_param_octet_aligned_false, }, + { 121, "AMR/8000", &amr_param_octet_aligned_true, }, + }, + }, + .expect = { + { .payload_type_map = {112, 122}, }, + { .payload_type_map = {112, 122}, }, }, }, { @@ -1924,8 +1939,7 @@ }, .expect = { { .payload_type_map = {111, 122}, }, - { .payload_type_map = {55, -EINVAL}, }, - { .end = true }, + { .payload_type_map = {111, 122}, }, }, }, { @@ -1940,8 +1954,7 @@ }, .expect = { { .payload_type_map = {111, 122}, }, - { .payload_type_map = {55, -EINVAL}, }, - { .end = true }, + { .payload_type_map = {111, 122}, }, }, }, { @@ -1957,10 +1970,10 @@ .expect = { /* Note: Both 111, anbd 112 will translate to 122. The translation from 112 */ { .payload_type_map = {112, 122} }, - { .payload_type_map = {55, -EINVAL}, }, - { .end = true }, + { .payload_type_map = {112, 122}, }, }, }, + { .descr = "test AMR with NULL param (bwe <-> null)", .codecs = { @@ -1974,8 +1987,7 @@ .expect = { /* Note: Both 111, anbd 112 will translate to 122. The translation from 112 */ { .payload_type_map = {112, 122} }, - { .payload_type_map = {55, -EINVAL}, }, - { .end = true }, + { .payload_type_map = {112, 122}, }, }, }, { @@ -1993,11 +2005,8 @@ }, }, .expect = { - { .payload_type_map = {112, 96}, }, { .payload_type_map = {0, 0}, }, - { .payload_type_map = {111, 97} }, - { .payload_type_map = {123, -EINVAL} }, - { .end = true }, + { .payload_type_map = {111, 97}, }, }, }, { @@ -2015,11 +2024,8 @@ }, }, .expect = { - { .payload_type_map = {112, 96}, }, { .payload_type_map = {0, 0}, }, - { .payload_type_map = {111, 97} }, - { .payload_type_map = {123, -EINVAL} }, - { .end = true }, + { .payload_type_map = {111, 97}, }, }, }, { @@ -2037,70 +2043,97 @@ }, .expect = { { .payload_type_map = {111, 121}, }, - { .payload_type_map = {112, -EINVAL} }, - { .payload_type_map = {113, -EINVAL} }, - { .end = true }, + { .payload_type_map = {111, 121} }, }, }, }; -static int pt_translate(struct mgcp_conn_rtp *conn, unsigned int index_src, unsigned int index_dst, int payload_type) +static bool codec_decision(struct mgcp_conn_rtp *conn, unsigned int index_conn, unsigned int index_conn_opposite, + const struct testcase_mgcp_codec_decide_expect *expect) { - struct mgcp_rtp_codec *codec_src = NULL; - struct mgcp_rtp_codec *codec_dst = NULL; - struct mgcp_conn_rtp *conn_src = &conn[index_src]; - struct mgcp_conn_rtp *conn_dst = &conn[index_dst]; + bool ok = true; + int payload_type_conn; + int payload_type_conn_opposite; - /* Find the codec information that is used on the source side */ - codec_src = mgcp_codec_from_pt(conn_src, payload_type); - if (!codec_src) { - printf(" - mgcp_codec_from_pt(conn%u, %d) -> NO RESULT\n", index_src, payload_type); - return -EINVAL; - } - printf(" - mgcp_codec_from_pt(conn%u, %d) -> %s\n", index_src, payload_type, codec_src->subtype_name); + printf(" - mgcp_codec_decide(&conn[%u], &conn[%u]):\n", index_conn, index_conn_opposite); + if (mgcp_codec_decide(&conn[index_conn], &conn[index_conn_opposite]) != 0) { + if (expect->payload_type_map[index_conn] == -EINVAL + && expect->payload_type_map[index_conn_opposite] == -EINVAL) + printf(" codec decision failed (expected)!\n"); + else { + printf(" ERROR: codec decision failed!\n"); + ok = false; + } + } else { + printf(" Codec decision result:\n"); + if (conn[index_conn].end.codec) { + payload_type_conn = conn[index_conn].end.codec->payload_type; + printf(" conn[%u]: codec:%s, pt:%d\n", + index_conn, conn[index_conn].end.codec->subtype_name, payload_type_conn); + } else { + payload_type_conn = -EINVAL; + printf(" conn[%u]: codec:none, pt:none\n", index_conn); + } - codec_dst = mgcp_codec_find_convertible(conn_dst, codec_src); - if (!codec_dst) { - printf(" - mgcp_codec_find_convertible(conn%u, %s) -> NO RESULT\n", index_dst, codec_src->subtype_name); - return -EINVAL; + if (conn[index_conn_opposite].end.codec) { + payload_type_conn_opposite = conn[index_conn_opposite].end.codec->payload_type; + printf(" conn[%u]: codec:%s, pt:%d\n", + index_conn_opposite, conn[index_conn_opposite].end.codec->subtype_name, + payload_type_conn_opposite); + } else { + payload_type_conn_opposite = -EINVAL; + printf(" conn[%u]: codec:none, pt:none\n", index_conn_opposite); + } + + if (payload_type_conn != expect->payload_type_map[index_conn]) { + printf(" ERROR: conn[%u] unexpected codec decision, expected pt=%d, got pt=%d\n", + index_conn, expect->payload_type_map[index_conn], payload_type_conn); + ok = false; + } + + if (payload_type_conn_opposite != expect->payload_type_map[index_conn_opposite]) { + printf(" ERROR: conn[%u] unexpected codec decision, expected pt=%d, got pt=%d\n", + index_conn_opposite, expect->payload_type_map[index_conn_opposite], + payload_type_conn_opposite); + ok = false; + } } - printf(" - mgcp_codec_find_convertible(conn%u, %s) -> %s -> %u\n", - index_dst, codec_src->subtype_name, codec_dst->subtype_name, codec_dst->payload_type); - return codec_dst->payload_type; + + return ok; } -static void test_mgcp_codec_find_convertible(void) +static void test_mgcp_codec_decide(void) { int i; bool ok = true; printf("\nTesting mgcp_codec_find_convertible()\n"); for (i = 0; i < ARRAY_SIZE(test_mgcp_codec_find_convertible_cases); i++) { - const struct testcase_mgcp_codec_find_convertible *t = &test_mgcp_codec_find_convertible_cases[i]; - struct mgcp_conn_rtp conn[2] = {}; + const struct testcase_mgcp_codec_decide *t = &test_mgcp_codec_find_convertible_cases[i]; + struct mgcp_conn_rtp conn[2] = { }; int rc; int conn_i; int c; printf("#%d: %s\n", i, t->descr); + /* Build testvector (add codecs to conn, set properties etc... */ for (conn_i = 0; conn_i < 2; conn_i++) { printf(" - add codecs on conn%d:\n", conn_i); for (c = 0; c < ARRAY_SIZE(t->codecs[conn_i]); c++) { - const struct testcase_mgcp_codec_find_convertible_codec *codec = &t->codecs[conn_i][c]; + const struct testcase_mgcp_codec_decide_codec *codec = &t->codecs[conn_i][c]; if (!codec->audio_name) break; - rc = mgcp_codec_add(&conn[conn_i], codec->payload_type, codec->audio_name, codec->param); + rc = mgcp_codec_add(&conn[conn_i], codec->payload_type, codec->audio_name, + codec->param); printf(" %2d: %3d %s%s -> rc=%d\n", c, codec->payload_type, codec->audio_name, codec->param ? - (codec->param->amr_octet_aligned_present? - (codec->param->amr_octet_aligned ? - " octet-aligned=1" : " octet-aligned=0") - : " octet-aligned=unset") - : "", - rc); + (codec->param->amr_octet_aligned_present ? + (codec->param->amr_octet_aligned ? " octet-aligned=1" : " octet-aligned=0") + : " octet-aligned=unset") + : "", rc); if (rc != codec->expect_rc) { printf(" ERROR: expected rc=%d\n", codec->expect_rc); ok = false; @@ -2110,32 +2143,17 @@ printf(" (none)\n"); } - for (c = 0; c < ARRAY_SIZE(t->expect); c++) { - const struct testcase_mgcp_codec_find_convertible_expect *expect = &t->expect[c]; - int result; + /* Run codec decision and check expectation */ + if (!codec_decision(conn, 0, 1, &t->expect[0])) + ok = false; - if (expect->end) - break; + if (!codec_decision(conn, 1, 0, &t->expect[1])) + ok = false; - result = pt_translate(conn, 0, 1, expect->payload_type_map[0]); - if (result != expect->payload_type_map[1]) { - printf(" ERROR: expected -> %d\n", expect->payload_type_map[1]); - ok = false; - } - - /* If the expected result is an error, don't do reverse map test */ - if (expect->payload_type_map[1] < 0) - continue; - - result = pt_translate(conn, 1, 0, expect->payload_type_map[1]); - if (result != expect->payload_type_map[0]) { - printf(" ERROR: expected -> %d\n", expect->payload_type_map[0]); - ok = false; - } - } - - for (conn_i = 0; conn_i < 2; conn_i++) - mgcp_codec_reset_all(&conn[conn_i]); + if (ok) + printf(" ===> SUCCESS: codec decision as expected!\n"); + else + printf(" ===> FAIL: unexpected codec decision!\n"); } OSMO_ASSERT(ok); @@ -2295,7 +2313,7 @@ test_osmux_cid(); test_get_lco_identifier(); test_check_local_cx_options(ctx); - test_mgcp_codec_find_convertible(); + test_mgcp_codec_decide(); test_conn_id_matching(); test_e1_trunk_nr_from_epname(); test_mgcp_is_rtp_dummy_payload(); diff --git a/tests/mgcp/mgcp_test.ok b/tests/mgcp/mgcp_test.ok index 4ea9a34..08df5d4 100644 --- a/tests/mgcp/mgcp_test.ok +++ b/tests/mgcp/mgcp_test.ok Binary files differ -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32218 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I6c3291f825488e5d8ce136aeb18450156794aeb5 Gerrit-Change-Number: 32218 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-msc[master]: msc_main: close SMS db on startup error
by pespin 05 Apr '23

05 Apr '23
Attention is currently required from: osmith, fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/32085 ) Change subject: msc_main: close SMS db on startup error ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/32085 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I9bb799048db5fcdb2a2520107bd75d5f7a865459 Gerrit-Change-Number: 32085 Gerrit-PatchSet: 3 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 05 Apr 2023 10:28:13 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: bsc: add TC_mscpool_sccp_n_pcstate_attaches_msc
by pespin 05 Apr '23

05 Apr '23
Attention is currently required from: neels. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32217 ) Change subject: bsc: add TC_mscpool_sccp_n_pcstate_attaches_msc ...................................................................... Patch Set 1: (2 comments) File bsc/BSC_Tests.ttcn: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32217/comment/825ddc36_763e… PS1, Line 9190: pars1.mscpool.l3_info := valueof(ts_LU_REQ(LU_Type_IMSI_Attach, valueof(ts_MI_IMSI_LV('001010420000001'H)), '00F110'O)); What's changing here? I'm unable to find out :/ https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32217/comment/e8d788f9_1f14… PS1, Line 9211: pars3.mscpool.l3_info := valueof(ts_PAG_RESP(valueof(ts_MI_IMSI_LV('001010420000003'H)))); this should probably be fixed by having ts_PAG_RESP accept a template (value) as a param. -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32217 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ib4a5330df30a73e744c316898817b2fa3271d75e Gerrit-Change-Number: 32217 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Wed, 05 Apr 2023 10:27:34 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • ...
  • 226
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.