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

Iqbal iqbal at gigo.co.uk
Sun Apr 24 01:45:43 CEST 2005


Hi

If ur using the lcr module then if you insert the prefixes for the
countries in the lcr table, and assign no gateways to the countries you
dont want called then there will be no call, thats one way of doing it,
theother possibly a nicer way is to have all the gateways in the lcr
table, and when you assign a user assign him to a group, and then in
your config set a flag for each group, and in the INVITE section (or
others), if the flag is set let them call the country.

First one is easier but much cruder

Iqbal

On 4/23/2005, "Nhadie" <nhadie at cbcpworld.com> wrote:

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




More information about the sr-users mailing list