<HTML>
<HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="Open WebMail 2.20 20031014" name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>

<font size="2"><b>Sure... it's possible and actually pretty easy, dependent on how things are set up. Assuming, for the sake of argument, that you have two servers that handle PSTN calls and one handles calls to anywhere and one handles calls to only 36 countries:
<br />
<br />I'd use the grp table for this sort of thing (although some people would use AVPops).  I'd just add the users to a particular kind of group for all access.... 
<br />
<br />In MySQL, you'd want to do something like:
<br />
<br />insert into grp values('&lt;username&gt;','&lt;domainname&gt;','fullaccess',now());
<br />
<br />
<br />
<br />Then, set a flag if the user is in that group...
<br />
<br />if(is_user_in(&quot;Request-URI&quot;, &quot;fullaccess&quot;))
<br />{
<br />       setflag(19);
<br />};
<br />
<br />
<br />Then... somewhere in an INVITE check block (or wherever, really), check for the URI and the flag. 
<br />
<br />if (uri =~ &quot;^sip:00*&quot;) 
<br />{
<br />        if(isflagset(19))
<br />        {
<br />            log(1, &quot;request for alternate 800 provider received\n&quot;);
<br />            rewritehostport(&quot;10.1.1.1:5060&quot;);  # PSTN for ALL numbers
<br />            forward(uri:host, uri:port);
<br />            route(1);
<br />            break;
<br />         }
<br />        else
<br />        {
<br />                </b></font><font size="2"><b>log(1, &quot;request for alternate 800 provider received\n&quot;);
<br />
            rewritehostport(&quot;10.1.1.2:5060&quot;);  # PSTN for only 36 countries
<br />
            forward(uri:host, uri:port);
<br />
            route(1);
<br />
            break;
<br />        };
<br />
<br /></b></font><font size="2"><b>};
<br />
<br />
<br />
<br />Now, the trick comes when you DON'T have PSTN server separate for different countries...  
<br />
<br />THEN you might have to do some very in-depth rules based on the format of the URI to the 36 countries in question which really isn't THAT bad, but dependent on their numeric format for numbers, it could get annoying to specify each one (especially if they have differing formats for land line and mobile numbers).  It's not undoable, though. 
<br />
<br />N.
<br />
<br />
<br />On Mon, 10 Oct 2005 20:17:50 +0800, Nhadie wrote</b>
<br />&gt; Hi All,
<br />&gt; 
<br />&gt; I'd like to setup to groups, one that can call only around 36
countries and one that can call anywhere. Currently, when I see that the URI
starts with 00 i'll check if it belongs to the world-pstn group then it can
dial-out if not it's blocked. Is what I'm thinking
possible?
<br />&gt; 
<br />&gt; TIA
<br />&gt; 
<br />&gt; Regards,
<br />&gt; Nhadie

<br />
<br />
<br />
</font>
</BODY>
</HTML>