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

March 2023

  • 1 participants
  • 3642 discussions
[S] Change in osmo-bsc[master]: abis_rsl: Document spec ref of CCCH Load Ind
by laforge 30 Mar '23

30 Mar '23
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/32158 ) Change subject: abis_rsl: Document spec ref of CCCH Load Ind ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/32158 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Iada13bb29688249eecbd492388a6d4b0cc95575d Gerrit-Change-Number: 32158 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 30 Mar 2023 17:05:55 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-mgw[master]: mgcp_client: simpler error handling
by pespin 30 Mar '23

30 Mar '23
Attention is currently required from: neels. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32162 ) Change subject: mgcp_client: simpler error handling ...................................................................... Patch Set 1: (2 comments) Commit Message: https://gerrit.osmocom.org/c/osmo-mgw/+/32162/comment/ab62eb62_fb2f6ec8 PS1, Line 12: the msgb_free() to the caler. caller Patchset: PS1: +1 once you fix the linter -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32162 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I904d56f56053952c2ebbbe5dca744fafa32b333e Gerrit-Change-Number: 32162 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Thu, 30 Mar 2023 16:39:32 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-mgw[master]: mgcp_find_section_end(): skip spaces at start of SDP
by pespin 30 Mar '23

30 Mar '23
Attention is currently required from: neels. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32161 ) Change subject: mgcp_find_section_end(): skip spaces at start of SDP ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32161 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I015e0347a268b61c0ca45d40754942f87b461c09 Gerrit-Change-Number: 32161 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Thu, 30 Mar 2023 16:38:00 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-bsc[master]: wip: how osmo-bsc might use SDP strings directly
by neels 30 Mar '23

30 Mar '23
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/32164 ) Change subject: wip: how osmo-bsc might use SDP strings directly ...................................................................... wip: how osmo-bsc might use SDP strings directly Change-Id: Ie91de7e913235b04e84e81b6ce940364d92162d6 --- M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/lchan_rtp_fsm.c 2 files changed, 41 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/64/32164/1 diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index de9d4d2..b8bf15a 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -776,6 +776,22 @@ }; mgcp_pick_codec(&mgw_info, for_lchan, false); + /* TODO: add full SDP to the MGCP command + struct sdp_msg sdp = { + .ptime = 20, + }; + + { + enum mgcp_codecs codec = chan_mode_to_mgcp_codec(lchan->activate.ch_mode_rate.chan_mode, + lchan->type == GSM_LCHAN_TCH_H? false : true); + struct codec_mapping *m = codec_mapping_by_mgcp_codec(codec); + if (m) + sdp_audio_codecs_add_copy(dst, &m->sdp); + } + + sdp_msg_to_sdp_str_buf(mgw_info->sdp, sizeof(mgw_info->sdp), &sdp); + */ + rc = osmo_strlcpy(mgw_info.addr, addr, sizeof(mgw_info.addr)); if (rc <= 0 || rc >= sizeof(mgw_info.addr)) { LOGPFSML(conn->fi, LOGL_ERROR, "Failed to compose MGW endpoint address for MGW -> MSC\n"); diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c index 7e9c31f..11006fa 100644 --- a/src/osmo-bsc/lchan_rtp_fsm.c +++ b/src/osmo-bsc/lchan_rtp_fsm.c @@ -912,6 +912,22 @@ } } +/* TODO: implement this +int lchan_add_codecs_to_sdp(struct sdp_audio_codecs *dst, const struct gsm_lchan *lchan) +{ + enum mgcp_codecs codec = chan_mode_to_mgcp_codec(lchan->activate.ch_mode_rate.chan_mode, + lchan->type == GSM_LCHAN_TCH_H? false : true); + + TODO codec_mapping so far only exists in osmo-msc.git + struct codec_mapping *m = codec_mapping_by_mgcp_codec(codec); + if (!m) + return 0; + + sdp_audio_codecs_add_copy(dst, &m->sdp); + return 0; +} +*/ + void mgcp_pick_codec(struct mgcp_conn_peer *verb_info, const struct gsm_lchan *lchan, bool bss_side) { enum mgcp_codecs codec = chan_mode_to_mgcp_codec(lchan->activate.ch_mode_rate.chan_mode, -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/32164 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ie91de7e913235b04e84e81b6ce940364d92162d6 Gerrit-Change-Number: 32164 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-mgw[master]: mgcp_client: simpler error handling
by Jenkins Builder 30 Mar '23

30 Mar '23
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32162 ) Change subject: mgcp_client: simpler error handling ...................................................................... Patch Set 1: (1 comment) File src/libosmo-mgcp-client/mgcp_client.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5620): https://gerrit.osmocom.org/c/osmo-mgw/+/32162/comment/5f7e0fdd_ab31ff2d PS1, Line 1134: #define MSGB_PRINTF_OR_RET(msg, FMT, ARGS...) \ Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32162 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I904d56f56053952c2ebbbe5dca744fafa32b333e Gerrit-Change-Number: 32162 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Thu, 30 Mar 2023 16:30:07 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-mgw[master]: mgcp_find_section_end(): skip spaces at start of SDP
by neels 30 Mar '23

