Skip to content

Commit e00300c

Browse files
committed
rtp_relay: avoid crash when dialog/b2b not loaded
1 parent 96eac0b commit e00300c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

modules/rtp_relay/rtp_relay_ctx.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,10 @@ int rtp_relay_ctx_preinit(void)
10071007
if (load_b2b_logic_api(&rtp_relay_b2b)==0) {
10081008
rtp_relay_b2b_ctx_idx = rtp_relay_b2b.ctx_register_ptr(rtp_relay_b2b_end);
10091009
}
1010+
if (rtp_relay_dlg_ctx_idx < 0 && rtp_relay_b2b_ctx_idx < 0) {
1011+
LM_ERR("nor dialog not b2b modules loaded - cannot use this module!\n");
1012+
return -1;
1013+
}
10101014
return 0;
10111015
}
10121016

@@ -1852,6 +1856,10 @@ int rtp_relay_ctx_engage(struct sip_msg *msg,
18521856
}
18531857

18541858
if (route_type != LOCAL_ROUTE) {
1859+
if (rtp_relay_dlg_ctx_idx < 0) {
1860+
LM_ERR("dialog module not loaded - failed to engage\n");
1861+
return -1;
1862+
}
18551863
if (!rtp_relay_ctx_engaged(ctx)) {
18561864

18571865
/* handles the replies to the original INVITE */

0 commit comments

Comments
 (0)