<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:10pt"><div>Hi<br><br>Following should work as well.<br><br>if (uri=~"sip:\+[0-9]+@.*") {<br> strip(1);<br><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 10pt;">may be you need to \+.<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Adam Twardowski <adam.twardowski@gmail.com><br><b><span style="font-weight: bold;">To:</span></b> OpenSIPS users mailling list <users@lists.opensips.org><br><b><span style="font-weight: bold;">Sent:</span></b> Monday, August 16, 2010 19:26:07<br><b><span style="font-weight: bold;">Subject:</span></b>
Re: [OpenSIPS-Users] Strip + character<br></font><br><meta http-equiv="x-dns-prefetch-control" content="off">I've never used strip() before, but you could try $rU=$(rU{s.substr,1,0})<div><br></div><div>you could also do something similar in your if() statement if you want to get rid of the regular expression and save a couple cpu cycles.<br>
<br><div class="gmail_quote">On Mon, Aug 16, 2010 at 9:45 AM, michel freiha <span dir="ltr"><<a rel="nofollow" ymailto="mailto:michofr@gmail.com" target="_blank" href="mailto:michofr@gmail.com">michofr@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Dear All,<br><br>I'm trying to strip + from dialed number that hit the OpenSIPS server, after that I'm using carrierroute that read from database all routes and send the call to the appropriate GW...The issue that the number is sent with the + to the destination GW so i need you to help me please...<br>
<br>The DialPlan is as below:<br><br>if($rU =~ "^[+].*" )<br>{<br> strip(1);<br> if(!cr_route("default", "0", "$rU", "$rU", "call_id")){<br><br> sl_send_reply("403", "Not allowed");<br>
} else {<br> t_on_failure("1");<br> # Relay the request to the gateway<br> t_relay();<br><br> }<br><br><br>Regards<br><br><br><div style="display: inline;">
</div></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a rel="nofollow" ymailto="mailto:Users@lists.opensips.org" target="_blank" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a rel="nofollow" target="_blank" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>
<meta http-equiv="x-dns-prefetch-control" content="on"></div></div>
</div><br></body></html>