I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2009-04-29 19:18:55-07 by dsp77
loop detected with stateless_proxy.pl
Hi,
I apologize if this is a too basic VoIP problem I am having. I tried to use the stateless_proxy.pl and ran into a loop problem. I wonder whether someone could give me a hind whether I am doing something wrong here in the usage of the proxy.
This is the way I am calling the proxy:
perl stateless_proxy.pl -d 30 -r --domain mysip.de --leg 192.168.122.10

The proxy runs on a Linux box with a physical interface 192.168.122.10 and SIP clients connect over PPPoE. There are two clients, one at address 192.168.9.136 and a second at 192.168.9.140. The two clients register just fine to the proxy, but then when I try to do a call from one to the other I am getting the loop detection error.
Here is what the log shows:
1240918089.7097 DEBUG:<10> Net::SIP::StatelessProxy::receive[95]: received REQ INVITE ip:1234#@mys +ip.de;transport=udp with body 1240918089.7101 DEBUG:<10> myProxy::__forward_request_getleg[402]: query registrar for sip:1234#@my +sip.de 1240918089.7120 DEBUG:<10> Net::SIP::Leg::forward_outgoing[218]: loop detected because outgoing leg + is in Via. DROP 1240918089.7121 DEBUG:<10> Net::SIP::StatelessProxy::__forward_packet_final[442]: ERROR while forwa +rding: loop detected on outgoing leg, dropping

I read that the loop detection is done when in the Via header the own IP address is detected. But the original INVITE request comes in just fine, with the right address in the Via header:
1240918089.7023 DEBUG:<2> Net::SIP::Leg::receive[414]: received on 192.168.122.10:5060 from 192.168 +.9.136:5060 packet 1240918089.7023 DEBUG:<2> INVITE sip:1234#@mysip.de;transport=udp SIP/2.0 1240918089.7023 DEBUG:<2> Via: SIP/2.0/UDP 192.168.9.136:5060;branch=z9hG4bKc4e7dfb6afe861d45d3d9ab +392eedc18

What happens then is that it gets remapped, which is what I don't understand:
1240918089.7025 DEBUG:<10> Net::SIP::StatelessProxy::receive[95]: received REQ INVITE sip:1234#@my +sip.de;transport=udp with body 1240918089.7031 DEBUG:<10> myProxy::__forward_request_getleg[402]: query registrar for sip:1234#@my +sip.de 1240918089.7085 DEBUG:<2> Net::SIP::Leg::deliver[330]: delivery from 192.168.122.10:5060 to udp:192 +.168.122.10:5060 OK: 1240918089.7085 DEBUG:<2> INVITE sip:1234#@mysip.de;transport=udp SIP/2.0 1240918089.7085 DEBUG:<2> Via: SIP/2.0/UDP 192.168.122.10;branch=z9hG4bK59127a34823c2e3e7036db39876 +e050c83dddc009b7fb78c79ca7030b163dfea

This is when the Via header is changed and the IP address of the registered leg is added to it. Now that address is used for incoming and outgoing requests, so I don't understand why this rewrite happens.
Anyone can shed some light on that?

Thanks for your help.

Cheers, Guenter
Direct Responses: 10566 | Write a response
Posted on 2009-04-30 06:28:11-07 by noxxi in response to 10563
Re: loop detected with stateless_proxy.pl
Hi, I'm the author of Net::SIP, so I might be able to answer your questions: - Which version of Net::SIP you are running? - Could you increase the debug level to 100, so I can get a full dump of the packets (you might want send this directly to me, e.g. sullr@cpan.org
Direct Responses: 10568 | Write a response
Posted on 2009-04-30 11:09:58-07 by dsp77 in response to 10566
Re: loop detected with stateless_proxy.pl
Hmm, so I increased the debug level and re-run the test and suddenly it worked. I changed the debug level back to make sure it has not anything to do with it and it still works. So it must have been something on my side that I did wrong.

Thanks for your attention. If it comes up again and I am able to trace I will provide the trace.
Direct Responses: Write a response