[OpenSIPS-Users] fix_nated_sdp() not taking effect

Mark Farmer farmorg at gmail.com
Tue Nov 19 07:26:23 EST 2019


Hi Răzvan

My OpenSIPS/RTPProxy box has 2 interfaces, public(NAT) - for phones &
internal - for Asterisk.
The issue is that if a call from one registered user to another is rejected
& goes to failure_route() then I send the call to an Asterisk box for
voicemail which is connected via the internal interface.

When the call is routed to Asterisk, I need the RTP to flow between
RTPproxy & Asterisk on the internal interfaces so I need to have the SDP
correct before it hits Asterisk. RTP to & from the phone needs to use the
public interface.

Initial media flow:
phone<-->OpenSIPS/RTPproxy<-->phone

Voicemail media flow:
phone<-->OpenSIPS/RTPproxy<-->Asterisk

What is the best way to achieve this?

Many thanks!
Mark.


On Mon, 18 Nov 2019 at 12:50, Răzvan Crainea <razvan at opensips.org> wrote:

> Yes, the problem is definitely the fact that you are calling
> `rtpproxy_offer()` for the initial invite. Hence, when you run
> `fix_nated_sdp()`, you're trying to change the same IP once again - this
> is not possile in OpenSIPS.
> But I wonder why you need the `fix_nated_sdp()` if you are using
> RTPProxy. Can't you just use the `ip_address`[1] field to advertise the
> proper IP int he c= line.
>
> [1]
>
> https://opensips.org/html/docs/modules/3.0.x/rtpproxy.html#func_rtpproxy_offer
>
> Best regards,
> Răzvan
>
> On 11/13/19 1:51 PM, Mark Farmer wrote:
> > Hi everyone
> >
> > In my failure_route I'm routing to an Asterisk box for voicemail & I
> > need to change the SDP c/o parameters to use the correct internal IP
> > address but using fix_nated_sdp() is not taking effect.
> >
> > if (t_check_status("486|408|603")) {
> >                  xlog("CUSTOM_LOG: User replied $T_reply_code - Routing
> > to Asterisk Voicemail service.");
> >                  prefix("VMR_");
> >                  rewritehostport("10.150.50.53:2404
> > <http://10.150.50.53:2404>");
> >                  force_send_socket(udp:10.150.50.51);
> >                  fix_nated_sdp(10,"10.150.50.51");
> >
> >                  if (!t_relay()) {
> >                          send_reply(500,"Internal Error");
> >                  }
> >                  exit;
> > }
> >
> > I get the CUSTOM_LOG entry so I know that the route is executing.
> >
> > Maybe I'm doing something wrong with the flags, I've tried:
> > fix_nated_sdp(2,"10.150.50.51");
> > fix_nated_sdp(8,"10.150.50.51");
> > fix_nated_sdp(10,"10.150.50.51");
> >
> > But when I examine the SDP in the resulting invite, the c/o parameters
> > are never changed.
> > I'm using rtpengine_offer/answer in the initial routing, could it be
> > related to that?
> >
> > I'm using OpenSIPS 3.0.1
> >
> > Best regards
> > Mark.
> >
> >
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >
>
> --
> Răzvan Crainea
> OpenSIPS Core Developer
>    http://www.opensips-solutions.com
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


-- 
Mark Farmer
farmorg at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20191119/533ac16b/attachment.html>


More information about the Users mailing list