30 Mar '23
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32161 ) Change subject: mgcp_find_section_end(): skip spaces at start of SDP ...................................................................... mgcp_find_section_end(): skip spaces at start of SDP Change-Id: I015e0347a268b61c0ca45d40754942f87b461c09 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 12 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/61/32161/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 4dd278f..670910b 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -456,15 +456,15 @@ rc = strstr(string, "\n\n"); if (rc) - return rc; + return rc + 2; rc = strstr(string, "\n\r\n\r"); if (rc) - return rc; + return rc + 4; rc = strstr(string, "\r\n\r\n"); if (rc) - return rc; + return rc + 4; return NULL; } -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32161 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I015e0347a268b61c0ca45d40754942f87b461c09 Gerrit-Change-Number: 32161 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-mgw[master]: client: allow passing and receiving full SDP to/from MGW
by neels 30 Mar '23

30 Mar '23
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32163 ) Change subject: client: allow passing and receiving full SDP to/from MGW ...................................................................... client: allow passing and receiving full SDP to/from MGW Clients can continue to use the current way of providing the information contained in the SDP part. A client may also decide to directly provide an SDP string. That may be useful to send a list of payload types with mixed fmtp (e.g. two entries, one for AMR OA and one for AMR BE) or any other custom SDP that is not possible to be represented with the previous structure of struct mgcp_conn_peer: struct sdp_msg sdp = {}; sdp_audio_codecs_add(&sdp.audio_codecs, 96, "AMR", 8000, "octet-align=1"); sdp_audio_codecs_add(&sdp.audio_codecs, 97, "AMR", 8000, "octet-align=0"); struct mgcp_conn_peer verb_info = { ... }; sdp_msg_to_sdp_str_buf(verb_info.sdp, sizeof(verb_info.sdp), &sdp); osmo_mgcpc_ep_ci_request(my_ci, MGCP_VERB_MDCX, &verb_info,...); (TODO: sdp_msg, sdp_audio_codecs_add() and sdp_msg_to_sdp_str_buf() so far only exists in osmo-msc.git) If no SDP is present in the passed verb_info, the SDP part is composed as before from the mgcp_conn_peer members addr, port, ptime, ptmap, param. If an SDP string is present in the passed verb_info, ignore the data in the individual members, and directly pass the given SDP string instead -- the caller does not need to pass both the individual members and SDP, either one suffices. A client can read the full SDP response from the MGW, again for example to accurately parse a list with mixed fmtp for AMR like above, like this: /* Handling successful event after osmo_mgcpc_ep_ci_request(my_fi, my_notify_event): */ const struct mgcp_conn_peer *response_info = osmo_mgcpc_ep_ci_get_rtp_info(ci); struct sdp_msg sdp; sdp_msg_from_sdp_str(&sdp, response_info->sdp); for (int i = 0; i < sdp.audio_codecs.count; i++) printf("PT %u = %s %s", sdp.audio_codecs.codec[i].payload_type, sdp.audio_codecs.codec[i].subtype_name, sdp.audio_codecs.codec[i].fmtp); Related: OS#5723 Change-Id: Ib26b4d24546a9a9af65d4313fdf87cdeff9cbc22 --- M include/osmocom/mgcp_client/mgcp_client.h M include/osmocom/mgcp_client/mgcp_client_fsm.h M src/libosmo-mgcp-client/mgcp_client.c M src/libosmo-mgcp-client/mgcp_client_fsm.c 4 files changed, 83 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/63/32163/1 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 0fb5dee..c185971 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -83,6 +83,7 @@ }; struct mgcp_response { + /* The complete MGCP + SDP response. See also 'sdp' below. */ char *body; struct mgcp_response_head head; uint16_t audio_port; @@ -92,6 +93,8 @@ unsigned int codecs_len; struct ptmap ptmap[MGCP_MAX_CODECS]; unsigned int ptmap_len; + /* Start of the SDP part of 'body'. */ + char *sdp; }; enum mgcp_verb { @@ -131,6 +134,8 @@ int x_osmo_osmux_cid; /* -1 is wildcard */ bool param_present; struct mgcp_codec_param param; + + char sdp[1024]; }; void mgcp_client_conf_init(struct mgcp_client_conf *conf); diff --git a/include/osmocom/mgcp_client/mgcp_client_fsm.h b/include/osmocom/mgcp_client/mgcp_client_fsm.h index ade4f49..de68e70 100644 --- a/include/osmocom/mgcp_client/mgcp_client_fsm.h +++ b/include/osmocom/mgcp_client/mgcp_client_fsm.h @@ -61,6 +61,8 @@ * mgcp_common.h */ bool param_present; struct mgcp_codec_param param; + + char sdp[1024]; }; struct osmo_fsm_inst *mgcp_conn_create(struct mgcp_client *mgcp, struct osmo_fsm_inst *parent_fi, uint32_t parent_term_evt, diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index fb4c17a..85421a2 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -493,6 +493,7 @@ rc = 0; goto exit; } + r->sdp = data_ptr; /* data_ptr now points to the beginning of the section-end-marker; for_each_non_empty_line() * skips any \r and \n characters for free, so we don't need to skip the marker. */ @@ -1183,6 +1184,13 @@ /* Add separator to mark the beginning of the SDP block */ MSGB_PRINTF_OR_RET(msg, "\r\n"); + if (mgcp_msg->sdp[0] != '\0') { + /* The caller provided a full SDP string, no need to compose SDP. */ + MSGB_PRINTF_OR_RET(msg, "%s", mgcp_msg->sdp); + return 0; + } + /* The caller did not provide a full SDP section, compose SDP string from the mgcp_msg members. */ + /* Add SDP protocol version */ MSGB_PRINTF_OR_RET(msg, "v=0\r\n"); @@ -1365,8 +1373,9 @@ /* Using SDP makes sense when a valid IP/Port combination is specifiec, * if we do not know this information yet, we fall back to LCO */ - if (mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_IP - && mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_PORT) + if (((mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_IP) + && (mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_PORT)) + || mgcp_msg->sdp[0] != '\0') use_sdp = true; /* Add local connection options (LCO) */ diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c index 660f0ad..4a33df5 100644 --- a/src/libosmo-mgcp-client/mgcp_client_fsm.c +++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c @@ -140,6 +140,9 @@ mgcp_msg->audio_ip = info->addr; mgcp_msg->audio_port = info->port; mgcp_msg->conn_mode = MGCP_CONN_RECV_SEND; + + if (info->sdp[0] != '\0') + OSMO_STRLCPY_ARRAY(mgcp_msg->sdp, info->sdp); } static void set_conn_mode(struct mgcp_msg *mgcp_msg, struct mgcp_conn_peer *peer) @@ -179,6 +182,9 @@ mgcp_msg.presence |= MGCP_MSG_PRESENCE_X_OSMO_OSMUX_CID; } + if (mgcp_ctx->conn_peer_local.sdp[0] != '\0') + OSMO_STRLCPY_ARRAY(mgcp_msg.sdp, mgcp_ctx->conn_peer_local.sdp); + /* Note: We take the endpoint and the call_id from the remote * connection info, because we can be confident that the * information there is valid. For the local info, we explicitly @@ -319,6 +325,9 @@ return; } + if (r->sdp && r->sdp[0] != '\0') + OSMO_STRLCPY_ARRAY(mgcp_ctx->conn_peer_remote.sdp, r->sdp); + mgcp_ctx->conn_peer_remote.call_id = mgcp_ctx->conn_peer_local.call_id; osmo_fsm_inst_dispatch(fi, EV_CRCX_RESP, mgcp_ctx); @@ -426,6 +435,9 @@ osmo_strlcpy(mgcp_ctx->conn_peer_remote.addr, r->audio_ip, sizeof(mgcp_ctx->conn_peer_remote.addr)); mgcp_ctx->conn_peer_remote.port = r->audio_port; + if (r->sdp && r->sdp[0] != '\0') + OSMO_STRLCPY_ARRAY(mgcp_ctx->conn_peer_remote.sdp, r->sdp); + osmo_fsm_inst_dispatch(fi, EV_MDCX_RESP, mgcp_ctx); } -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32163 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ib26b4d24546a9a9af65d4313fdf87cdeff9cbc22 Gerrit-Change-Number: 32163 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-mgw[master]: mgcp_client: simpler error handling
by neels 30 Mar '23

