You can also use LCR module. <br><br>-Jai Rangi<br><br><br><div><span class="gmail_quote">On 6/29/07, <b class="gmail_sendername">Alfred E. Heggestad</b> &lt;<a href="mailto:aeh@db.org">aeh@db.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Shaun<br><br>Shaun Hofer wrote:<br>&gt; Hi,<br>&gt;<br>&gt; To terminate a call to the PSTN, my SER box has to route between<br>&gt; multiple PSTN gateways depending on the destination phone number/prefix.<br>&gt;<br>&gt; For instance,
<br>&gt; -Use gateway1 if the destination begins with any of these prefixes:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 07550[0-4] 075509 07551[0-2] 075514 075515[7-8] 0755187<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 0755337 07553[7-9] 075551[0-1] 07555[2-8] 07556[0-4] etc..<br>&gt;
<br>&gt; -Use gateway2 if the destination begins with any of these prefixes:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 0730[0-2] 07303[0-6] 0731[0-2] 073131 07313[5-9] 073140<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 07314[4-6] 0731[6-7] 0732[1-7] 07329[1-2] 07329[5-6] etc..<br>&gt;
<br>&gt; -Use gateway3 if etc...<br>&gt; -Use gatewayX if etc...<br>&gt;<br>&gt; Obviously, one or a small number of regular expressions can&#39;t efficiently<br>&gt; cover all of these prefixes. However, doing it like this isn&#39;t ideal
<br>&gt; because ser.cfg would be huge and cumbersome. Also, the prefixes for each<br>&gt; gateway may change over time:<br>&gt;<br>&gt; if ( (uri =~ &quot;^sip:07550[0-4]&quot;) || (uri =~ &quot;^sip:075509&quot;) || ... )
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; { route to gateway1 }<br>&gt; if ( (uri =~ &quot;^sip:0730[0-2]&quot;) || (uri =~ &quot;^sip:07303[0-6]&quot;) || ... )<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; { route to gateway2 }<br>&gt; if ( ... )<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; { route to gatewayX }<br>
&gt;<br>&gt; What&#39;s the most efficient way of doing this with SER?<br>&gt;<br><br>you might want to try the &quot;prefix_route&quot; module which can be downloaded<br>from here:<br><br>&nbsp;&nbsp; <a href="http://aeh.db.org/patch/">
http://aeh.db.org/patch/</a><br><br>it does exactly what you want, moving this logic from ser.cfg to the<br>database. it does not do regex though, but you can include all digits<br>in the table for e.g. 07550[0-4]:<br><br>
&nbsp;&nbsp; 075500 -&gt; route 1<br>&nbsp;&nbsp; 075501 -&gt; route 1<br>&nbsp;&nbsp; 075502 -&gt; route 1<br>&nbsp;&nbsp; 075503 -&gt; route 1<br>&nbsp;&nbsp; 075504 -&gt; route 1<br><br>etc.<br><br><br>/alfred<br><br>&gt; Thanks in advanced<br>&gt; -Shaun<br>&gt;<br>&gt; _______________________________________________
<br>&gt; Serusers mailing list<br>&gt; <a href="mailto:Serusers@lists.iptel.org">Serusers@lists.iptel.org</a><br>&gt; <a href="http://lists.iptel.org/mailman/listinfo/serusers">http://lists.iptel.org/mailman/listinfo/serusers
</a><br><br><br>_______________________________________________<br>Serusers mailing list<br><a href="mailto:Serusers@lists.iptel.org">Serusers@lists.iptel.org</a><br><a href="http://lists.iptel.org/mailman/listinfo/serusers">
http://lists.iptel.org/mailman/listinfo/serusers</a><br></blockquote></div><br>