<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Thanks to your response.<br>
<br>
I will testing this solution<br>
<br>
bye<br>
<br>
Le 06/03/2013 11:54, Bogdan-Andrei Iancu a écrit :<br>
</div>
<blockquote cite="mid:51372054.7030907@opensips.org" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<tt>Hi Mickael,<br>
<br>
In this case I would suggest using 2 groups of rules - one for
the short numbers, one for the normal numbers.<br>
<br>
First try the short numbers and enforce the matching based on
the len of the number (I guess the premium numbers have some fix
len) ; also consider the L flag (see <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://www.opensips.org/html/docs/modules/1.9.x/drouting.html#id293614">http://www.opensips.org/html/docs/modules/1.9.x/drouting.html#id293614</a>).<br>
<br>
If this first matching failed -> try in the second group with
the long numbers.<br>
<br>
More or less, your approach seems correct, I would say.<br>
<br>
Regards,<br>
</tt>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<br>
On 03/06/2013 12:09 PM, Mickael HUBERT wrote:
<blockquote cite="mid:513715F4.20200@winlux.fr" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">Hi,<br>
It's not OK for me, look:<br>
<br>
If I have:<br>
+33 366985475 (landline number in France)<br>
<br>
and<br>
<br>
+33 3669 (premium rate number in France)<br>
<br>
In my DB in dr_rules table I have:<br>
<br>
INSERT INTO `dr_rules` (`ruleid`, `groupid`, `prefix`,
`timerec`, `priority`, `routeid`, `gwlist`, `attrs`,
`description`) VALUES<br>
(1, '1', '333', '', 1, '', '#1', NULL, 'all number 3XYZ'),<br>
<br>
but landline number match with rule 1.<br>
<br>
<span id="result_box" class="short_text" lang="en"><span
class="hps">how to differentiate</span> <span class="hps">this
two</span> <span class="hps">prefixes?</span></span><br>
<br>
Actualy I've coded:<br>
<br>
560 if(uri=~"^<a moz-do-not-send="true"
class="moz-txt-link-freetext" href="sip:3">sip:3</a>[0-9]{3}@"
|| uri=~"^<a moz-do-not-send="true"
class="moz-txt-link-freetext" href="sip:10">sip:10</a>[0-9]{2}@"
|| uri=~"^<a moz-do-not-send="true"
class="moz-txt-link-freetext" href="sip:118">sip:118</a>[0-9]{3}@")
<b># premium rate number</b><b> FRANCE no E164 format</b><br>
561 { <br>
562 if(!do_routing("3"))<br>
563 { <br>
564 send_reply("503","No Rules matching the URI");
<br>
565 xlog("L_ERR","$ci No DR_RULES matching the URI
for DR_GROUP 3\n");<br>
566 exit;<br>
567 }<br>
568 }<br>
569 else <b># other number E164 format</b><br>
570 { <br>
571 strip(1);<br>
572 setflag(29);<br>
573 <br>
574 if(!do_routing("1"))<br>
575 { <br>
576 send_reply("503","No Rules matching the
URI"); <br>
577 xlog("L_ERR","$ci No DR_RULES matching the
URI for DR_GROUP 1\n");<br>
578 exit;<br>
579 }<br>
580 }<br>
<br>
Should I continue with this code ? I will wish improve this
code and make it simple ;)<br>
<br>
<br>
Le 05/03/2013 14:07, Bogdan-Andrei Iancu a écrit :<br>
</div>
<blockquote cite="mid:5135EE27.3070906@opensips.org" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<tt>Hi Mickael,<br>
<br>
I guess your overlapping happens because the prefixes are
not consistent as format. The 3669 is a France national
number and 36xxx is international format.<br>
<br>
If you want to put those numbers in the same routing group,
you should consider having all in the same international
format, to avoid collisions :<br>
+33 3669<br>
+36 xxxx<br>
<br>
Regards,</tt><br>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<br>
On 03/05/2013 11:25 AM, Mickael HUBERT wrote:
<blockquote cite="mid:5135BA0D.8000204@winlux.fr" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
Hi list,<br>
I have a issue in my drouting module.<br>
<br>
In fact I have many prefixes and overlap is not OK to me.<br>
<br>
<u>Example:</u><br>
<br>
Prefix: 3669 (In France is premium rate number, 4 digits is
talking clock service)<br>
<br>
Prefix: 36.... (is prefix hungary)<br>
<br>
In my dr_rule table is:<br>
<br>
<i>INSERT INTO `dr_rules` (`ruleid`, `groupid`, `prefix`,
`timerec`, `priority`, `routeid`, `gwlist`, `attrs`,
`description`) VALUES</i><i><br>
</i><i>(1, '1', '3', '', 1, '', '#1', NULL, 'All numbers
3XYZ'),</i><i><br>
</i><i>(2, '1', '36', '', 1, '', '#2', NULL, 'Hungary
prefixe');</i><br>
<br>
If +36 1 398 0344 (to hungary destination), Drouting module
choose id 2 no ?<br>
if 3669 (to clock service), drouting module choose id 2 too
?<br>
<br>
<span id="result_box" class="short_text" lang="en"><span
class="hps">how to differentiate</span> <span
class="hps">this two</span> <span class="hps">prefixes?</span></span><br>
<br>
thanks in advance<br>
<pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
</blockquote>
<br>
</blockquote>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>