File tree 1 file changed +18
-10
lines changed
1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -232,18 +232,26 @@ static int srec_b2b_req(struct sip_msg *msg, struct src_sess *ss)
232
232
str body = str_init ("" );
233
233
int code = 405 ;
234
234
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
+ }
243
253
244
- code = 200 ;
245
254
reply :
246
- #endif
247
255
srec_reply (ss , msg -> REQ_METHOD , code , (body .len ?& body :NULL ));
248
256
return 0 ;
249
257
}
You can’t perform that action at this time.
0 commit comments