30 Mar '23
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32162 ) Change subject: mgcp_client: simpler error handling ...................................................................... mgcp_client: simpler error handling add_sdp(), add_lco(): - do not msgb_free() within these functions. Just return error, and move the msgb_free() to the caler. - when failing to write to the msgb, directly return error. Change-Id: I904d56f56053952c2ebbbe5dca744fafa32b333e --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 56 insertions(+), 54 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/62/32162/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 670910b..fb4c17a 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -1131,47 +1131,43 @@ #define MGCP_AUEP_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) #define MGCP_RSIP_MANDATORY 0 /* none */ +#define MSGB_PRINTF_OR_RET(msg, FMT, ARGS...) \ + if (msgb_printf(msg, FMT, ##ARGS) != 0) { \ + LOGP(DLMGCP, LOGL_ERROR, "Message buffer to small, can not generate MGCP/SDP message\n"); \ + return -ENOBUFS; \ + } + /* Helper function for mgcp_msg_gen(): Add LCO information to MGCP message */ static int add_lco(struct msgb *msg, struct mgcp_msg *mgcp_msg) { unsigned int i; - int rc = 0; const char *codec; unsigned int pt; - rc |= msgb_printf(msg, "L:"); + MSGB_PRINTF_OR_RET(msg, "L:"); if (mgcp_msg->ptime) - rc |= msgb_printf(msg, " p:%u,", mgcp_msg->ptime); + MSGB_PRINTF_OR_RET(msg, " p:%u,", mgcp_msg->ptime); if (mgcp_msg->codecs_len) { - rc |= msgb_printf(msg, " a:"); + MSGB_PRINTF_OR_RET(msg, " a:"); for (i = 0; i < mgcp_msg->codecs_len; i++) { pt = mgcp_msg->codecs[i]; codec = get_value_string_or_null(osmo_mgcpc_codec_names, pt); /* Note: Use codec descriptors from enum mgcp_codecs * in mgcp_client only! */ - if (!codec) { - msgb_free(msg); + if (!codec) return -EINVAL; - } - rc |= msgb_printf(msg, "%s", extract_codec_name(codec)); + MSGB_PRINTF_OR_RET(msg, "%s", extract_codec_name(codec)); if (i < mgcp_msg->codecs_len - 1) - rc |= msgb_printf(msg, ";"); + MSGB_PRINTF_OR_RET(msg, ";"); } - rc |= msgb_printf(msg, ","); + MSGB_PRINTF_OR_RET(msg, ","); } - rc |= msgb_printf(msg, " nt:IN\r\n"); - - if (rc != 0) { - LOGP(DLMGCP, LOGL_ERROR, - "message buffer to small, can not generate MGCP message (LCO)\n"); - msgb_free(msg); - return -ENOBUFS; - } + MSGB_PRINTF_OR_RET(msg, " nt:IN\r\n"); return 0; } @@ -1179,43 +1175,37 @@ static int add_sdp(struct msgb *msg, struct mgcp_msg *mgcp_msg, struct mgcp_client *mgcp) { unsigned int i; - int rc = 0; char local_ip[INET6_ADDRSTRLEN]; int local_ip_family, audio_ip_family; const char *codec; unsigned int pt; /* Add separator to mark the beginning of the SDP block */ - rc |= msgb_printf(msg, "\r\n"); + MSGB_PRINTF_OR_RET(msg, "\r\n"); /* Add SDP protocol version */ - rc |= msgb_printf(msg, "v=0\r\n"); + MSGB_PRINTF_OR_RET(msg, "v=0\r\n"); /* Determine local IP-Address */ if (osmo_sock_local_ip(local_ip, mgcp->actual.remote_addr) < 0) { LOGPMGW(mgcp, LOGL_ERROR, "Could not determine local IP-Address!\n"); - msgb_free(msg); return -EINVAL; } local_ip_family = osmo_ip_str_type(local_ip); - if (local_ip_family == AF_UNSPEC) { - msgb_free(msg); + if (local_ip_family == AF_UNSPEC) return -EINVAL; - } audio_ip_family = osmo_ip_str_type(mgcp_msg->audio_ip); - if (audio_ip_family == AF_UNSPEC) { - msgb_free(msg); + if (audio_ip_family == AF_UNSPEC) return -EINVAL; - } /* Add owner/creator (SDP) */ - rc |= msgb_printf(msg, "o=- %x 23 IN IP%c %s\r\n", mgcp_msg->call_id, + MSGB_PRINTF_OR_RET(msg, "o=- %x 23 IN IP%c %s\r\n", mgcp_msg->call_id, local_ip_family == AF_INET6 ? '6' : '4', local_ip); /* Add session name (none) */ - rc |= msgb_printf(msg, "s=-\r\n"); + MSGB_PRINTF_OR_RET(msg, "s=-\r\n"); /* Add RTP address and port */ if (mgcp_msg->audio_port == 0) { @@ -1230,20 +1220,20 @@ msgb_free(msg); return -EINVAL; } - rc |= msgb_printf(msg, "c=IN IP%c %s\r\n", + MSGB_PRINTF_OR_RET(msg, "c=IN IP%c %s\r\n", audio_ip_family == AF_INET6 ? '6' : '4', mgcp_msg->audio_ip); /* Add time description, active time (SDP) */ - rc |= msgb_printf(msg, "t=0 0\r\n"); + MSGB_PRINTF_OR_RET(msg, "t=0 0\r\n"); - rc |= msgb_printf(msg, "m=audio %u RTP/AVP", mgcp_msg->audio_port); + MSGB_PRINTF_OR_RET(msg, "m=audio %u RTP/AVP", mgcp_msg->audio_port); for (i = 0; i < mgcp_msg->codecs_len; i++) { pt = map_codec_to_pt(mgcp_msg->ptmap, mgcp_msg->ptmap_len, mgcp_msg->codecs[i]); - rc |= msgb_printf(msg, " %u", pt); + MSGB_PRINTF_OR_RET(msg, " %u", pt); } - rc |= msgb_printf(msg, "\r\n"); + MSGB_PRINTF_OR_RET(msg, "\r\n"); /* Add optional codec parameters (fmtp) */ if (mgcp_msg->param_present) { @@ -1253,9 +1243,9 @@ continue; pt = map_codec_to_pt(mgcp_msg->ptmap, mgcp_msg->ptmap_len, mgcp_msg->codecs[i]); if (mgcp_msg->param.amr_octet_aligned_present && mgcp_msg->param.amr_octet_aligned) - rc |= msgb_printf(msg, "a=fmtp:%u octet-align=1\r\n", pt); + MSGB_PRINTF_OR_RET(msg, "a=fmtp:%u octet-align=1\r\n", pt); else if (mgcp_msg->param.amr_octet_aligned_present && !mgcp_msg->param.amr_octet_aligned) - rc |= msgb_printf(msg, "a=fmtp:%u octet-align=0\r\n", pt); + MSGB_PRINTF_OR_RET(msg, "a=fmtp:%u octet-align=0\r\n", pt); } } @@ -1275,18 +1265,12 @@ return -EINVAL; } - rc |= msgb_printf(msg, "a=rtpmap:%u %s\r\n", pt, codec); + MSGB_PRINTF_OR_RET(msg, "a=rtpmap:%u %s\r\n", pt, codec); } } if (mgcp_msg->ptime) - rc |= msgb_printf(msg, "a=ptime:%u\r\n", mgcp_msg->ptime); - - if (rc != 0) { - LOGPMGW(mgcp, LOGL_ERROR, "Message buffer to small, can not generate MGCP message (SDP)\n"); - msgb_free(msg); - return -ENOBUFS; - } + MSGB_PRINTF_OR_RET(msg, "a=ptime:%u\r\n", mgcp_msg->ptime); return 0; } @@ -1311,23 +1295,23 @@ switch (mgcp_msg->verb) { case MGCP_VERB_CRCX: mandatory_mask = MGCP_CRCX_MANDATORY; - rc |= msgb_printf(msg, "CRCX %u", trans_id); + MSGB_PRINTF_OR_RET(msg, "CRCX %u", trans_id); break; case MGCP_VERB_MDCX: mandatory_mask = MGCP_MDCX_MANDATORY; - rc |= msgb_printf(msg, "MDCX %u", trans_id); + MSGB_PRINTF_OR_RET(msg, "MDCX %u", trans_id); break; case MGCP_VERB_DLCX: mandatory_mask = MGCP_DLCX_MANDATORY; - rc |= msgb_printf(msg, "DLCX %u", trans_id); + MSGB_PRINTF_OR_RET(msg, "DLCX %u", trans_id); break; case MGCP_VERB_AUEP: mandatory_mask = MGCP_AUEP_MANDATORY; - rc |= msgb_printf(msg, "AUEP %u", trans_id); + MSGB_PRINTF_OR_RET(msg, "AUEP %u", trans_id); break; case MGCP_VERB_RSIP: mandatory_mask = MGCP_RSIP_MANDATORY; - rc |= msgb_printf(msg, "RSIP %u", trans_id); + MSGB_PRINTF_OR_RET(msg, "RSIP %u", trans_id); break; default: LOGPMGW(mgcp, LOGL_ERROR, "Invalid command verb, can not generate MGCP message\n"); @@ -1359,15 +1343,15 @@ return NULL; } - rc |= msgb_printf(msg, " %s", mgcp_msg->endpoint); + MSGB_PRINTF_OR_RET(msg, " %s", mgcp_msg->endpoint); } /* Add protocol version */ - rc |= msgb_printf(msg, " MGCP 1.0\r\n"); + MSGB_PRINTF_OR_RET(msg, " MGCP 1.0\r\n"); /* Add call id */ if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CALL_ID) - rc |= msgb_printf(msg, "C: %x\r\n", mgcp_msg->call_id); + MSGB_PRINTF_OR_RET(msg, "C: %x\r\n", mgcp_msg->call_id); /* Add connection id */ if (mgcp_msg->presence & MGCP_MSG_PRESENCE_CONN_ID) { @@ -1376,7 +1360,7 @@ msgb_free(msg); return NULL; } - rc |= msgb_printf(msg, "I: %s\r\n", mgcp_msg->conn_id); + MSGB_PRINTF_OR_RET(msg, "I: %s\r\n", mgcp_msg->conn_id); } /* Using SDP makes sense when a valid IP/Port combination is specifiec, @@ -1391,6 +1375,7 @@ || mgcp_msg->verb == MGCP_VERB_MDCX)) { if (add_lco(msg, mgcp_msg) < 0) { LOGPMGW(mgcp, LOGL_ERROR, "Failed to add LCO, can not generate MGCP message\n"); + msgb_free(msg); return NULL; } } @@ -1429,6 +1414,7 @@ || mgcp_msg->verb == MGCP_VERB_MDCX)) { if (add_sdp(msg, mgcp_msg, mgcp) < 0) { LOGPMGW(mgcp, LOGL_ERROR, "Failed to add SDP, can not generate MGCP message\n"); + msgb_free(msg); return NULL; } } -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32162 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I904d56f56053952c2ebbbe5dca744fafa32b333e Gerrit-Change-Number: 32162 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-bsc[master]: bts-rbs2k: Simplify osmo_fsm_inst_alloc_child_id()
by pespin 30 Mar '23

