Once you extend it, just make a new function that takes the two parameter values, DDD and phone #.
Then inside that function just do your logic:
if(DDD != NULL)
// make sure phone # is also not Null
// Do any other rules and checks you want to do
return true; // for a pass
return false; // for a fail - this will effectively stop the save process until the input is corrected by the user.
Then in your model just assign the rule:
array('DDD', 'phone#', 'myCustomRuleFunction');
Not sure if you’d join the DDD and phone# as one but that would imply you’re doing the same function to both which would not be accurate.
Now an alternative, since you have it stored in the DB as one string, you can just pass the DDD and if it’s inputted (not null) then you can still access the phone# attribute (from your form) because you’re still in the model and thus it’s all shared). This means you can evaluate and combine them both as 1 to save to the db.