Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEMS v. 1.7.0 IPV4/IPV6 networking problem? #63

Open
pebastega opened this issue Jul 6, 2017 · 1 comment
Open

SEMS v. 1.7.0 IPV4/IPV6 networking problem? #63

pebastega opened this issue Jul 6, 2017 · 1 comment

Comments

@pebastega
Copy link

Hi Everyone,
I'm using SEMS (v. 1.7.0) with Kamailio proxy to make a ipv4/ipv6 interworking:

Sip Client <-------> Proxy <--- IPV4 ---> Sems <--- IPV6 ---> MyVoipGw

and I have any problems with sems ipv6 configuration.

I configured two sems ntw interfaces IPV4/IPV6:

ifexternal
sip_ip_ifexternal=192.168.110.79
sip_port_ifexternal=5082
media_ip_ifexternal=192.168.110.79
rtp_low_port_ifexternal=10000
rtp_high_port_ifexternal=60000

ifexternalipv6
sip_ip_ifexternalipv6=2002:c0a8:6e4f:5::1
sip_port_ifexternalipv6=5092
media_ip_ifexternalipv6=2002:c0a8:6e4f:5::1
rtp_low_port_ifexternalipv6=70000
rtp_high_port_ifexternalipv6=80000

when sems startup I see in the logs:

INFO: Signaling interfaces:
INFO: (0) name='ifinternal';LocalIP='127.0.0.1';LocalPort='5080';PublicIP='';TCP=2000/3600000
INFO: (1) name='ifexternal';LocalIP='192.168.110.79';LocalPort='5082';PublicIP='';TCP=2000/3600000
INFO: (2) name='ifexternalipv6';LocalIP='[2002:c0a8:6e4f:5::1]';LocalPort='5092';PublicIP='';TCP=2000/3600000
INFO: Signaling address map:
INFO: 127.0.0.1 -> ifinternal
INFO: 192.168.110.79 -> ifexternal
INFO: [2002:c0a8:6e4f:5::1] -> ifexternalipv6
INFO: Media interfaces:
INFO: (0) name='ifexternal';LocalIP='192.168.110.79';Ports=[10000;60000];PublicIP=''
INFO: (1) name='ifexternalipv6';LocalIP='2002:c0a8:6e4f:5::1';Ports=[70000;80000];PublicIP=''

but when sems receives a request to forward via next_hop=2002:C0A8:6E4F:5:A00:27FF:FE25:A4B9 (IPV6 ADDRESS MYVOIPGW) I have an error in trace:

ERROR: Could not find a local interface for resolved local IP (local_tag='3AF5A893-595D004B000F0808-4AAFF480';local_ip='2002:c0a8:6e4f:5::1')
WARNING: Error while computing outbound interface: default interface will be used instead.
DEBUG: setting outbound interface to 0

and sems crash with:

ERROR: sendto(12;]:5060): Address family not supported by protocol
ERROR: Error from transport layer
Segmentation fault

From code I see in "getOutboundIf" method of "AmBasicSipDialog" class that retrieve the interface to use to send sip packets from "next_hop" host but the method do not find interface because the search ipv6 address without "[" "]".

From code I see:

if(!next_hop.empty() &&
    !parse_next_hop(stl2cstr(next_hop),ip_list) && -------------> parse_next_hop method return next_hop host without "[" "]"
  !ip_list.empty()) {
      dest_ip = c2stlstr(ip_list.front().host);
}
if(get_local_addr_for_dest(dest_ip,local_ip) < 0){ -----------> "get_local_addr_for_dest" method use "dest_ip" to get "local_ip" for correct ip family (IPV6) and return it without "[" "]"
    ERROR("No local address for dest '%s' (local_tag='%s')",dest_ip.c_str(),local_tag.c_str());
  goto error;
}

if_it = AmConfig::LocalSIPIP2If.find(local_ip); -------------> local_ip not found in LocalSIPIP2If because in this list ipv6 address is in [] form.
if(if_it == AmConfig::LocalSIPIP2If.end()){
    ERROR("Could not find a local interface for resolved local IP (local_tag='%s';local_ip='%s')",
    local_tag.c_str(), local_ip.c_str());
  goto error;
}

I modified the code to add [] to local_ip and the interfaces found.

My questions are:
is it a bug or is my wrong configuration?
Can You help me?

thank's in advance!

@juha-h
Copy link
Contributor

juha-h commented Jul 6, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants