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> <<a href="mailto:aeh@db.org">aeh@db.org</a>> 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>> Hi,<br>><br>> To terminate a call to the PSTN, my SER box has to route between<br>> multiple PSTN gateways depending on the destination phone number/prefix.<br>><br>> For instance,
<br>> -Use gateway1 if the destination begins with any of these prefixes:<br>> 07550[0-4] 075509 07551[0-2] 075514 075515[7-8] 0755187<br>> 0755337 07553[7-9] 075551[0-1] 07555[2-8] 07556[0-4] etc..<br>>
<br>> -Use gateway2 if the destination begins with any of these prefixes:<br>> 0730[0-2] 07303[0-6] 0731[0-2] 073131 07313[5-9] 073140<br>> 07314[4-6] 0731[6-7] 0732[1-7] 07329[1-2] 07329[5-6] etc..<br>>
<br>> -Use gateway3 if etc...<br>> -Use gatewayX if etc...<br>><br>> Obviously, one or a small number of regular expressions can't efficiently<br>> cover all of these prefixes. However, doing it like this isn't ideal
<br>> because ser.cfg would be huge and cumbersome. Also, the prefixes for each<br>> gateway may change over time:<br>><br>> if ( (uri =~ "^sip:07550[0-4]") || (uri =~ "^sip:075509") || ... )
<br>> { route to gateway1 }<br>> if ( (uri =~ "^sip:0730[0-2]") || (uri =~ "^sip:07303[0-6]") || ... )<br>> { route to gateway2 }<br>> if ( ... )<br>> { route to gatewayX }<br>
><br>> What's the most efficient way of doing this with SER?<br>><br><br>you might want to try the "prefix_route" module which can be downloaded<br>from here:<br><br> <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>
075500 -> route 1<br> 075501 -> route 1<br> 075502 -> route 1<br> 075503 -> route 1<br> 075504 -> route 1<br><br>etc.<br><br><br>/alfred<br><br>> Thanks in advanced<br>> -Shaun<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><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>