[SR-Users] Issue handling SRTP and RTP with rtpproxy and rtpengine

Alberto Sagredo alberto.sagredo at avanzada7.com
Wed Jul 15 18:11:24 CEST 2015


Roberto just call it on NATMANAGE as shown. I route everything now thru
that route..

You have to configure rtpengine to use internal external interfaces

route[NATMANAGE] {


#!ifdef WITH_NAT


# if (is_request()) {

# if(has_totag()) {

#  if(check_route_param("nat=yes")) {

#  setbflag(FLB_NATB);

#  }

# }

# }

# if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB))){

# return;

# }

# route(RTPPROXY);


route(RTPPROXY);


 if (is_request()) {

 if (!has_totag()) {

 add_rr_param(";nat=yes");

 }

}

if (is_reply()) {

 if(isbflagset(FLB_NATB)) {

 fix_nated_contact();

 }

}

#!endif

return;

}






2015-07-15 16:59 GMT+02:00 Roberto Fichera <kernel at tekno-soft.it>:

>  On 07/15/2015 08:44 AM, Alberto Sagredo wrote:
>
> Hi Alberto,
>
> can you also share part of the relevant place where you are calling that
> route?
>
> Cheers,
> Roberto Fichera.
>
>  Hi Daniel
>
>  Kamailio is for hard people and fun :)
>
>  Thanks Visily i finnaly got it working with your tip. You were right
> about internal external options instead direction=...
>
>  Here its some code to someone could need it
>
>  route[RTPPROXY] {
>
>         if (is_method("INVITE")){
>
> if(ds_is_from_list(1)){
>
>                 if (is_ip_rfc1918("$si")) {
>
>                         if (sdp_get_line_startswith("$avp(mline)", "m="))
>
>                         {
>
>                                 #!ifdef WITH_RTPENGINE
>
>                                 if ($avp(mline) =~ "SAVP")
>
>                                 {
>
>                                 xlog("L_INFO", "We got SRTP ");
>
>                                 rtpengine_manage("trust-address internal
> external replace-origin replace-session-connection ICE=remove ");
>
>                                 return;
>
>                                 }
>
>                                 #!endif
>
>
>                                  if ($avp(mline) =~ "AVP")
>
>                                 {
>
>                                 xlog("L_INFO", "We got RTP ");
>
>                                 #!ifdef WITH_RTPPROXY
>
>                                  set_rtp_proxy_set("1");
>
>                                 rtpproxy_manage("fwei");
>
>                                 start_recording();
>
>                                 #!endif
>
>
>                                  #!ifdef WITH_RTPENGINE
>
>                                 rtpengine_manage("trust-address internal
> external replace-origin replace-session-connection ICE=remove ");
>
>                                 #!endif
>
>
>                                  }
>
>                         }
>
>
>                          }
>
>                  }
>
> else if(!ds_is_from_list()){
>
>
>                          if (sdp_get_line_startswith("$avp(mline)", "m="))
>
>                         {
>
>                                  #!ifdef WITH_RTPENGINE
>
>                                  if ($avp(mline) =~ "SAVP")
>
>                                 {
>
>                                 xlog("L_INFO", "We got SRTP ");
>
>                                 rtpengine_manage("external internal
> replace-origin replace-session-connection ICE=remove RTP AVP");
>
>                                 return;
>
>                                 }
>
>
>                                  #!endif
>
>                                 if ($avp(mline) =~ "AVP")
>
>                                 {
>
>                                 xlog("L_INFO", "We got RTP ");
>
>                                 #!ifdef WITH_RTPPROXY
>
>                                 set_rtp_proxy_set("1");
>
>                                 rtpproxy_manage("fwie");
>
>                                 start_recording();
>
>                                 #!endif
>
>
>                                  #!ifdef WITH_RTPENGINE
>
>                                 rtpengine_manage("external internal
> replace-origin replace-session-connection ICE=remove RTP AVP");
>
>                                 #!endif
>
>
>                                  }
>
>                         }
>
>
>
>                  }
>
>       }
>
>
>   }
>
>
>
>
> 2015-07-14 18:46 GMT+02:00 Daniel Tryba <d.tryba at pocos.nl>:
>
>> On Tuesday 14 July 2015 18:19:02 Alberto Sagredo wrote:
>> > In my tests rtpproxy recording waste less resources than asterisk
>> >
>> > That was one of the reasons
>>
>> How much time have you spend so far on a problem that asterisk can handle
>> out
>> of the box? ;)
>>
>> I'd love to do this with kamailio/rtpengine (I don't record), but sofar
>> the
>> blunt quickfix is to use asterisk. I needed a transcoder anyway and
>> handling
>> RTP/SRTP conversions when either endpoint needs it is simple.
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users at lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150715/e6ef3732/attachment.html>


More information about the sr-users mailing list