Patches item #1965211, was opened at 2008-05-16 11:47 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1965211&group_id=139143
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: modules Group: ver 1.3.x Status: Open Resolution: None Priority: 5 Private: No Submitted By: IƱaki Baz (ibc_sf) Assigned to: Nobody/Anonymous (nobody) Summary: [PDT] Patch to include "check_domain" Initial Comment: Hi, by default PDT module doesn't allow two entries in 'pdt' table with same "sdomain" and "domain" fields. AFAIK OpenSer 1.4 includes a "check_table" parameter to allow the above. I submit a patch that includes this feature for OpenSer 1.3.1 or 1.3.2. I use it to implement international destination (by prefix) allow/deny system, this is, we can call to Spain, England, Finnland, USA, but not to Brasil (for example). For that I need a change in "pdt" table: CREATE TABLE `pdt` ( `id` int(10) unsigned NOT NULL auto_increment, `sdomain` varchar(128) NOT NULL default '*', `prefix` varchar(32) NOT NULL, `domain` enum('y','n') NOT NULL default 'y', `description` varchar(20) default NULL, PRIMARY KEY (`id`), UNIQUE KEY `sdomain_prefix_idx` (`sdomain`,`prefix`) ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 - 'sdomain' field doesn't matter and it can be whatever ('*' for example). - 'domain' becomes a SQL ENUM field ('y', 'n'). If 'domain' == 'y' then the destination is allowed, if 'n' then not. - 'description' can be the country code (or "Spain fixed", "England mobile"...). - 'prefix' is the E164 country/destination prefix (+34, +349, +44...). The OpenSer code would be: ---------------- modparam("pdt", "check_domain", 0) ... route[ROUTE_IS_PREFIX_ALLOWED] { # Here we must arrive with RURI normalize to E164 (+XXXXXXXXX). prefix2domain("2"); # If success, the RURI domain is modified (to 'y' so we need to replace later with our carrier IP/domain). # If -1 then the prefix doesn't exist so not allowed. if ($rc != 1) { xlog("L_INFO","--- Destination $rU not allowed \n"); return(-1); } # If "domain" is 'n' then this destiantion is not allowed (dissabled). if ($rd == "n") { xlog("L_INFO","--- Destination $rU dissabled \n"); return(-1); } return(1); } # If success remember to set the RURI domain after this route. ---------------- Hope it's useful. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1965211&group_id=139143 _______________________________________________ Devel mailing list Devel@lists.openser.org http://lists.openser.org/cgi-bin/mailman/listinfo/devel