For anyone who comes across this post in future - this is a bug in 3.1 and above (probably when topology hiding is used) which seems to have been fixed in 3.4 A workaround is to keep the SDP from caller or callee and send it as the third variable of media_exchange_from_uri function to establish the connection correctly.
On Sun, Sep 7, 2025 at 8:34 PM M S <[email protected]> wrote: > A(caller) <=> B(opensips) <=> C(callee) > B(opensips) <=> D(media server) > > I tried it with the "callee" leg in media_exchange_from_uri too. > technically, the B machine in the middle should send the ip/port of A and D > to each other in SDPs to make sure media is direct between A and D - but B > to D invite always has the B's ip/port in it. It should be due to something > in my script, but what could it be? > > On Sun, Sep 7, 2025 at 7:03 PM M S <[email protected]> wrote: > >> Hi list, >> I am trying to use media_exchange_from_uri to play hold music. I use the >> sample code from opensips blog: >> >> if (has_totag() && is_method("INVITE")) { >> # catch the on-hold re-invite >> if(is_audio_on_hold()) { >> if (media_exchange_from_uri("sip:[email protected]")) >> exit; >> } else { >> # call has resumed - terminate any ongoing media played >> media_terminate(); >> } >> } >> >> >> But the behaviour is strange. >> >> A invite comes to proxy B, rtpproxy is engaged and invite is sent to C >> >> A,Aport <=> B,Bport1 - B,Bport2 <=> C,Cport >> >> A pressing hold: Invite with a=sendonly is received. With the above >> configuration, B sends an INVITE (B ip and Bport1) to media.server.ip (D). >> >> Media server D responds with 200 OK (D ip and Dport). Opensips B2B sends >> D,Dport SDP to C (so C expects to receive RTP from D port). >> >> While C expects to receive RTP from D directly, D has exchanged SDP with B >> and therefore sends RTP to B! >> >> Why is this happening? >> >> >> Thank you :) >> >>
_______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
