<div dir="ltr"><b>Hello, I am quite new to opensips.</b><div style><b>My current task requires complete transformation of DIDs.</b></div><div style><b>I am using opensips 1.6 and the dialplan module.</b></div><div style><b>The DID is transformed correctly but I get a strange response to the sip invite (see below)</b></div>
<div style><b><br></b></div><div style><b>I assume its a simple config issue, I havn&#39;t been able to find many drouting examples online and most of them involve variables which I dont understand. </b></div><div style><b><br>
</b></div><div style><b>Any hints appreciated</b></div><div style><b><br></b></div><div style><b>relevant configs:</b></div><div style><br></div><div style><div>modparam (&quot;dialplan&quot;, &quot;db_url&quot;, &quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)</div>
<div>modparam (&quot;dialplan&quot;, &quot;table_name&quot;, &quot;dialplan&quot;)</div><div><br></div><div><b><br></b></div><div style><b>This is how I call dp_translate </b></div><div style><br></div><div style><div> if (src_ip==4.4.4.4) || (src_ip==5.5.5.5) {     </div>
<div>        dp_translate (&quot;1&quot;);                                 <b> ##Do I need more parameters here?</b></div><div>        rewritehostport( &quot;<a href="http://6.6.6.6:5061">6.6.6.6:5061</a>&quot;);</div><div>
        route(1);</div><div><br></div><div>        }</div><div><br></div><div style><b>dialplan rule:</b></div><div style><br></div><div style><div style>&#39;1&#39;, &#39;1&#39;, &#39;0&#39;, &#39;0&#39;, &#39;13129245555&#39;, &#39;11&#39;, &#39;&#39;, &#39;16155555555&#39;, &#39;&#39;</div>
<div style><br></div><div style><b>the calls is then passed to an asterisk pbx</b></div><div style><b><br></b></div><div style><b>The main function seems to be working properly, and the invite to asterisk looks like this </b><b>(the dialplan has replaced the DID)</b></div>
<div style><br></div><div style><div><div>U 207.182.132.xxx:5060 -&gt; 206.222.7.xxx:5061</div><div>INVITE sip:16155555555@206.222.7.xxx:5061;user=phone SIP/2.0.</div><div>Record-Route: &lt;sip:207.182.132.xxx;lr=on&gt;.</div>
<div>Record-Route: &lt;sip:216.66.79.xx;lr;ftag=gK0f629023;did=012.00d5527&gt;.</div><div>Via: SIP/2.0/UDP 207.182.132.xxx;branch=z9hG4bK59c8.843a2614.0.</div><div>Via: SIP/2.0/UDP 216.66.79.xx;branch=z9hG4bK59c8.4a5dcc82.0.</div>
<div>Via: SIP/2.0/UDP 74.120.95.xxx:5060;branch=z9hG4bK0fB2d616c8782204e36.</div><div>From: &quot;ttmmff11&quot; &lt;sip:+16617480xxx@74.120.95.xxx;user=phone&gt;;tag=gK0f629023.</div><div>To: &lt;sip:+13129245555@216.66.79.xx;user=phone&gt;.</div>
<div>Call-ID: 1963953326_77183542@74.120.95.xxx.</div><div>CSeq: 29022 INVITE.</div><div>Max-Forwards: 64.</div><div>Allow: INVITE,ACK,CANCEL,BYE,REGISTER,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS.</div><div>Accept: application/sdp, application/isup, application/dtmf, application/dtmf-relay,  multipart/mixed.</div>
<div>Contact: &quot;ttmmff11&quot; &lt;sip:+16617480240@74.120.95.xxx:5060&gt;.</div><div>Supported: timer,100rel,replaces.</div><div>Session-Expires: 1800.</div><div>Min-SE: 90.</div><div>Content-Length:  234.</div><div>
Content-Disposition: session; handling=required.</div><div>Content-Type: application/sdp.</div><div>.</div><div>v=0.</div><div>o=Sonus_UAC 9864 544 IN IP4 74.120.95.195.</div><div>s=SIP Media Capabilities.</div><div>c=IN IP4 74.120.95.199.</div>
<div>t=0 0.</div><div>m=audio 8786 RTP/AVP 0 101.</div><div>a=rtpmap:0 PCMU/8000.</div><div>a=rtpmap:101 telephone-event/8000.</div><div>a=fmtp:101 0-15.</div><div>a=sendrecv.</div><div>a=maxptime:20.</div></div><div><br>
</div></div><div style><b>But the response from asterisk has strange formatting and the invite from opensips keeps looping</b></div><div style><b><br></b></div><div style><div>I 206.222.7.xxx -&gt; 207.182.132.xxx 3:3</div>
<div>....E.....@.=.................b.INVITE sip:16155555555@206.222.7.xxx:5061;user=phone SIP/2.0.</div><div>Record-Route: &lt;sip:207.182.132.xxx;lr=on&gt;.</div><div>Record-Route: &lt;sip:216.66.79.xx;lr;ftag=gK0f629023;did=012.00d5527&gt;.</div>
<div>Via: SIP/2.0/UDP 207.182.132.xxx;branch=z9hG4bK59c8.843a2614.0.</div><div>Via: SIP/2.0/UDP 216.66.79.xx;branch=z9hG4bK59c8.4a5dcc82.0.</div><div>Via: SIP/2.0/UDP 74.120.95.xxx:5060;branch=z9hG4bK0fB2d616c8782204e36.</div>
<div>From: &quot;ttmmff11&quot; &lt;sip:+16617480240@74.120.95.xxx;user=phone&gt;;tag=gK0f629023.</div><div>To: &lt;sip:+13129245555@216.66.79.xx;user=phone&gt;.</div><div>Call-ID: 1963953326_77183</div></div><div style><br>
</div><div style><br></div><div><br></div></div></div></div></div>