Hi! assuming that BulkSmsHttpGateway enum Region is already public
(http://code.google.com/p/smslib/source/detail?r=2233), I've modified
BulkSmsHttp class in order to change region by adding a new parameter called
region in bulksms section in SMSServer.conf (ej: myBulkSms.region=SPAIN). It
can have same values than Region enum: INTERNATIONAL(default), UNITEDKINGDOM,
SOUTHAFRICA, SPAIN, USA, GERMANY.
Changes needed are replace BulSmsHttp.java line 41 by the code bellow:
if (getProperties().getProperty(propName + "region")==null)
{
setGateway(new org.smslib.http.BulkSmsHTTPGateway(getGatewayId(), getProperties().getProperty(propName + "username"), getProperties().getProperty(propName + "password")));
}
else
{
org.smslib.http.BulkSmsHTTPGateway.Regions Region = org.smslib.http.BulkSmsHTTPGateway.Regions.INTERNATIONAL;
if (getProperties().getProperty(propName + "region").equalsIgnoreCase("UNITEDKINGDOM"))
Region = org.smslib.http.BulkSmsHTTPGateway.Regions.UNITEDKINGDOM;
else if (getProperties().getProperty(propName + "region").equalsIgnoreCase("SOUTHAFRICA"))
Region = org.smslib.http.BulkSmsHTTPGateway.Regions.SOUTHAFRICA;
else if (getProperties().getProperty(propName + "region").equalsIgnoreCase("SPAIN"))
Region = org.smslib.http.BulkSmsHTTPGateway.Regions.SPAIN;
else if (getProperties().getProperty(propName + "region").equalsIgnoreCase("USA"))
Region = org.smslib.http.BulkSmsHTTPGateway.Regions.USA;
else if (getProperties().getProperty(propName + "region").equalsIgnoreCase("GERMANY"))
Region = org.smslib.http.BulkSmsHTTPGateway.Regions.GERMANY;
setGateway(new org.smslib.http.BulkSmsHTTPGateway(getGatewayId(), getProperties().getProperty(propName + "username"), getProperties().getProperty(propName + "password"), Region));
}
Hope that helps.
Original issue reported on code.google.com by rafa...@gmail.com on 30 Aug 2010 at 12:19
Original issue reported on code.google.com by
rafa...@gmail.com
on 30 Aug 2010 at 12:19