Rv: Re: Rv: Re: [Serusers] blocking certain countries

Nhadie nhadie at cbcpworld.com
Sat Apr 23 18:18:44 CEST 2005


Hi Sir,

Thanks for your reply. I tried that also, what I did looks like this:

if ((uri=~"^(sip:)?00246[0-9]*@([a-z]+\.)?mydomain\.com") ||
(uri=~"^(sip:)?00246[0-9]*@111\.111\.111\.111")) {
if (isflagset(8)) {xlog("L_INFO", "Call to those locations are not
allowed\n");};
sl_send_reply("404", "Not Found");
break;

} else if ((uri=~"^(sip:)?00[0-9]*@([a-z]+\.)?mydomain\.com") ||
(uri=~"^(sip:)?00[0-9]*@111\.111\.111\.111")) {
if (isflagset(8)) {xlog("L_INFO", "Call to anywhere in the World\n");};
# Strip first to digits (00)
strip(2);
# Prefix with 12345#
prefix("12345#");
rewritehostport("222.222.222.222:5060");
# Remove credentials
consume_credentials();
# Route call
t_relay_to_udp("222.222.222.222", "5060");
break;

But problem there is that I can't call anywhere. Any other problem you can
think of sir?

regards
nhadie

--------- Mensagem Original --------
From: Atle Samuelsen <clona at camaro.no>
To: Nhadie <nhadie at cbcpworld.com>
Cc: serusers at lists.iptel.org
Subject: Re: Rv: Re: [Serusers] blocking certain countries
Date: 23/04/05 22:54

>
> if (uri =~&quot;^003246&quot;){
>         sl_send_reply(403,&quot;Go away&quot;);
>         break;
>      };
>
> * Nhadie &lt;nhadie at cbcpworld.com&gt; [050423 16:12]:
> &gt; Hi Sir,
> &gt;
> &gt; I need to block country codes 246, 871-874 and 881. For my customer
to dial
> &gt; pstn, they simply dial 00 first then country code, etc.
> &gt;
> &gt; Any idea why my reg exp doesn't work? thank you
> &gt;
> &gt; regards,
> &gt; nhadie
> &gt;
> &gt;
> &gt; --------- Mensagem Original --------
> &gt; From: Marian Dumitru &lt;marian.dumitru at voice-sistem.ro&gt;
> &gt; To: Nhadie &lt;nhadie at cbcpworld.com&gt;
> &gt; Cc: serusers at lists.iptel.org
> &gt; Subject: Re: [Serusers] blocking certain countries
> &gt; Date: 23/04/05 18:08
> &gt;
> &gt; &gt;
> &gt; &gt; Hi Nhadie,
> &gt; &gt;
> &gt; &gt; Most probably there is something wrong with the regular express
and the
> &gt; &gt; dialled RURI doesn't match.
> &gt; &gt; What RURI suppose to match and doesn't?
> &gt; &gt;
> &gt; &gt; Best regards,
> &gt; &gt; Marian
> &gt; &gt;
> &gt; &gt; Nhadie wrote:
> &gt; &gt; &amp;gt; Hi All,
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt; I defined something like this on my config, to block
pstn calls to
> &gt; &gt; &amp;gt; certain countries. Unfortunately it doesn't work.
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;  if
> &gt;
((uri=~&amp;quot;^(sip:)?00(871-874|881|246)[0-9]*@([a-z]+.)?mydomain.com&amp;quot;)
> &gt; &gt; &amp;gt; ||
(uri=~&amp;quot;^(sip:)?00(871-874|881|246)[0-9]*@10.0.2.200&amp;quot;)) {
> &gt; &gt; &amp;gt;             if (isflagset(8))
{xlog(&amp;quot;L_INFO&amp;quot;, &amp;quot;Call to
> &gt; those locations
> &gt; &gt; &amp;gt; are not allowedn&amp;quot;);};
> &gt; &gt; &amp;gt;             sl_send_reply(&amp;quot;404&amp;quot;,
&amp;quot;Not Found&amp;quot;);
> &gt; &gt; &amp;gt;             break;
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt;         } else if
> &gt; ((uri=~&amp;quot;^(sip:)?00[0-9]*@([a-z]+.)?mydomain.com&amp;quot;)
||
> &gt; &gt; &amp;gt; (uri=~&amp;quot;^(sip:)?00[0-9]*@10.0.2.200&amp;quot;))
{
> &gt; &gt; &amp;gt;      if (isflagset(8))
{xlog(&amp;quot;L_INFO&amp;quot;, &amp;quot;Call to
> &gt; anywhere in the Worldn&amp;quot;);};
> &gt; &gt; &amp;gt;                          # Strip first to digits (00)
> &gt; &gt; &amp;gt;                          strip(2);
> &gt; &gt; &amp;gt;                          # Prefix with 12345#
> &gt; &gt; &amp;gt;                         
prefix(&amp;quot;12345#&amp;quot;);
> &gt; &gt; &amp;gt;
> &gt; rewritehostport(&amp;quot;123.123.123.123:5060&amp;quot;);
> &gt; &gt; &amp;gt;                          # Remove credentials
> &gt; &gt; &amp;gt;                          consume_credentials();
> &gt; &gt; &amp;gt;                          # Route call
> &gt; &gt; &amp;gt;                         
t_relay_to_udp(&amp;quot;123.123.123.123&amp;quot;,
> &gt; &amp;quot;5060&amp;quot;);
> &gt; &gt; &amp;gt;                          break;
> &gt; &gt; &amp;gt;                          }
> &gt; &gt; &amp;gt;       } else {
> &gt; &gt; &amp;gt;   .....
> &gt; &gt; &amp;gt;   .....
> &gt; &gt; &amp;gt;   .....
> &gt; &gt; &amp;gt;   .....
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt; can anyone tell my error here? thank you in advance
> &gt; &gt; &amp;gt;
> &gt; &gt; &amp;gt; regards,
> &gt; &gt; &amp;gt; nhadie
> &gt; &gt;
> &gt; &gt; --
> &gt; &gt; Voice System
> &gt; &gt; http://www.voice-system.ro
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;
> &gt;
> &gt; _______________________________________________
> &gt; Serusers mailing list
> &gt; serusers at lists.iptel.org
> &gt; http://lists.iptel.org/mailman/listinfo/serusers
> &gt;
>
>
>
>
>




More information about the sr-users mailing list