What happend was that do_routing in secret makes a call to route[1] before overwriting RURI. I changed all references to route[1] to route[111] instead (%s/route(1)/route(111)/g) and modified route[1] to do in essence nothing. Below is the new code as well as the syslog. Calls are now forwarded correctly, but it worries me that route[1] is still called somehow, without *any* references to it anywhere in the config file.<br>
<br>route[1] {<br> xlog("route-1: ru=$ru; du=$du; rd=$rd");<br> exit;<br>}<br><br>route[10] {<br># pre-processing with strips/prefixes etc<br> ...<br> xlog("Before routing: ru=$ru; du=$du; rd=$rd");<br>
if(do_routing("0")) {<br> xlog("After routing: ru=$ru; du=$du; rd=$rd");<br> route(111);<br> exit;<br> }<br> exit;<br>}<br><br>route[111] {<br> setflag(1);<br> $avp(s:can_uri) = $ru;<br>
xlog("route-111: ru=$ru; du=$du; rd=$rd");<br> if (!t_relay()) {<br> sl_reply_error();<br> };<br> exit;<br>}<br><br>SYSLOG:<br>Jan 20 16:24:19 sbc2 /usr/sbin/opensips[1109]: Before routing: ru=sip:34615122...@opensips; du=<null>; rd=opensips<br>
Jan 20 16:24:19 sbc2 /usr/sbin/opensips[1109]: route-1: ru=sip:34615122...@opensips; du=<null>; rd=opensips<br>Jan 20 16:24:19 sbc2 /usr/sbin/opensips[1109]: After routing: ru=sip:34615122...@TRUNK; du=<null>; rd=TRUNK<br>
Jan 20 16:24:19 sbc2 /usr/sbin/opensips[1109]: route-111: ru=sip:34615122...@TRUNK; du=<null>; rd=TRUNK<br><br><div class="gmail_quote">2010/1/19 Magnus Burman <span dir="ltr"><<a href="mailto:magnus.burman@adamo.es">magnus.burman@adamo.es</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>I'm moving from Opensips 1.4 to 1.6.1 currently and I'm getting some strange behavior from droute. After it sends the INVITE, it resends it, and again, for a total of 8 times, each time adding the opensips ip to record-route and Via. Each invite gets its own record in radacct.<br>
<br>Anyone with an idea where I'm going wrong?<br><br>Below is the "relevant" part of my config:<br><br>route[1] {<br> setflag(1);<br> $avp(s:can_uri) = $ru;<br> if (!t_relay()) {<br> sl_reply_error();<br>
};<br> exit;<br>}<br><br>route[10] {<br># pre-processing with strips/prefixes etc<br> ...<br> if(do_routing("0")) {<br> xlog("Regular routing");<br> route(1);<br> exit;<br>
}<br> exit;<br>}<br><br>Below is the first INVITE sent out by Opensips. IP:s have been changed to protect the innocent; they're all public, no NAT:<br><br>U 2010/01/19 17:29:19.825093 <a href="http://111.111.114.120:5060" target="_blank">111.111.114.120:5060</a> -> <a href="http://222.222.222.222:5060" target="_blank">222.222.222.222:5060</a><br>
INVITE <a href="mailto:sip%3A34610100100@222.222.222.222" target="_blank">sip:34610100100@222.222.222.222</a> SIP/2.0.<br>Record-Route: <sip:111.111.114.120;lr=on;ftag=fd1f3a1d6bcfabebo0;vsf=AAAAAF5VXlZBQ2ZEXUNEAAAAAAAAAAAAAAAAAAAA;did=01.aa2219f7>.<br>
Via: SIP/2.0/UDP 111.111.114.120;branch=z9hG4bK3eea.5d650714.1.<br>Via: SIP/2.0/UDP 111.111.115.122:5060;branch=z9hG4bK-4fddec66.<br>From: "34620200200" <<a href="mailto:sip%3A34620200200@111.111.114.120" target="_blank">sip:34620200200@111.111.114.120</a>>;tag=fd1f3a1d6bcfabebo0.<br>
To: <<a href="mailto:sip%3A610100100@111.111.114.120" target="_blank">sip:610100100@111.111.114.120</a>>.<br>Call-ID: <a href="mailto:6bf71385-646761a3@111.111.115.122" target="_blank">6bf71385-646761a3@111.111.115.122</a>.<br>
CSeq: 101 INVITE.<br>
Max-Forwards: 69.<br>Contact: "Magnus" <<a href="http://sip:magnus_test@111.111.115.122:5060" target="_blank">sip:magnus_test@111.111.115.122:5060</a>>.<br>Expires: 240.<br>User-Agent: Linksys/SPA921-5.1.8.<br>
Content-Length: 208.<br>
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER.<br>Supported: replaces.<br>Content-Type: application/sdp.<br>P-hint: inbound->inbound .<br>.<br>v=0.<br>o=- 13541 13541 IN IP4 111.111.115.122.<br>s=-.<br>
c=IN IP4 111.111.115.122.<br>t=0 0.<br>m=audio 16408 RTP/AVP 8 101.<br>a=rtpmap:8 PCMA/8000.<br>a=rtpmap:101 telephone-event/8000.<br>a=fmtp:101 0-15.<br>a=ptime:30.<br>a=sendrecv.<br>
</blockquote></div><br>