sipwise / rtpengine

The Sipwise media proxy for Kamailio
GNU General Public License v3.0
763 stars 360 forks source link

rtpengine-recording not including the label (%l) in the file name. #1791

Closed epilav closed 4 months ago

epilav commented 5 months ago

Hi,

The setup is OpenSIPS + rtpengine w/ proc recording. We are trying to pass a label from an OpenSIPS script to rtpengine so that we can uniquely identify ingress and egress legs of the same call. We cannot assume that we will always/ever have access to the SSRC in the routing script.

The label is getting included in the NG offer request (as a flag) and delivered to rtpengine, but rtpengine-recording does not include it in the file name (we are using %t-%c-%l as the format string).

I am not sure if this is a bug or an oversight/misunderstanding on our part. Hopefully, it is the latter.

Any help would be greatly appreciated.

epilav commented 5 months ago

The following change fixes the issue. Not sure if there are any unintended consequences.

index 6ed2ee9..ecbe4ae 100644
--- a/daemon/call_interfaces.c
+++ b/daemon/call_interfaces.c
@@ -2112,7 +2112,6 @@ static const char *call_offer_answer_ng(ng_buffer *ngbuf, bencode_item_t *input,
        chopper = sdp_chopper_new(&sdp);
        bencode_buffer_destroy_add(output->buffer, (free_func_t) sdp_chopper_destroy, chopper);

-       update_metadata_monologue(from_ml, &flags);
        detect_setup_recording(call, &flags);

        if (flags.drop_traffic_start) {
@@ -2129,6 +2128,8 @@ static const char *call_offer_answer_ng(ng_buffer *ngbuf, bencode_item_t *input,
        if (!ret)
                save_last_sdp(from_ml, &sdp, &parsed, &streams);

+       update_metadata_monologue(from_ml, &flags);
+
        struct recording *recording = call->recording;
        if (recording != NULL) {
                meta_write_sdp_before(recording, &sdp, from_ml, opmode);