MT#55283 fix SDP-write-after regression

closes #1871

Change-Id: Iad11f9edef21e78d927519d6edb1012053dd960c
pull/1876/head
Richard Fuchs 1 year ago
parent 0a36e65398
commit a631e54e7e

@ -2254,8 +2254,17 @@ static const char *call_offer_answer_ng(ng_command_ctx_t *ctx, enum call_opmode
if (flags.block_dtmf)
call_set_dtmf_block(call, monologues[0], &flags);
struct recording *recording = NULL;
/* offer/answer model processing */
if ((ret = monologue_offer_answer(monologues, &streams, &flags)) == 0) {
update_metadata_monologue(from_ml, &flags);
detect_setup_recording(call, &flags);
recording = call->recording;
meta_write_sdp_before(recording, &sdp, from_ml, opmode);
/* if all fine, prepare an outer sdp and save it */
if ((ret = sdp_create(&sdp_out, to_ml, &flags)) == 0) {
/* TODO: should we save sdp_out? */
@ -2266,20 +2275,14 @@ static const char *call_offer_answer_ng(ng_command_ctx_t *ctx, enum call_opmode
if (sdp_out.len) {
ctx->ngbuf->sdp_out = sdp_out.s;
ctx->parser_ctx.parser->dict_add_str(output, "sdp", &sdp_out);
meta_write_sdp_after(recording, &sdp_out, from_ml, opmode);
sdp_out = STR_NULL; /* ownership passed to output */
}
}
update_metadata_monologue(from_ml, &flags);
detect_setup_recording(call, &flags);
struct recording *recording = call->recording;
if (recording != NULL) {
meta_write_sdp_before(recording, &sdp, from_ml, opmode);
meta_write_sdp_after(recording, &sdp_out, from_ml, opmode);
recording_response(recording, ctx->parser_ctx.parser, output);
}
recording_response(recording, ctx->parser_ctx.parser, output);
dequeue_sdp_fragments(from_ml);

@ -529,6 +529,9 @@ static char *meta_setup_file(struct recording *recording, const str *meta_prefix
static void sdp_after_pcap(struct recording *recording, const str *s, struct call_monologue *ml,
enum call_opmode opmode)
{
if (!recording)
return;
FILE *meta_fp = recording->pcap.meta_fp;
if (!meta_fp)
return;
@ -751,6 +754,8 @@ static void finish_pcap(call_t *call, bool discard) {
}
static void response_pcap(struct recording *recording, const ng_parser_t *parser, parser_arg output) {
if (!recording)
return;
if (!recording->pcap.recording_path)
return;
@ -875,6 +880,9 @@ static void proc_init(call_t *call) {
static void sdp_before_proc(struct recording *recording, const str *sdp, struct call_monologue *ml,
enum call_opmode opmode)
{
if (!recording)
return;
append_meta_chunk_str(recording, sdp,
"SDP from %u before %s", ml->unique_id, get_opmode_text(opmode));
}
@ -882,6 +890,9 @@ static void sdp_before_proc(struct recording *recording, const str *sdp, struct
static void sdp_after_proc(struct recording *recording, const str *sdp, struct call_monologue *ml,
enum call_opmode opmode)
{
if (!recording)
return;
append_meta_chunk_str(recording, sdp,
"SDP from %u after %s", ml->unique_id, get_opmode_text(opmode));
}

Loading…
Cancel
Save