}
checkPortRange( internalPort );
description = description == null ? "" : description;
if ( leaseDuration < 0 ) throw new IllegalArgumentException( "Invalid leaseDuration (" + leaseDuration + ") value" );
ActionMessage msg = msgFactory.getMessage( "AddPortMapping" );
msg.setInputParameter( "NewRemoteHost", remoteHost )
.setInputParameter( "NewExternalPort", externalPort )
.setInputParameter( "NewProtocol", protocol )
.setInputParameter( "NewInternalPort", internalPort )
.setInputParameter( "NewInternalClient", internalClient )
.setInputParameter( "NewEnabled", true )
.setInputParameter( "NewPortMappingDescription", description )
.setInputParameter( "NewLeaseDuration", leaseDuration );
try {
msg.service();
return true;
} catch ( UPNPResponseException ex ) {
if ( ex.getDetailErrorCode() == 718 ) {
return false;
}