30 Mar '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/32160 ) Change subject: bts-rbs2k: Simplify osmo_fsm_inst_alloc_child_id() ...................................................................... bts-rbs2k: Simplify osmo_fsm_inst_alloc_child_id() Change-Id: I5344161e5a65ae9959684f0fda7f8b06cbb447f3 --- M src/osmo-bsc/abis_om2000.c 1 file changed, 13 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/60/32160/1 diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c index 2a653bf..69a86b5 100644 --- a/src/osmo-bsc/abis_om2000.c +++ b/src/osmo-bsc/abis_om2000.c @@ -68,20 +68,11 @@ { struct osmo_fsm_inst *fi; - fi = osmo_fsm_inst_alloc(fsm, parent, NULL, parent->log_level, - id ? id : parent->id); - if (!fi) { - /* indicate immediate termination to caller */ - osmo_fsm_inst_dispatch(parent, parent_term_event, NULL); + fi = osmo_fsm_inst_alloc_child(fsm, parent, parent_term_event); + if (!fi) return NULL; - } - - LOGPFSM(fi, "is child of %s\n", osmo_fsm_inst_name(parent)); - - fi->proc.parent = parent; - fi->proc.parent_term_event = parent_term_event; - llist_add(&fi->proc.child, &parent->proc.children); - + if (id) + osmo_fsm_inst_update_id_f_sanitize(fi, '-', id); return fi; } -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/32160 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I5344161e5a65ae9959684f0fda7f8b06cbb447f3 Gerrit-Change-Number: 32160 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-bsc[master]: Move paging queue specific handling to signal callback outside RSL code
by pespin 30 Mar '23

