<div>Many thanks. Such an example is exactly what I need.</div>
<div>&nbsp;</div>
<div>For now even the simplest will help. I am currently trying to filter anything less than say 5 digits and reject the call on OpenSER itself, as these will never complete. Our customers are all over the world so it will be difficult to implement a maximum.
</div>
<div>&nbsp;</div>
<div>This will at least help eliminate some of the erroneous traffic which is caused by&nbsp;our customers not dialling properly and&nbsp;is sent downstream to our carriers who complain because it makes their ASRs look bad.</div>
<div>&nbsp;</div>
<div>Will try with:</div>
<div><br>if (uri=~&quot;sip:[0-9]{6,24}&quot;) {</div>
<div>&nbsp;&nbsp; sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);</div>
<div>}</div>
<div>&nbsp;</div>
<div><br>&nbsp;</div>
<div><span class="gmail_quote">On 9/19/06, <b class="gmail_sendername">Mark Kent</b> &lt;<a href="mailto:mark@noc.mainstreet.net">mark@noc.mainstreet.net</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">&gt; Basically I am trying to find out a way of checking for minimum and<br>&gt; maximum digit length dialled by our users, in order to filter some
<br>&gt; of the traffic through our OpenSER server. Dialling rules aside, is<br>&gt; there a way?<br><br>Unless I missed it, no one told the guy what he needs to know.<br>Instead, he is pointed at a lengthy specification for posix regular
<br>expressions.&nbsp;&nbsp;I know there is value in teaching a guy to fish, but at<br>some point someone has to just answer the question...<br><br>This<br><br>if (uri=~&quot;sip:[0-9]{10,24}&quot;) {<br>&nbsp;&nbsp; ...<br>}<br><br>will match a sequence of digits between 10 and 24 in length (inclusive).
<br><br>Now, the above&nbsp;&nbsp;is not a great test in practice.&nbsp;&nbsp;I don't know how long<br>the longest number can be outside the North American Numbering plan<br>(where it is relatively easy: 1-NXX-NXX-XXXX, see <a href="http://nanpa.com">
nanpa.com</a>).<br>And there are restrictions on the first few digits that you might<br>want to check, depending on where you are in the world.<br><br>I'm sure that someone reading this list has already got the ultimate,<br>
global, number checker coded for openser... it's just a question of<br>whether they'll cough it up in public.<br><br>-mark<br></blockquote></div><br>