Module: kamailio Branch: master Commit: 664190b31303b52728f957113d97bd77a7ab4f8d URL: https://github.com/kamailio/kamailio/commit/664190b31303b52728f957113d97bd77a7ab4f8d
Author: Daniel-Constantin Mierla <mico...@gmail.com> Committer: Daniel-Constantin Mierla <mico...@gmail.com> Date: 2024-04-05T10:55:09+02:00 rtpengine: added param write_sdp_pv_mode - if set to 1, write the returned sdp in pv and set the body - default 0, write only in pv (existing behaviour so far) --- Modified: src/modules/rtpengine/rtpengine.c --- Diff: https://github.com/kamailio/kamailio/commit/664190b31303b52728f957113d97bd77a7ab4f8d.diff Patch: https://github.com/kamailio/kamailio/commit/664190b31303b52728f957113d97bd77a7ab4f8d.patch --- diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c index 8a2f9f82d89..c51b4742081 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -322,6 +322,7 @@ static int_str setid_avp; static str write_sdp_pvar_str = {NULL, 0}; static pv_spec_t *write_sdp_pvar = NULL; +static int write_sdp_pvar_mode = 0; static str read_sdp_pvar_str = {NULL, 0}; static pv_spec_t *read_sdp_pvar = NULL; @@ -504,6 +505,7 @@ static param_export_t params[] = { {"force_send_interface", PARAM_STRING, &force_send_ip_str}, {"rtp_inst_pvar", PARAM_STR, &rtp_inst_pv_param}, {"write_sdp_pv", PARAM_STR, &write_sdp_pvar_str}, + {"write_sdp_pv_mode", PARAM_INT, &write_sdp_pvar_mode}, {"read_sdp_pv", PARAM_STR, &read_sdp_pvar_str}, {"hash_table_tout", INT_PARAM, &hash_table_tout}, {"hash_table_size", INT_PARAM, &hash_table_size}, @@ -4708,9 +4710,11 @@ static int rtpengine_offer_answer( goto error_free; } - pkg_free(newbody.s); - - } else { + if(write_sdp_pvar_mode == 0) { + pkg_free(newbody.s); + } + } + if(write_sdp_pvar == NULL || write_sdp_pvar_mode != 0) { if(cl_field.len) { anchor = del_lump(msg, cl_field.s - msg->buf, cl_field.len, 0); cl_repl.s = pkg_malloc(10); _______________________________________________ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org