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

Vasiliy Ganchev vasiliy.ganchev at wildix.com
Tue Jul 14 17:16:31 CEST 2015


Alberto Sagredo-2 wrote
> Thanks Vasily i have changed a little today using a RTPPROXY route.
> 
> Thats what i have right now
> 
> But its not working as expected
> 
> What i try is to detect if i have SAVP from endpoint and translate to RTP
> to ASterisk an later RTP from ASterisk translate to SRTP using rtpengine
> 
> I had extrange behaviour using rtpproxy that send SRTP to Asterisk and i
> have SRTP calls, i though rtpproxy 2.0 could not manage SRTP calls. but it
> pass it to Asterisk
> 
> Using RTPengine i have tested with rtpproxy_manage as you see and also
> with
> rtpengine.
> 
> If i load both start_recording() feature is lost.
> 
> On rtpengine (behind NAT) im using it as:
> 
> INTERFACES="192.168.0.178 internal/192.168.0.178 external/192.168.0.179
> !EXTERN_IP
> 
> 
> On NATMANAGE route i call directly
> 
> route(RTPPROXY);
> 
> 
> Hope this helps
> 
> 
> -----
> 
> route[RTPPROXY] {
> 
>         if (is_method("INVITE")){
> 
> if(ds_is_from_list(1)){
> 
>                 if (is_ip_rfc1918("$si")) {
> 
>                                 xlog("L_INFO", "LLamada desde los
> Asterisk_$si -> RTPPROXY\n");
> 
>                         if (sdp_get_line_startswith("$avp(mline)", "m="))
> 
>                         {
> 
>                                 #!ifdef WITH_RTPENGINE
> 
>                                 if ($avp(mline) =~ "SAVP")
> 
>                                 {
> 
>                                 xlog("L_INFO", "Tenemos SRTP ");
> 
>                                 xlog("L_INFO", "Llamada entre Extensiones
> -> RTPENGINE INTERNAL");
> 
>                                 rtpengine_manage("direction=internal
> replace-origin replace-session-connection ICE=remove");
> 
>                                 return;
> 
>                                 }
> 
>                                 #!endif
> 
> 
>                                 if ($avp(mline) =~ "AVP")
> 
>                                 {
> 
>                                 xlog("L_INFO", "Tenemos RTP ");
> 
>                                 xlog("L_INFO", "Llamada entre Extensiones
> -> RTPROXY ");
> 
> 
>                                 #!ifdef WITH_RTPPROXY
> 
>                                  set_rtp_proxy_set("1");
> 
>                                 rtpproxy_manage("fwei");
> 
>                                 start_recording();
> 
>                                 #!endif
> 
> 
>                                 #!ifdef WITH_RTPENGINE
> 
>                                 set_rtp_proxy_set("2");
> 
>                                 rtpproxy_manage("ie");
> 
>                                 #!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", "Tenemos SRTP ");
> 
>                                 xlog("L_INFO", "Llamada entre Extensiones
> -> RTPENGINE EXTERNAL ");
> 
>                                 rtpengine_manage("direction=external
> replace-origin replace-session-connection ICE=remove");
> 
>                                 return;
> 
>                                 }
> 
> 
>                                 #!endif
> 
>                                 if ($avp(mline) =~ "AVP")
> 
>                                 {
> 
>                                 xlog("L_INFO", "Tenemos RTP ");
> 
>                                 xlog("L_INFO", "Llamada entre Extensiones
> -> RTPROXY ");
> 
> 
>                                 #!ifdef WITH_RTPPROXY
> 
>                                 set_rtp_proxy_set("1");
> 
>                                 rtpproxy_manage("fwie");
> 
>                                 start_recording();
> 
>                                 #!endif
> 
> 
>                                 #!ifdef WITH_RTPENGINE
> 
>                                 set_rtp_proxy_set("2");
> 
>                                 rtpproxy_manage("ei");
> 
>                                 #!endif
> 
> 
>                                 }
> 
>                         }
> 
> 
> 
>                 }
> 
>       }
> 
> 
> }
> 
> 
> 
> 2015-07-14 14:24 GMT+02:00 Vasiliy Ganchev <

> vasiliy.ganchev@

> >:
> 
>> Alberto Sagredo-2 wrote
>> > ...
>> > I have been able to make SRTP To RTP to Asterisk
>> >
>> > But im not able to call between SRTP extensions, i understand also SRTP
>> to
>> > RTP would work as im doing with Asterisk (Only the speak SRTP as
>> rtpengine
>> > trasncode)
>> >
>> >
>> > If you need any more info let me know.
>> >
>> > _______________________________________________
>> > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>
>> > sr-users at .sip-router
>>
>> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>> Hi!
>> If you make SRTP to RTP to Asterisk, you possibly will need vice versa
>> conversion (when request coming from Asterisk to client with SRTP).
>>
>> Can you describe the logic of test case: (UA-A (SRTP) --> Kamailio (make
>> SRTP->RTP) .... etc.
>>
>> Because your explanation is difficult to understand.
>>
>> Cheers!
>>
>>
>>
>> --
>> View this message in context:
>> http://sip-router.1086192.n5.nabble.com/Issue-handling-SRTP-and-RTP-with-rtpproxy-and-rtpengine-tp139488p139521.html
>> Sent from the Users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> 

> sr-users at .sip-router

>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
> 
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

> sr-users at .sip-router

> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

What about ICE, where it has to work? (client->Kamailio - yes,
Kamailio->Asterisk - no) or somehow else.

For your description, I think you need to add something like this:
- Kamailio -> Asterisk
   rtpengine_manage("...............RTP/AVP"); ///// this will change
profile to RTP/AVP 

- Asterisk -> Kamailio 
  rtpengine_manage("...............RTP/SAVPF"); ///// this will make
backward changes

Also read thoroughly the meaning and usage of "direction" parameter, I think
you have little misunderstanding of how it works (maybe I'm wrong and you
use it as it has to be, but re-read it anyway)



--
View this message in context: http://sip-router.1086192.n5.nabble.com/Issue-handling-SRTP-and-RTP-with-rtpproxy-and-rtpengine-tp139488p139556.html
Sent from the Users mailing list archive at Nabble.com.



More information about the sr-users mailing list