30 Mar '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/32159 ) Change subject: Move paging queue specific handling to signal callback outside RSL code ...................................................................... Move paging queue specific handling to signal callback outside RSL code The signal is already there but not being used. Let's further split generic paging code from RSL specificites. Change-Id: Iabc1c29908a5136501d6dc6e60f8777dab511b86 --- M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/paging.c 2 files changed, 29 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/59/32159/1 diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 6a9712e..dfe7da9 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -2311,10 +2311,9 @@ switch (rslh->data[0]) { case RSL_IE_PAGING_LOAD: sd.pg_buf_space = rslh->data[1] << 8 | rslh->data[2]; - if (is_ipaccess_bts(sign_link->trx->bts) && sd.pg_buf_space == UINT16_MAX) { + if (is_ipaccess_bts(sd.bts) && sd.pg_buf_space == UINT16_MAX) { sd.pg_buf_space = paging_estimate_available_slots(sd.bts, sd.bts->ccch_load_ind_period); } - paging_update_buffer_space(sign_link->trx->bts, sd.pg_buf_space); osmo_signal_dispatch(SS_CCCH, S_CCCH_PAGING_LOAD, &sd); break; case RSL_IE_RACH_LOAD: diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index e6f6fe4..6fc053f 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -841,8 +841,24 @@ return 0; } +/* Callback function to be called every time we receive a signal from CCCH */ +static int ccch_sig_cb(unsigned int subsys, unsigned int signal, + void *handler_data, void *signal_data) +{ + struct ccch_signal_data *sd; + + if (signal != S_CCCH_PAGING_LOAD) + return 0; + + sd = signal_data; + + paging_update_buffer_space(sd->bts, sd->pg_buf_space); + return 0; +} + /* To be called once at startup of the process: */ void paging_global_init(void) { osmo_signal_register_handler(SS_NM, nm_sig_cb, NULL); + osmo_signal_register_handler(SS_CCCH, ccch_sig_cb, NULL); } -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/32159 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Iabc1c29908a5136501d6dc6e60f8777dab511b86 Gerrit-Change-Number: 32159 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • ...
  • 365
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.