OpenSIPS / opensips

OpenSIPS is a GPL implementation of a multi-functionality SIP Server that targets to deliver a high-level technical solution (performance, security and quality) to be used in professional SIP server platforms.
https://opensips.org
Other
1.26k stars 576 forks source link

[BUG] rtp_relay doesn't work on bridge_retry() #3116

Open devoxy1 opened 1 year ago

devoxy1 commented 1 year ago

Hello!

I have scenario with b2b module that handles 302 redirects - once received it creates new b2b_client and then does bridge_retry to connect them. Here is part of my config:

if (!has_totag()) {
        b2b_server_new("caller",,$avp(extra_hdrs),$avp(extra_hdr_bodies));
        b2b_client_new("callee", "$ru",,,,$avp(b2b_hdrs),$avp(b2b_hdr_bodies));

        $rtp_relay = "replace-origin replace-session-connection";
        $rtp_relay_peer = "replace-origin replace-session-connection";
        rtp_relay_engage("rtpengine");
        # initialize B2B session
        b2b_init_request("refer");

        exit;
    }

When INVITE is received i create client and server entities, engage rtp_relay to use rtpengine for both legs and initialize b2b scenario. If i receive 302 Moved Temporary on second leg i create new client entity and then do bridge_retry to connect calls:

route[b2b_logic_reply] {
...
    if ( t_check_status("30[12]") ) {
        b2b_client_new("diversion", $var(redirected_contact),,,, $avp(b2b_hdrs), $avp(b2b_hdr_bodies));
        b2b_bridge_retry("diversion");
    }
}

The call setup works OK, INVITE is sent out, replied and call is connected. The problem is that SDP is not changed on new leg and IP of Caller is passed for media. I also get an error in logs: rtp_relay_b2b_tm_req: could not find a pending peer leg!

I understand that previous leg doesn't exist anymore and rtp_relay doesn't know anything about new one. Is there a way i can re-engage rtp_relay for new leg? Or i have misconfiguration somewhere?

OpenSIPS version you are running

version: opensips 3.4.0-beta (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, CC_O0, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
git revision: 18504bc5a
main.c compiled on 08:33:48 Jun 15 2023 with gcc 9

Describe the bug bridge_retry function doesn't re-engage rtp_relay for new leg.

To Reproduce

Steps to reproduce the behavior: Example:

  1. Create configuration with b2b_init scenario
  2. Start opensips
  3. A sends INVITE to opensips
  4. opensips creates new leg to B
  5. B accepts the call and sends 302 Moved Temporary
  6. B leg is ended and new leg to C is created with Contact header as URI
  7. call bridge_retry
  8. SDP in INVITE to C contains IP of A instead of rtpengine

Expected behavior SDP in INVITE to C contains IP of rtpengine

Relevant System Logs

opensips[215873]: INFO:b2b_logic:b2bl_delete_entity: delete tuple [14871.0], entity [14871.1400639.1686926369.762662252]
opensips[215873]: ERROR:rtp_relay:rtp_relay_b2b_tm_req: could not find a pending peer leg!
opensips[215873]: INFO:b2b_logic:b2bl_add_client: adding entity [0x7f6a808cd0d0]->[14871.622994.1686926371.620117705] to tuple [0x7f6a808bff08]->[14871.0]
opensips[215873]: [14871.1400639.1686926369.762662252] [INVITE] [B2B_LOGIC_REPLY] [302, Moved Temporarily] Incoming B2B reply from sip:0011@10.232.35.90, entity: <null>
opensips[215873]: ERROR:b2b_logic:_b2b_handle_reply: No b2b_key match found [14871.1400639.1686926369.762662252], src=1
opensips[215875]: INFO:b2b_logic:b2b_add_dlginfo: Dialog pair: [d32121f4-45ee-468d-abbf-1b2867121ec9] - [14871.622994.1686926371.620117705]

OS/environment information

Additional context

Thank you!

github-actions[bot] commented 1 year ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 1 year ago

up

github-actions[bot] commented 1 year ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 1 year ago

UP

github-actions[bot] commented 1 year ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 1 year ago

Still actual

razvancrainea commented 1 year ago

Still planning to look into this, but didn't find the time yet. Thanks for keeping it up, as soon as I have updates, I will get back to you.

github-actions[bot] commented 12 months ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 12 months ago

Up

github-actions[bot] commented 11 months ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 11 months ago

UP

github-actions[bot] commented 10 months ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 10 months ago

Up

devoxy1 commented 10 months ago

It seems like rtp_relay doesn't work on b2b_bridge as well(in REFER scenario on new leg SDP is not changed)

github-actions[bot] commented 9 months ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 9 months ago

Still actual

github-actions[bot] commented 9 months ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 9 months ago

Up

github-actions[bot] commented 8 months ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 8 months ago

Up

github-actions[bot] commented 8 months ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 8 months ago

up

github-actions[bot] commented 7 months ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 7 months ago

Up

github-actions[bot] commented 6 months ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 6 months ago

Up

github-actions[bot] commented 6 months ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 5 months ago

Up

devoxy1 commented 4 months ago

Up. This is still actual. Hope someone can check this up.

github-actions[bot] commented 3 months ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 3 months ago

Up

github-actions[bot] commented 3 months ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 3 months ago

up

github-actions[bot] commented 2 months ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 2 months ago

Up

github-actions[bot] commented 3 weeks ago

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

devoxy1 commented 3 weeks ago

up