<div dir="ltr">to clarify please translate "6.6.6.6" to "206.222.7.xxx"<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jun 9, 2013 at 1:41 AM, thomas fitzgibbon <span dir="ltr"><<a href="mailto:anning.marketing@gmail.com" target="_blank">anning.marketing@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><b>Hello, I am quite new to opensips.</b><div>
<b>My current task requires complete transformation of DIDs.</b></div><div><b>I am using opensips 1.6 and the dialplan module.</b></div><div><b>The DID is transformed correctly but I get a strange response to the sip invite (see below)</b></div>
<div><b><br></b></div><div><b>I assume its a simple config issue, I havn't been able to find many drouting examples online and most of them involve variables which I dont understand. </b></div><div><b><br>
</b></div><div><b>Any hints appreciated</b></div><div><b><br></b></div><div><b>relevant configs:</b></div><div><br></div><div><div>modparam ("dialplan", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")</div>
<div>modparam ("dialplan", "table_name", "dialplan")</div><div><br></div><div><b><br></b></div><div><b>This is how I call dp_translate </b></div><div><br></div><div><div> if (src_ip==4.4.4.4) || (src_ip==5.5.5.5) { </div>
<div> dp_translate ("1"); <b> ##Do I need more parameters here?</b></div><div> rewritehostport( "<a href="http://6.6.6.6:5061" target="_blank">6.6.6.6:5061</a>");</div>
<div>
route(1);</div><div><br></div><div> }</div><div><br></div><div><b>dialplan rule:</b></div><div><br></div><div><div>'1', '1', '0', '0', '13129245555', '11', '', '16155555555', ''</div>
<div><br></div><div><b>the calls is then passed to an asterisk pbx</b></div><div><b><br></b></div><div><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><br></div><div><div><div>U 207.182.132.xxx:5060 -> 206.222.7.xxx:5061</div><div>INVITE sip:16155555555@206.222.7.xxx:5061;user=phone SIP/2.0.</div><div>Record-Route: <sip:207.182.132.xxx;lr=on>.</div>
<div>Record-Route: <sip:216.66.79.xx;lr;ftag=gK0f629023;did=012.00d5527>.</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: "ttmmff11" <sip:+16617480xxx@74.120.95.xxx;user=phone>;tag=gK0f629023.</div><div>To: <sip:+13129245555@216.66.79.xx;user=phone>.</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: "ttmmff11" <sip:+16617480240@74.120.95.xxx:5060>.</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><b>But the response from asterisk has strange formatting and the invite from opensips keeps looping</b></div><div><b><br></b></div><div><div>I 206.222.7.xxx -> 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: <sip:207.182.132.xxx;lr=on>.</div><div>Record-Route: <sip:216.66.79.xx;lr;ftag=gK0f629023;did=012.00d5527>.</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: "ttmmff11" <sip:+16617480240@74.120.95.xxx;user=phone>;tag=gK0f629023.</div><div>To: <sip:+13129245555@216.66.79.xx;user=phone>.</div><div>Call-ID: 1963953326_77183</div></div><div><br>
</div><div><br></div><div><br></div></div></div></div></div>
</blockquote></div><br></div></div>