Skip to content

Commit fba5d4d

Browse files
committed
siprec: handle SRS in-dialog UPDATE and re-INVITEs
(cherry picked from commit ec6b5c4)
1 parent 11d0ee6 commit fba5d4d

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

modules/siprec/siprec_logic.c

+18-10
Original file line numberDiff line numberDiff line change
@@ -232,18 +232,26 @@ static int srec_b2b_req(struct sip_msg *msg, struct src_sess *ss)
232232
str body = str_init("");
233233
int code = 405;
234234

235-
#if 0
236-
/* handle disabled streams from SIPREC */
237-
if (msg->REQ_METHOD != METHOD_INVITE)
238-
return -1;
239-
/* this is a re-invite - parse the SDP to see if any of them was disabled */
240-
241-
if (get_body(msg, &body) != 0 || body.len==0)
242-
goto reply;
235+
if (get_body(msg, &body) != 0 || body.len==0) {
236+
if (msg->REQ_METHOD != METHOD_UPDATE)
237+
goto reply;
238+
code = 200;
239+
} else {
240+
if (srec_rtp.copy_answer(ss->rtp, &mod_name,
241+
&ss->media, &body) < 0) {
242+
LM_ERR("could not offer new SDP!\n");
243+
code = 488;
244+
goto reply;
245+
}
246+
if (srec_rtp.copy_offer(ss->rtp, &mod_name, &ss->media,
247+
RTP_COPY_MODE_SIPREC|RTP_COPY_LEG_BOTH, -1, &body) < 0) {
248+
LM_ERR("could not refresh recording!\n");
249+
goto reply;
250+
}
251+
code = 200;
252+
}
243253

244-
code = 200;
245254
reply:
246-
#endif
247255
srec_reply(ss, msg->REQ_METHOD, code, (body.len?&body:NULL));
248256
return 0;
249257
}

0 commit comments

Comments
 (0)