Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

recording-media-slot handling: three defects when recording a call with explicit media slots (mix-method channels) - with patches

Aperta
#2,208 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c

Direzione di ricerca

The three defects sit in daemon/call.c (media_rec_slot assignment for OP_OFFER), daemon/recording.c (the metafile slot logic) and recording-daemon/mix.c (in_pts for a re-used mix input). Start by checking the proposed diffs against those spots and confirm the sender and receiver slots are swapped in call.c. Done means that with mix-method=channels, the caller lands on channel 1, the callee on channel 2, and a mid-call SSRC change adds no delay, verified with test tones as the reporter did.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Version: mr26.2.1.2 (same code on master)

Setup

Call recorded with output-mixed, mix-method=channels, mix-num-inputs=2, OpenSIPS passing recording-media-slot-offer=1 recording-media-slot-answer=2 recording-media-slots=2, plus a subscribe request (SIPREC copy) on the same call. Expected: caller on channel 1, callee on channel 2, in the right time position.

Observed and fixed (patches below, all verified with 440/880 Hz test tones, 5/5 calls each; the unpatched code fails all three):

1. daemon/call.c: both sides get the answer slot

 		if (flags->opmode == OP_OFFER) {
 			ilog(LOG_DEBUG, "Setting media recording slots to %u", flags->media_rec_slot_offer);
-			sender_media->media_rec_slot = receiver_media->media_rec_slot = flags->media_rec_slot_answer;
+			sender_media->media_rec_slot = flags->media_rec_slot_offer;
+			receiver_media->media_rec_slot = flags->media_rec_slot_answer;
 		}

Result without the fix: both parties are mixed into the same channel.

2. daemon/recording.c: a media without a slot (the subscription/SIPREC copy) resets the global slot count to 1 in the metafile

-	if(call->media_rec_slots < 1 || media->media_rec_slot < 1) {
+	if(call->media_rec_slots < 1) {
 		media_rec_slot = 1;
 		media_rec_slots = 1;
 	} else {
-		media_rec_slot = media->media_rec_slot;
+		media_rec_slot = media->media_rec_slot < 1 ? 1 : media->media_rec_slot;
 		media_rec_slots = call->media_rec_slots;
 	}

Result without the fix: as soon as a subscriber media (no slot) is written to the metafile, the recording daemon reads MEDIA_REC_SLOTS=1 and the mixer falls back to one channel.

3. recording-daemon/mix.c: a re-used mix input starts at pts 0, so audio after an SSRC change is shifted

 	ilog(LOG_DEBUG, "requested slot is %u, Re-using mix input index #%u", stream_channel_slot, next);
 	mix_input_reset(mix, next);
+	/* the recycled input already contributed up to the current output position:
+	 * continue from there instead of padding silence from 0, which delays all later audio */
+	mix->in_pts[next] = mix->out_pts;
 	mix->input_ref[next] = ptr;
 	mix->next_idx[stream_channel_slot] = next;

Result without the fix: when the caller changes SSRC mid-call (re-INVITE / media server switch), the audio after the switch is delayed in the mixed output by the time already elapsed.

Happy to open these as a PR if you prefer.

Lingua principale
Perl
Stelle
992
Fork
459
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sipwise/rtpengine

Tutte le issue di sipwise/rtpengine

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.