Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] SDP is not updated on re-INVITE or late offer via b2b #3520

Open
devoxy1 opened this issue Nov 19, 2024 · 0 comments
Open

[BUG] SDP is not updated on re-INVITE or late offer via b2b #3520

devoxy1 opened this issue Nov 19, 2024 · 0 comments

Comments

@devoxy1
Copy link

devoxy1 commented Nov 19, 2024

I'm testing transfers with b2b on opensips+rtpengine setup.
The scenario is:
A -INVITE--> Opensips -INVITE--> B
A <-200OK-- Opensips <-200OK-- B
------ Opensips <-REFER/302-- B
------ Opensips --INVITE-> C
------ Opensips <-200OK-- C
------ Opensips --BYE-> B
A <-re-INVITE-- Opensips --re-INVITE-> B

I'm using rtp_relay for SDP processing on new leg. Here is brief config i use:

route{
     rtp_relay_engage("rtpengine", 0);

    ...

    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));
        # initialize B2B session
        xlog("L_INFO","[$ci] [$rm] [ROUTE] B2B logic key: $b2b_logic.key");
        b2b_init_request("refer");

        exit;
    }
}
    ...

route[b2b_logic_request] {
        if ($rm != "REFER") {
            # for requests other than REFER, no special actions needs to be done,
            # just pass the request to the peer
            xlog("L_INFO", "[$ci] [$rm] [B2B_LOGIC_REQUEST] Passing request - From-tag: $ft, To-tag: $tt");
            b2b_pass_request();
            exit;
        }

        xlog("L_INFO", "[$ci] [$rm] [B2B_LOGIC_REQUEST] BLIND TRANSFER - Refer-To: $hdr(Refer-To)");
        xlog("L_INFO", "[$ci] [$rm] [B2B_LOGIC_REQUEST] Refer-To: $hdr(Refer-To)");

        xlog("L_INFO", "[$ci] [$rm] [B2B_LOGIC_REQUEST] PEER: $var(peer) CLIENT: $var(new_client)");
        # Создаем новый INVITE третьей стороне
        b2b_client_new($var(new_client), $hdr(refer-to),,,, $avp(b2b_hdrs), $avp(b2b_hdr_bodies));

        # bridge the referrer's peer with the referee
        b2b_bridge("peer",$var(new_client),,"notify,no-late-sdp");
}

route[b2b_logic_reply] {

    if ( t_check_status("30[12]") ) {
        xlog("L_INFO", "[$ci] [$rm] [B2B_LOGIC_REPLY] DIVERSION - From-tag: $ft, To-tag: $tt");

        ...

        b2b_client_new("diversion", $var(redirected_contact),,,, $avp(b2b_hdrs), $avp(b2b_hdr_bodies));
        b2b_bridge_retry("diversion");
    }

    b2b_handle_reply();
}

OpenSIPS version you are running

version: opensips 3.4.9 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, 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: 448fdf959
main.c compiled on 12:37:50 Nov 19 2024 with gcc 11

Describe the bug
I encountered and issue with incorrect SDP on re-invites on new leg either using REFER or 302 Moved for transfers.
In the scenario above INVITE from A to opensips and new leg on B is processed correctly, SDP is updated and rtpengine's IP is set.
New leg to C is created with correct SDP, rtpengine's IP. However if reINVITE from A comes later to update session SDP is not updated and IP of A is passed to C. The issue is present when using REFER with no-late-sdp or 302 Moved. When using default REFER behavior with late offer SDP in ACK is not updated by rtpengine's IP as well.

To Reproduce

  1. Call from A to B via opensips
  2. B sends REFER to transfer the call to C
  3. Opensips accepts REFER and send INVITE to C
  4. C accepts the call
  5. Call with B is hung up
  6. Opensips sends re-INVITE to both A and C with incorrect SDP

Expected behavior
re-INVITE sends rtpengine IP in SDP

Relevant System Logs

OS/environment information

  • Operating System: Ubuntu 22.04.1 LTS
  • OpenSIPS installation: git

Additional context
There was an issue opened by me with earlier version before which was closed. The problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant