[SR-Users] SIP between IPv4 and IPv6 agents

Klaus Darilion klaus.mailinglists at pernau.at
Thu Dec 2 15:21:13 CET 2010



Am 02.12.2010 13:06, schrieb Komáromi Péter:
> Hi!
>
> So if you say it is possible to solve the problem with the only
> location table, the location_inet4 and location_inet6 is not
> certainly necessary... do I _have to_ use the 4to6.cfg file from the
> source of kamailio, or not?

When you call force_rtp_proxy() then you have to provide the i/e flags 
to tell rtpproxy how it should bridge the call. Therefore you need to 
know for every call:
  - is the caller IPv4 or IPv6?
  - is the callee IPv4 or IPv6?

Finding out the protocol version of the caller is rather easy:

if (af == inet) {
   # caller ipv4
   ...
} else {
   # caller ipv6
   ...
}

But finding out if the callee is v4 or v6 is difficult. Actually it may 
even be that the callee is registered with 2 clients at the same time - 
one using v4 and v6. As far as I know this multi-registration scenario 
can not be handled currently - only single-registrations or 
multi-registrations which use the same protocol version are supported.

Anyway - there are several approaches how to detect the IP version of 
the callee.

  - fixed mapping: for example if you know that all usernames starting 
with 1 are IPv4 clients, and all usernames starting with 2 are IPv6 
clients, then you can detect the callee's protocol version manually, e.g:

if ( $(rU{s.substr,0,1}) == "1") {
   # callee ipv4
   ...
} else {
   # callee ipv6
   ...
}


- check destination URI if it contains a IPv4 or IPv6 address, e.g. use 
http://www.kamailio.org/dokuwiki/doku.php/transformations:devel#resubst_expression 
to test if $dd contains '.' which would indicate a ipv4 address.

- use dedicated location tables

> (Because it uses them, for instance here: if (method == "REGISTER")
> { if (af == inet) { save("location-inet4"); } else if (af == inet6)
> { save("location-inet6");...)
>
> If I do not have to use it, I do not need to merge it with my
> kamailio.cfg file, the steps I have to do are: install rtpproxy,
> start it with the appropriate parameters and set the forcing in the
> kamailio.cfg file?!

The more I think about it I prefer the approach with separated location 
tables. It should be rather easy to integrate the 2 location tables into 
your existing config.

regards
Klaus

PS: please Cc the mailing list



More information about the sr-users mailing list