osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/31457 )
Change subject: mgcp_client: mgcp_msg_gen: add more error logs ......................................................................
mgcp_client: mgcp_msg_gen: add more error logs
While adding CSD, this failed for me in add_lco without a descriptive log message, so add more error messages.
Related: OS#4393 Change-Id: I4873a2db95525aab3e13046b645dd8f90e951466 --- M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.err 2 files changed, 20 insertions(+), 2 deletions(-)
Approvals: fixeria: Looks good to me, approved msuraev: Looks good to me, but someone else must approve Jenkins Builder: Verified
diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index c3ecc9f..0434e70 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -1392,8 +1392,10 @@ if (!use_sdp && (mgcp_msg->verb == MGCP_VERB_CRCX || mgcp_msg->verb == MGCP_VERB_MDCX)) { - if (add_lco(msg, mgcp_msg) < 0) + if (add_lco(msg, mgcp_msg) < 0) { + LOGPMGW(mgcp, LOGL_ERROR, "Failed to add LCO, can not generate MGCP message\n"); return NULL; + } }
/* Add mode */ @@ -1428,8 +1430,10 @@ if (use_sdp && (mgcp_msg->verb == MGCP_VERB_CRCX || mgcp_msg->verb == MGCP_VERB_MDCX)) { - if (add_sdp(msg, mgcp_msg, mgcp) < 0) + if (add_sdp(msg, mgcp_msg, mgcp) < 0) { + LOGPMGW(mgcp, LOGL_ERROR, "Failed to add SDP, can not generate MGCP message\n"); return NULL; + } }
if (rc != 0) { diff --git a/tests/mgcp_client/mgcp_client_test.err b/tests/mgcp_client/mgcp_client_test.err index 4a73f7f..d666cba 100644 --- a/tests/mgcp_client/mgcp_client_test.err +++ b/tests/mgcp_client/mgcp_client_test.err @@ -1,5 +1,6 @@ DLMGCP MGW(mgw) MGCP client: using endpoint domain '@mgw' DLMGCP MGW(mgw) Message buffer to small, can not generate MGCP message (SDP) +DLMGCP MGW(mgw) Failed to add SDP, can not generate MGCP message
test_mgcp_client_cancel(): DLMGCP MGW(mgw) MGCP client: using endpoint domain '@mgw'