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(&quot;route-1: ru=$ru; du=$du; rd=$rd&quot;);<br>    exit;<br>}<br><br>route[10] {<br># pre-processing with strips/prefixes etc<br>    ...<br>    xlog(&quot;Before routing:  ru=$ru; du=$du; rd=$rd&quot;);<br>

    if(do_routing(&quot;0&quot;)) {<br>        xlog(&quot;After routing: ru=$ru; du=$du; rd=$rd&quot;);<br>        route(111);<br>        exit;<br>    }<br>    exit;<br>}<br><br>route[111] {<br>    setflag(1);<br>    $avp(s:can_uri) = $ru;<br>

    xlog(&quot;route-111: ru=$ru; du=$du; rd=$rd&quot;);<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=&lt;null&gt;; rd=opensips<br>

Jan 20 16:24:19 sbc2 /usr/sbin/opensips[1109]: route-1:            ru=sip:34615122...@opensips; du=&lt;null&gt;; rd=opensips<br>Jan 20 16:24:19 sbc2 /usr/sbin/opensips[1109]: After routing:    ru=sip:34615122...@TRUNK;   du=&lt;null&gt;; rd=TRUNK<br>

Jan 20 16:24:19 sbc2 /usr/sbin/opensips[1109]: route-111:        ru=sip:34615122...@TRUNK;   du=&lt;null&gt;; rd=TRUNK<br><br><div class="gmail_quote">2010/1/19 Magnus Burman <span dir="ltr">&lt;<a href="mailto:magnus.burman@adamo.es">magnus.burman@adamo.es</a>&gt;</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&#39;m moving from Opensips 1.4 to 1.6.1 currently and I&#39;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&#39;m going wrong?<br><br>Below is the &quot;relevant&quot; 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(&quot;0&quot;)) {<br>        xlog(&quot;Regular routing&quot;);<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&#39;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> -&gt; <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: &lt;sip:111.111.114.120;lr=on;ftag=fd1f3a1d6bcfabebo0;vsf=AAAAAF5VXlZBQ2ZEXUNEAAAAAAAAAAAAAAAAAAAA;did=01.aa2219f7&gt;.<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: &quot;34620200200&quot; &lt;<a href="mailto:sip%3A34620200200@111.111.114.120" target="_blank">sip:34620200200@111.111.114.120</a>&gt;;tag=fd1f3a1d6bcfabebo0.<br>


To: &lt;<a href="mailto:sip%3A610100100@111.111.114.120" target="_blank">sip:610100100@111.111.114.120</a>&gt;.<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: &quot;Magnus&quot; &lt;<a href="http://sip:magnus_test@111.111.115.122:5060" target="_blank">sip:magnus_test@111.111.115.122:5060</a>&gt;.<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-&gt;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>